OpenWAM
TCCCompresorVolumetrico.h
1 /* --------------------------------------------------------------------------------*\
2 ==========================|
3  |\\ /\ /\ // O pen | OpenWAM: The Open Source 1D Gas-Dynamic Code
4  | \\ | X | // W ave |
5  | \\ \/_\/ // A ction | CMT-Motores Termicos / Universidad Politecnica Valencia
6  | \\/ \// M odel |
7  ----------------------------------------------------------------------------------
8  License
9 
10  This file is part of OpenWAM.
11 
12  OpenWAM is free software: you can redistribute it and/or modify
13  it under the terms of the GNU General Public License as published by
14  the Free Software Foundation, either version 3 of the License, or
15  (at your option) any later version.
16 
17  OpenWAM is distributed in the hope that it will be useful,
18  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  GNU General Public License for more details.
21 
22  You should have received a copy of the GNU General Public License
23  along with OpenWAM. If not, see <http://www.gnu.org/licenses/>.
24 
25 
26  \*-------------------------------------------------------------------------------- */
27 
28 // ---------------------------------------------------------------------------
29 #ifndef TCCCompresorVolumetricoH
30 #define TCCCompresorVolumetricoH
31 
32 #include "TCondicionContorno.h"
33 
34 // ---------------------------------------------------------------------------
35 // ---------------------------------------------------------------------------
36 
38  private:
39 
40  // int FNumeroCV; // Numero Compressor Volumetrico (de tornillo)
41  bool asgNumeroCV;
42 
43  double FRelacionVelocidadesCV; // Relacion de velocidades compresor volumetrico - motor.
44  double FPresionCV; // Presion de aspiracion.
45  double FTemperaturaCV; // Temperature de aspiracion.
46 
47  // Declaracion de los coeficientes de caudal, temperatura y potencia del compresor volumetrico.
48  double FC1Caudal, FC2Caudal, FC3Caudal;
49  double FC1Temperatura, FC2Temperatura, FC3Temperatura;
50  double FC1Potencia, FC2Potencia, FC3Potencia, FC4Potencia, FC5Potencia, FC6Potencia;
51 
52  int FNodoFin; // Nodo en el extremo del tubo que esta en la condicion de contorno.
53  int FIndiceCC; // Posicion del vector para tomar datos del tubo para la BC (0 Nodo izquierdo; 1 Nodo derecho)
54  double *FCC; // Caracteristica conocida del tubo.
55  double *FCD; // Caracteristica desconocida del tubo.
56  double FSeccionTubo; // Diametro del tubo en la condicion de contorno.
57 
58  double FGasto; // Massflow volumetrico del compresor en kg/s.
59  double FDensidad; // Density del aire en la aspiracion.
60  double FTemperature; // Temperature del gas entrante en degC.
61  double FPotencia;
62  double FPressure;
63  double FRegimen;
64  double FVelocity;
65 
66  double FSonido; // Velocity del sonido en el tubo.
67 
68  stResMediosCV FResMediosCV;
69  stResInstantCV FResInstantCV;
70 
71  nmRegimenValv FControlRegimen;
72 
73  double FGamma3; // Son expresiones con Gamma. Se usan estas variables para no calcularlas tantas veces por instante de tiempo en la misma funcion.
74  double FGamma4;
75  double *FComposicion;
76 
77  // FUNCIONES PRIVADAS
78 
79  // void PutNumeroCV(int valor);
80 
81  public:
82 
83  void PutNumeroCV(int valor) {
84 
85  if(!asgNumeroCV) {
86  FNumeroCV = valor;
87  asgNumeroCV = true;
88  } else {
89  std::cout << "ERROR: Este Compressor Volumetrico ya tiene numero asignado" << std::endl;
90  throw Exception("");
91  }
92 
93  }
94 
95  int FNumeroCV;
96 
97  // Numero Compressor Volumetrico (de tornillo)
98  int getNumeroCV() {
99  return FNumeroCV;
100  }
101 
102  double getPotenciaCV() {
103  return FPotencia;
104  }
105  ;
106 
107  TCCCompresorVolumetrico(nmTypeBC TipoCC, int numCC, nmTipoCalculoEspecies SpeciesModel, int numeroespecies,
108  nmCalculoGamma GammaCalculation, bool ThereIsEGR);
109 
111 
112  void CalculaCondicionContorno(double Time);
113 
114  void LeeCCCompresorVol(const char *FileWAM, fpos_t &filepos, int NumberOfPipes, TTubo **Pipe, bool HayMotor);
115 
116  void ObtencionValoresInstantaneos(double ene);
117 
118  void ReadAverageResultsCV(const char *FileWAM, fpos_t &filepos);
119 
120  void CabeceraResultadosMedCV(stringstream& medoutput);
121 
122  void ImprimeResultadosMedCV(stringstream& medoutput);
123 
124  void ResultadosMediosCV();
125 
126  void AcumulaResultadosMediosCV(double Actual);
127 
128  void LeeResultadosInstantCV(const char *FileWAM, fpos_t &filepos);
129 
130  void CabeceraResultadosInstantCV(stringstream& insoutput);
131 
132  void ImprimeResultadosInstantCV(stringstream& insoutput);
133 
134  void ResultadosInstantCV();
135 
136  void IniciaMedias();
137 
138 };
139 
140 #endif
141 
TTubo
a Finite differences pipe.
Definition: TTubo.h:116
TCCCompresorVolumetrico
Definition: TCCCompresorVolumetrico.h:37
TCondicionContorno
Definition: TCondicionContorno.h:54
Exception
Custom exception class.
Definition: Exception.hpp:39
stResMediosCV
Definition: Globales.h:597
stResInstantCV
Definition: Globales.h:615
TCCCompresorVolumetrico::CalculaCondicionContorno
void CalculaCondicionContorno(double Time)
Definition: TCCCompresorVolumetrico.cpp:201