OpenWAM
TCompresor.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 TCompresorH
30 #define TCompresorH
31 
32 #include "Globales.h"
33 #include "Constantes.h"
34 #include "TMapaComp.h"
35 #include "TSAEMap.h"
36 #include "TMapaComp2Tub.h"
37 #include "TTC_HTM.h"
38 #include "TAcousticCompressor.h"
39 
40 //---------------------------------------------------------------------------
41 //---------------------------------------------------------------------------
42 
43 class TTubo;
44 
45 class TDeposito;
46 
47 class TCompresor {
48  private:
49 
50 //---------------------------------------------------------------------------
51 // FUNCIONES PRIVADAS
52 //---------------------------------------------------------------------------
53 
54  double GetTrabajoCiclo() {
55  return FMedias.Trabajo;
56  }
57 
58  double GetRendimientoMedio() {
59  return FMedias.Rendimiento;
60  }
61 
62  double GetRelCompMedia() {
63  return FMedias.RelacionCompresion;
64  }
65 
66  double GetGastoMedio() {
67  return FMedias.Massflow;
68  }
69 
70  double GetRendimientoInstant() {
71  return FInstant.Rendimiento;
72  }
73 
74  double GetPotenciaInstant() {
75  return FInstant.Potencia;
76  }
77 
78  double GetRelCompInstant() {
79  return FInstant.RelacionCompresion;
80  }
81 
82  double GetGastoInstant() {
83  return FInstant.Massflow;
84  }
85 
86  nmCompressorModel GetModeloCompresor() {
87  return FModeloCompresor;
88  }
89 
90  int GetDepRotor() {
91  return FDepRotor;
92  }
93 
94  int GetDepStator() {
95  return FDepStator;
96  }
97 
98  double GetRelCompBombeo() {
99  return Mapa->getRelCompBombeo();
100  }
101 
102  double GetRegimen() {
103  return FRegimen;
104  }
105 
106  int GetEje() {
107  return FEje;
108  }
109 
110  double GetASonidoComp();
111 
112  protected:
113 
114 //---------------------------------------------------------------------------
115 // VARIABLES PROTEGIDAS
116 //---------------------------------------------------------------------------
117 
118  int FNumeroCompresor;
119  int FEje;
120  int FDepRotor; // Numero del deposito conectado al rotor
121  int FDepStator; // Numero del deposito conectado al estator (si tiene)
122 //TMapaComp *Mapa; // Puntero al mapa del compresor
123  TCompressorMap *Mapa;
124  TMapaComp2Tub *Mapa2T;
125  double FRendimiento; // Rendimiento (-)
126  double FTrabajo; // Trabajo del compresor (W)
127  double FRelacionCompresion; // Relacion de compresion (-)
128  double FGastoCompresor; // Massflow que pasa por el compresor (kg/h)
129  double FGastoCorregido;
130  double FRegimen;
131  double FRegimenCorregido;
132  double FPresion10;
133  double FPresion20;
134  double FTemperatura10;
135  double FTemperatura20;
136 
137  double FASonidoSalida;
138 
139  double FDeltaTiempo;
140  double FTiempo0;
141 
142  bool FBombeo;
143 
144  TTC_HTM *FHTM;
145 
146  bool FIsAcoustic;
147  TAcousticCompressor *FAcComp;
148 
149  nmCompressorModel FModeloCompresor;
150 
151  stMediasCompresor FMedias; // Estructura para los valores medios
152  stInstantaneosCompresor FInstant; // Estructura para los valores instantaneos
153 
154  double FPotenciaPaso;
155  double FTrabajoPaso;
156  double FDeltaTPaso;
157  double FPotencia;
158 
159 // Calculo de Especies
160  double FGamma;
161  double FRMezcla;
162  double FCpMezcla;
163  double *FFraccionMasicaEspecie;
164  double GetFraccionMasiscaEspecie(int i);
165  int FNumeroEspecies;
166  bool FHayEGR;
167  int FIntEGR;
168  nmTipoCalculoEspecies FCalculoEspecies;
169  nmCalculoGamma FCalculoGamma;
170  double FFraccionMasicaEspecieFuel; // Para calculo completo de especies
171 
172  public:
173 
174 //---------------------------------------------------------------------------
175 // VARIABLES PUBLICAS
176 //---------------------------------------------------------------------------
177 
178  double getEfficiency() {
179  return FRendimiento;
180  }
181  ;
182 
183  double getMassflow() {
184  return FGastoCompresor;
185  }
186  ;
187 
188  double getTrabajo() {
189  return FTrabajo;
190  }
191  ;
192 
193  double getRendMed() {
194  return GetRendimientoMedio();
195  }
196  ;
197 
198  double getTrabCiclo() {
199  return GetTrabajoCiclo();
200  }
201  ;
202 
203  double getRCMed() {
204  return GetRelCompMedia();
205  }
206  ;
207 
208  double getGastoMed() {
209  return GetGastoMedio();
210  }
211  ;
212 
213  double getRendINS() {
214  return GetRendimientoInstant();
215  }
216  ;
217 
218  double getPotenciaINS() {
219  return GetPotenciaInstant();
220  }
221  ;
222 
223  double getGastoINS() {
224  return GetGastoInstant();
225  }
226  ;
227 
228  double getRCINS() {
229  return GetRelCompInstant();
230  }
231  ;
232 
233  nmCompressorModel getModeloCompresor() {
234  return GetModeloCompresor();
235  }
236  ;
237 
238  int getDepRotor() {
239  return GetDepRotor();
240  }
241  ;
242 
243  int getDepStator() {
244  return GetDepStator();
245  }
246  ;
247 
248  double getRCInicial() {
249  return GetRelCompBombeo();
250  }
251  ;
252 
253  double getRegimen() {
254  return GetRegimen();
255  }
256  ;
257 
258  int getAxis() {
259  return GetEje();
260  }
261  ;
262 
263  double getTiempo0() {
264  return FTiempo0;
265  }
266  ;
267 
268  double getSpeedSound() {
269  return GetASonidoComp();
270  }
271  ;
272 
273  double getPotenciaPaso() {
274  return FPotenciaPaso;
275  }
276  ;
277 
278  double getGamma() {
279  return FGamma;
280  }
281  ;
282 
283  double GetFraccionMasicaEspecie(int i);
284 
285  TCompressorMap* GetMap() {
286  return Mapa;
287  }
288  ;
289 
290 //---------------------------------------------------------------------------
291 // FUNCIONES PUBLICAS
292 //---------------------------------------------------------------------------
293 
294  TCompresor(int i, nmTipoCalculoEspecies SpeciesModel, int numeroespecies, nmCalculoGamma GammaCalculation,
295  bool ThereIsEGR);
296 
297  virtual ~TCompresor() = 0;
298 
299  virtual void CalculaGasto(double TrabajoInsTurbina, double TiempoActual) = 0;
300 
301  virtual void CondicionCompresor(double Theta, stTuboExtremo *TuboExtremo, double AcumulatedTime, int TuboCalculado) = 0;
302 
303  virtual void Initialize() = 0;
304 
305  void InterpolaValoresMapa(double rtc);
306 
307  void AcumulaMedias(double Tiempo);
308 
309  void IniciaMedias();
310 
311  void CalculaMedias();
312 
313  void CalculaInstantaneos();
314 
315  void LeeDatosGraficasMedias(const char *FileWAM, fpos_t &filepos);
316 
317  void CabeceraGraficasMedias(stringstream& medoutput);
318 
319  void ImprimeGraficasMedias(stringstream& medoutput);
320 
321  void LeeDatosGraficasInstantaneas(const char *FileWAM, fpos_t &filepos);
322 
323  void CabeceraGraficasInstantaneas(stringstream& insoutput);
324 
325  void ImprimeGraficasInstantaneas(stringstream& insoutput);
326 
327  void CalculoPotenciaPaso();
328 
329  void AsignTCHTM(TTC_HTM *HTM) {
330  FHTM = HTM;
331  }
332  ;
333 
334  void AsignAcousticElements(TTubo **Pipe, TDeposito **Volume);
335 
336  TAcousticCompressor* AcousticC() {
337  return FAcComp;
338  }
339  ;
340 
341 };
342 
343 #endif
TTubo
a Finite differences pipe.
Definition: TTubo.h:116
TMapaComp2Tub
Definition: TMapaComp2Tub.h:41
Constantes.h
stTuboExtremo
Definition: Globales.h:730
stInstantaneosCompresor
Definition: Globales.h:890
TTC_HTM
Definition: TTC_HTM.h:307
TCompresor
Definition: TCompresor.h:47
TDeposito
Definition: TDeposito.h:44
TCompressorMap
Definition: TCompressorMap.h:12
stMediasCompresor
Definition: Globales.h:863
TAcousticCompressor
Definition: TAcousticCompressor.h:66
TAcousticCompressor.h