OpenWAM
TCCUnionEntreDepositos.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 TCCUnionEntreDepositosH
30 #define TCCUnionEntreDepositosH
31 
32 #include "TCondicionContorno.h"
33 
34 #include <cstdio>
35 #include <iostream>
36 
37 //---------------------------------------------------------------------------
38 //---------------------------------------------------------------------------
39 
40 class TDeposito;
42  private:
43 
44  bool FIndependiente;
45 
46  TTipoValvula *FValvula;
47  TDeposito *FDeposito1;
48  TDeposito *FDeposito2;
49 
50  int FNumeroDeposito1;
51  int FNumeroDeposito2;
52 
53  double FPresionDep1;
54  double FPresionDep2;
55  double FPresionDep1SUM;
56  double FAsonidoDep1SUM;
57  double FGammaDep1SUM;
58  double FRDep1SUM;
59  double FTiempoDep1SUM;
60  double FPresionDep2SUM;
61  double FAsonidoDep2SUM;
62  double FGammaDep2SUM;
63  double FRDep2SUM;
64  double FTiempoDep2SUM;
65 
66  double FCDEntrada;
67  double FCDSalida;
68  double FCTorbellino;
69 
70  double FGasto; // Se calcula en valor absluto. EL tratamiento de su signo se realiza con las variables
71  // auxialares FSentidoFlujoED.
72  double FVelocity;
73  double FGastoImpreso;
74  double Fa0; // Velocity del sonido en el deposito del que sale el flujo.
75  double Fa1; // Velocity del sonido en el deposito al que llega el flujo.
76 
77  int FSentidoFlujoED1;
78  int FSentidoFlujoED2;
79 
80  stResInstantUED FResInstantUED;
81  stResMediosUED FResMediosUED;
82 
83 //double FTiempoActual;
84 
85  double FRegimen;
86 
87  double FGamma1;
88  double FGamma2;
89 
90 // FUNCIONES
91 
92  double InterpolaDeposito(double vizq, double vder, double axid, double xif);
93 
94  public:
95 
96  int getNumeroDeposito1() {
97  return FNumeroDeposito1;
98  }
99  ;
100  int getNumeroDeposito2() {
101  return FNumeroDeposito2;
102  }
103  ;
104  int getSentidoFlujoED1() {
105  return FSentidoFlujoED1;
106  }
107  ;
108  int getSentidoFlujoED2() {
109  return FSentidoFlujoED2;
110  }
111  ;
112  double getMassflow() {
113  return FGasto;
114  }
115  ;
116  double getVelocity() {
117  return FVelocity;
118  }
119  ;
120  double getGastoImpreso() {
121  return FGastoImpreso;
122  }
123  ;
124  double getSpeedSound() {
125  return Fa0;
126  }
127  ;
128  TTipoValvula* getValvula() {
129  return FValvula;
130  }
131  ;
132  double FTiempoActual;
133  double getInstanteCalculo() {
134  return FTiempoActual;
135  }
136  void PutInstanteCalculo(double valor) {
137  FTiempoActual = valor;
138  }
139  ;
140 
141  TCCUnionEntreDepositos(nmTypeBC TipoCC, int numCC, nmTipoCalculoEspecies SpeciesModel, int numeroespecies,
142  nmCalculoGamma GammaCalculation, bool ThereIsEGR);
143 
145 
146  void AsignaTipoValvula(TTipoValvula **Origen, int Valv, int i);
147 
148  void CalculaCondicionContorno(double Time);
149 
150  void LeeUEDepositos(const char *FileWAM, fpos_t &filepos, bool Independent);
151 
152  void AsignaDepositos(TDeposito **Plenum);
153 
154  void CalculaCoeficientesDescarga(double Angulo, double mfcomb = 0., double RegimenMotor = 0.);
155 
156  void LeeResultadosInstantUED(const char *FileWAM, fpos_t &filepos);
157 
158  void CabeceraResultadosInstantUED(stringstream& insoutput);
159 
160  void ImprimeResultadosInstantUED(stringstream& insoutput);
161 
162  void ResultadosInstantUED();
163 
164  void ReadAverageResultsUED(const char *FileWAM, fpos_t &filepos);
165 
166  void HeaderAverageResultsUED(stringstream& medoutput);
167 
168  void ImprimeResultadosMediosUED(stringstream& medoutput);
169 
170  void ResultadosMediosUED();
171 
172  void AcumulaResultadosMediosUED(double Actual);
173 
174  void CalculaUED();
175 
176 };
177 
178 #endif
TTipoValvula
Definition: TTipoValvula.h:53
TCCUnionEntreDepositos
Definition: TCCUnionEntreDepositos.h:41
stResMediosUED
Definition: Globales.h:635
TCondicionContorno
Definition: TCondicionContorno.h:54
TDeposito
Definition: TDeposito.h:44
stResInstantUED
Definition: Globales.h:627