OpenWAM
TEjeTurbogrupo.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 TEjeTurbogrupoH
30 #define TEjeTurbogrupoH
31 
32 #include "Globales.h"
33 
34 #include "TController.h"
35 #include "TTC_HTM.h"
36 //#include "TTC_MechLosses.h"
37 
38 #include <cstdio>
39 #include <iostream>
40 
41 // ---------------------------------------------------------------------------
42 // ---------------------------------------------------------------------------
43 
44 class TTurbina;
45 class TCompresor;
46 
48 
49  private:
50 
51  protected:
52 
53  int FNumeroEje; // Numero de Axis (empieza en 1).
54  int FNumCilindros;
55 
56  double FRegimenEje;
57  nmAxisSpeedCalculation FVariacionRegimen;
58  double FAngle0;
59 
60  double FMomentoInercia; // Momento de Inercia del Axis.
61 
62  int FNumCompresoresAcoplados; // Numero de Compresores acoplados al eje.
63  int FNumTurbinasAcopladas; // Numero de Turbinas acoplados al eje.
64  int *FNumeroCompresor; // Vector con los numeros de compresor acoplados al eje.
65  int *FNumeroTurbina; // Vector con los numeros de turbina acopladas al eje.
66  TCompresor **FCompresor; // Vector de objetos Compressor.
67  TTurbina **FTurbina; // Vector de objetos Turbine.
68 
69  double FSumTrabajoCompresores;
70  double FSumTrabajoTurbinas;
71  double FDeltaReg;
72 
73  stResMediosEje FResMediosEje;
74  stResInstantEje FResInstantEje;
75  int FNumCiclo;
76 
77  TController *FController;
78  int FControllerID;
79  bool FRPMControlled;
80 
81  double FTime;
82 
83  double FDShaft;
84  double FHD;
85  double FDoil;
86  double FDwater;
87  double FJournalBLengh;
88  double FTthrustBRmin;
89  double FTthrustBRmax;
90 
91  double FJournalB_K;
92  double FC_p3;
93  double Fk_m;
94  double F_f;
95 
96  double FCWArea;
97  double FTWArea;
98 
99  double FCAC;
100  double FCAT;
101 
102  double FMoil;
103  double FToil;
104  double FPoil;
105 
106  double FTwater;
107  double FMwater;
108 
109  double FTamb;
110 
111  bool FThereIsHTM;
112  TTC_HTM *FHTM;
113 
114  stHTMoil *FOil;
115  stHTMwater *FWater;
116 
117  TurboBearings *FMechLosses;
118  double FMechPower;
119  double FMechEff;
120 
121  public:
122 
123  double getRegimen() {
124  return FRegimenEje;
125  }
126  ;
127 
128  int getNumeroEje() {
129  return FNumeroEje;
130  }
131  ;
132 
133  int GetNumeroCompresor(int i);
134 
135  int getNumeroCompresoresAcoplados() {
136  return FNumCompresoresAcoplados;
137  }
138  ;
139 
140  TEjeTurbogrupo(int i, int ncilin);
141 
142  ~TEjeTurbogrupo();
143 
144  void ReadTurbochargerAxis(const char *FileWAM, fpos_t &filepos, TCompresor **Compressor, TTurbina **Turbine);
145 
146  void CalculaEjesTurbogrupo(double Theta, nmTipoModelado SimulationType, double Time, double CrankAngle);
147 
148  void ReadAverageResultsEje(const char *FileWAM, fpos_t &filepos);
149 
150  void CabeceraResultadosMedEje(stringstream& medoutput);
151 
152  void ImprimeResultadosMedEje(stringstream& medoutput);
153 
154  void IniciaMedias();
155 
156  void ResultadosMediosEje();
157 
158  void AcumulaResultadosMediosEje(double Actual);
159 
160  void ReadInstantaneousResultsEje(const char *FileWAM, fpos_t &filepos);
161 
162  void HeaderInstantaneousResultsEje(stringstream& insoutput);
163 
164  void ImprimeResultadosInstantaneosEje(stringstream& insoutput);
165 
166  void ResultadosInstantEje();
167 
168  void InterpolaValoresMapa();
169 
170  void AsignaRPMController(TController **Controller);
171 
172  void InitizlizeHTM(double Tamb);
173 
174 };
175 
176 #endif
TEjeTurbogrupo
Definition: TEjeTurbogrupo.h:47
TController
Definition: TController.h:37
stHTMwater
Definition: THTM_Fluids.h:249
TTurbina
Definition: TTurbina.h:41
TTC_HTM
Definition: TTC_HTM.h:307
stHTMoil
Definition: THTM_Fluids.h:176
TCompresor
Definition: TCompresor.h:47
TurboBearings
The TurboBearings class represent the bearing system in a turbocharger.
Definition: turbo_bearings.hpp:44
stResMediosEje
Definition: Globales.h:647
stResInstantEje
Definition: Globales.h:658