OpenWAM
TVenturi.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 TVenturiH
30 #define TVenturiH
31 #include "TDepVolCteBase.h"
32 
33 class TVenturi: public TDepVolCteBase {
34  private:
35  // ---------------------------------------------------------------------------
36  // VARIABLES PRIVADAS
37  // ---------------------------------------------------------------------------
38 
39  bool asgNumeroVenturi;
40  // int FNumeroVenturi; // Numero del venturi
41  int FNodoEntrada; // Numero del nodo de entrada
42  int FNodoSalida; // Numero del nodo de salida
43  int FNodoLateral; // Numero del nodo lateral
44  int FUnionEntrada; // Numero de la union de entrada sobre el total de uniones del venturi
45  int FUnionSalida; // Numero de la union de salida sobre el total de uniones del venturi
46  int FUnionLateral; // Numero de la union lateral sobre el total de uniones del venturi
47  /* int FSentidoSalida; // Sentido del flujo en el nodo de salida.
48  int FSentidoEntrada; // Sentido del flujo en el nodo de entrada.
49  int FSentidoLateral; // Sentido del flujo en el nodo de lateral. */
50  double FRelacionSecciones;
51  double FRendimientoVenturi;
52  double FPerdidasCalor;
53  double FCoefEntrada; // Estas tres variables Ya no se usan. Se han sustitiudo por el
54  double FCoefSalida; // coeficiente de recuperacion.Borrarlas tras validar. Pedro.
55  double FCoefLateral;
56  stResInstantVenturi FResInstantVenturi;
57  stResMediosVenturi FResMediosVenturi;
58  double FMach0;
59  double FMach1;
60  TCondicionContorno *FCCEntrada;
61  TCondicionContorno *FCCSalida;
62  TCondicionContorno *FCCLateral;
63 
64  // ---------------------------------------------------------------------------
65  // FUNCIONES PRIVADAS
66  // ---------------------------------------------------------------------------
67 
68  // void PutNumeroVenturi(int NumeroVenturi);
69 
70  protected:
71 
72  public:
73  // ---------------------------------------------------------------------------
74  // VARIABLES PUBLICAS
75  // ---------------------------------------------------------------------------
76 
77  void PutNumeroVenturi(int NumeroVenturi) {
78  if(!asgNumeroVenturi) {
79  FNumeroVenturi = NumeroVenturi;
80  asgNumeroVenturi = true;
81  } else {
82  std::cout << "ERROR: Este Venturi ya tiene numero asignado" << std::endl;
83  throw Exception("");
84  }
85  }
86 
87  int FNumeroVenturi;
88  // Numero del venturi
89  int getNumeroVenturi() {
90  return FNumeroVenturi;
91  }
92 
93  int getNodoEntrada() {
94  return FNodoEntrada;
95  }
96  ;
97 
98  int getNodoSalida() {
99  return FNodoSalida;
100  }
101  ;
102 
103  int getNodoLateral() {
104  return FNodoLateral;
105  }
106  ;
107 
108  double getCoefEntrada() {
109  return FCoefEntrada;
110  }
111  ;
112 
113  double getCoefSalida() {
114  return FCoefSalida;
115  }
116  ;
117 
118  double getCoefLateral() {
119  return FCoefLateral;
120  }
121  ;
122 
123  double getPressure() {
124  return FPressure;
125  }
126  ;
127 
128  TCondicionContorno *getCCEntrada() {
129  return FCCEntrada;
130  }
131  ;
132 
133  TCondicionContorno *getCCLateral() {
134  return FCCLateral;
135  }
136  ;
137 
138  double getGamma() {
139  return FGamma;
140  }
141  ;
142 
143  double getgamma1() {
144  return FGamma1;
145  }
146  ;
147 
148  double getgamma3() {
149  return FGamma3;
150  }
151  ;
152 
153  // ---------------------------------------------------------------------------
154  // FUNCIONES PUBLICAS
155  // ---------------------------------------------------------------------------
156 
157  TVenturi(int i, nmTipoCalculoEspecies SpeciesModel, int numeroespecies, nmCalculoGamma GammaCalculation,
158  bool ThereIsEGR);
159 
160  ~TVenturi();
161 
162  void ActualizaPropiedades(double TimeCalculo);
163 
164  void CalculaVenturi();
165 
166  void LeeResultadosInstantVenturi(const char *FileWAM, fpos_t &filepos);
167 
168  void CabeceraResultadosInstantVenturi(stringstream& insoutput);
169 
170  void ImprimeResultadosInstantVenturi(stringstream& insoutput);
171 
172  void CalculaResultadosVenturi();
173 
174  void ReadAverageResultsVenturi(const char *FileWAM, fpos_t &filepos);
175 
176  void HeaderAverageResultsVenturi(stringstream& medoutput);
177 
178  void AcumulaResultadosMediosVenturi(double Actual);
179 
180  void ResultadosMediosVenturi();
181 
182  void ImprimeResultadosMediosVenturi(stringstream& medoutput);
183 
184  void LeeDatosVenturi(const char *FileWAM, fpos_t &filepos);
185 
186  void AsignaEntradaSalidaLateralCC();
187 
188  void UpdateProperties0DModel(double TimeCalculo);
189 
190 };
191 
192 // ---------------------------------------------------------------------------
193 #endif
194 
TDepVolCteBase
Definition: TDepVolCteBase.h:33
stResMediosVenturi
Definition: Globales.h:565
TCondicionContorno
Definition: TCondicionContorno.h:54
Exception
Custom exception class.
Definition: Exception.hpp:39
TVenturi
Definition: TVenturi.h:33
stResInstantVenturi
Definition: Globales.h:543