OpenWAM
TEGRV.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 // OBJETO PARA EL CALCULO DE LA VALVULA DE EGR DEL MOTOR DW10 DE PSA PARA
30 // EL PROYECTO DEL ESTUDIO DEL EGR. CALCULA LOS COEFS DE DESCARGA Y TURBULENCIA
31 // A PARTIR DE LA POSICION DE LA VALVULA Y UNA CORRELACION
32 //
33 // 22 - MARZO - 2005
34 //---------------------------------------------------------------------------
35 #ifndef TEGRVH
36 #define TEGRVH
37 
38 #include <string.h>
39 #include <cstdio>
40 #include <iostream>
41 #ifdef __BORLANDC__
42 #include <vcl.h>
43 #endif
44 #include "Globales.h"
45 
46 class TEGRV {
47  private:
48 
49  FILE *FichEGRV;
50 //double FCDEntrante;
51  double FCDSaliente;
52  double FCTorbellino;
53 
54  double FMasaAireAdmitidaConsigna;
55 
56  int FNumeroDatos_TipoControl_Regimen;
57  int FNumeroDatos_Mf;
58  int FNumeroDatos_Regimen;
59 
60  double FError; // Error en la masa de aire en el instante current
61  double FError_ant; // Error en la masa de aire en el instante anterior
62  double FErrorI; // Integral del error para el control con el PID
63  double FP;
64  double FI;
65  double FD;
66  double FKc;
67  double FKi;
68  double FKd;
69 
70  double *FVector_Mf_mapa;
71  double *FVector_TipoControl_Regimen_mapa;
72  double *FVector_Regimen_mapa;
73 
74  double *FMapa_TipoControl;
75  double **FMapa_MasaAire;
76 
77  nmTipoControl FTipoControl;
78 
79  int FCicloCerrado;
80 
81 //Funcion de interpolacion
82  double xit_(double vizq, double vder, double axid, double xif);
83 
84  public:
85 
86  double FCDEntrante;
87  double getCDEntrante() {
88  return FCDEntrante;
89  }
90  void PutCDEntrante(double valor) {
91  FCDEntrante = valor;
92  }
93  ;
94 
95  double getCDSaliente() {
96  return FCDSaliente;
97  }
98  ;
99 
100  double getCTorbellino() {
101  return FCTorbellino;
102  }
103  ;
104 
105  TEGRV();
106 
107  ~TEGRV();
108 
109  void CalculaEGRV(double MasaFuel, double Regimen, double MasaAireAdmitida, double TiempoActual);
110 
111  void LeeDatosEntrada(char *Dir, FILE *fich);
112 
113  void IniciaEGRV(double cdEGR, int CicloCerrado);
114 
115  nmTipoControl DeterminacionTipoControl(double Regimen, double MasaFuel);
116 
117 };
118 //---------------------------------------------------------------------------
119 #endif
TEGRV
Definition: TEGRV.h:46