OpenWAM
TTipoValvula.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 TTipoValvulaH
30 #define TTipoValvulaH
31 
32 #include <cstdio>
33 #ifdef __BORLANDC__
34 #include <vcl.h>
35 #endif
36 #include <iostream>
37 
38 #include "Globales.h"
39 //#include "interp_1d.h"
40 
41 //---------------------------------------------------------------------------
42 //---------------------------------------------------------------------------
43 
44 enum nmTipoValvula {
45  nmCDFijo = 0, nmValvula4T = 1, nmLamina = 2, nmDiscoRotativo = 3, nmLumbrera2T = 4, nmValvulaContr = 5, nmWasteGate = 6, nmStator = 7, nmRotor = 8, nmCalcExtern = 9, nmMariposa = 10
46 };
47 
48 class TTubo;
49 class TCilindro;
50 class TDeposito;
51 class TBloqueMotor;
52 
53 class TTipoValvula {
54  private:
55 
56  protected:
57 
58  bool FToCylinder;
59 
60  nmTipoValvula FTipoValvula;
61 
62  int FNumeroOrden;
63 
64  double FCDTubVol;
65 //double FCDVolTub;
66  double FCTorb;
67 //double FCRecuperacion;
68 
69  int FTubo;
70  int FNodo;
71  int FTipo;
72  int FValvula;
73  int FSentido;
74 
75  double FDiamTubo;
76  double FDiamRef;
77  double FSectionRatio;
78 
79  bool FGraficasINS;
80  bool FGraficaCDEINS;
81  bool FGraficaCDSINS;
82 
83  bool FGraficasMED;
84  bool FGraficaCDEMED;
85  bool FGraficaCDSMED;
86 
87  double FSumCDE;
88  double FSumCDS;
89  double FCDEMedio;
90  double FCDSMedio;
91  double FSumTime;
92 
93  double FTiempoAnt;
94 
95  nmRegimenValv FControlRegimen;
96  double FRegimen;
97  double FRelacionVelocidades;
98 
99  TCilindro *FCylinder;
100  TTubo *FPipe;
101  TDeposito *FPlenum;
102  TBloqueMotor *FEngine;
103  int FPipeNode;
104 
105  double FTime0;
106 
107  double LeeDiametro();
108 
109 //void PutDiametroTubo(double valor);
110 
111  public:
112 
113  TTipoValvula(nmTipoValvula TipVal);
114 
115  virtual ~TTipoValvula() = 0;
116 
117  nmTipoValvula getTypeOfValve() {
118  return FTipoValvula;
119  }
120  ;
121 
122  double getRegimen() {
123  return FRegimen;
124  }
125  ;
126  double getRelacionVelocidades() {
127  return FRelacionVelocidades;
128  }
129  ;
130  nmRegimenValv getControlRegimen() {
131  return FControlRegimen;
132  }
133  ;
134 
135  double getCDTubVol() {
136  return FCDTubVol;
137  }
138  ;
139  double FCDVolTub;
140  double getCDVolTub() {
141  return FCDVolTub;
142  }
143  void AsignaCDVolTub(double Valor);
144 
145  double getCTorb() {
146  return FCTorb;
147  }
148  ;
149 
150  int getNodo() {
151  return FNodo;
152  }
153  ;
154  int getTipo() {
155  return FTipo;
156  }
157  ;
158  int getSentido() {
159  return FSentido;
160  }
161  ;
162  int getNumOrden() {
163  return FNumeroOrden;
164  }
165  ;
166  int getValvula() {
167  return FValvula;
168  }
169  ;
170  int getPipe() {
171  return FTubo;
172  }
173  ;
174 
175  double getDiametro() {
176  return LeeDiametro();
177  }
178  ;
179  void PutDiametroTubo(double Valor) {
180  FDiamTubo = Valor;
181  }
182 
183  double FCRecuperacion;
184  double getCRecuperacion() {
185  return FCRecuperacion;
186  }
187  void AsignaCRecuperacion(double Valor);
188 
189  virtual void LeeDatosIniciales(const char *FileWAM, fpos_t &filepos, int norden, bool HayMotor,
190  TBloqueMotor *Engine) = 0;
191 
192  void AsignaParametros(int Pipe, int Nodo, int Tipo, int valvula, double dTubo, int sentido);
193 
194  void LeeDatosGraficasINS(const char *FileWAM, fpos_t &filepos);
195 
196  void CabeceraGraficaINS(stringstream& insoutput, int nodo);
197 
198  void ImprimeGraficaINS(stringstream& insoutput);
199 
200  void AcumulaCDMedio(double TiempoActual);
201 
202  void LeeDatosGraficasMED(const char *FileWAM, fpos_t &filepos);
203 
204  void CabeceraGraficaMED(stringstream& medoutput, int nodo);
205 
206  void ImprimeGraficaMED(stringstream& medoutput);
207 
208  void PutPipe(TTubo *Pipe, int node);
209 
210  void PutCylider(TCilindro *Cylinder);
211 
212  void PutPlenum(TDeposito *Plenum);
213 
214  virtual void GetCDin(double Time) {
215  }
216  ;
217 
218  virtual void GetCDout(double Time) {
219  }
220  ;
221 };
222 
223 //---------------------------------------------------------------------------
224 //---------------------------------------------------------------------------
225 
226 #endif
227 
TTubo
a Finite differences pipe.
Definition: TTubo.h:116
TCilindro
Definition: TCilindro.h:59
TTipoValvula
Definition: TTipoValvula.h:53
TDeposito
Definition: TDeposito.h:44
TBloqueMotor
Definition: TBloqueMotor.h:43