OpenWAM
TCondicionContorno.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 TCondicionContornoH
30 #define TCondicionContornoH
31 
32 #include "Globales.h"
33 
34 #include <cstdio>
35 #include <iostream>
36 #include "BoundaryFunctions.h"
37 
38 // ---------------------------------------------------------------------------
39 // ---------------------------------------------------------------------------
40 //int _matherr(struct _exception *a) {
41 // // throw Exception(std::to_string(a->name)+"("+std::to_string(a->arg1)+","+std::to_string(a->arg2)+")");
42 // if (a->arg2 != 0) {
43 // MessageBeep(2);
44 // }
45 // std::cout << "Math error in wam" << std::endl;
46 // std::cout << a->type << std::endl;
47 // std::cout << a->name << std::endl;
48 // std::cout << a->arg1 << std::endl;
49 // std::cout << a->arg2 << std::endl;
50 // std::cout << a->retval << std::endl;
51 // return 0;
52 //}
53 
55 
56  private:
57 
58  protected:
59 
60  nmTypeBC FTipoCC;
61 
62  stTuboExtremo *FTuboExtremo;
63 
64  int FNumeroCC; // Numero de la condicion de contorno (empieza en 1)
65  int FNumeroTubosCC; // Numero de tubos en la condicion de contorno.
66 
67  double FTime0;
68  double FTime1;
69  double FDeltaT;
70  double FDeltaAngulo;
71  double FAnguloAnterior;
72  double FAnguloActual;
73 
74 // double FPosicionNodo;
75 
76  // Calculo de Especies
77  int FNumeroEspecies;
78  nmTipoCalculoEspecies FCalculoEspecies;
79  nmCalculoGamma FCalculoGamma;
80  double FGamma;
81  double FRMezcla;
82  double FCvMezcla;
83  double FCpMezcla;
84  double *FFraccionMasicaEspecie;
85 
86  bool FHayEGR;
87  int FIntEGR;
88 
89  bool FUnionDPF;
90 
91 // void PutBeta(int i, double valor);
92 // void PutLanda(int i, double valor);
93 
94 // void PutPosicionNodo(double valor);
95 
96  public:
97 
98  nmTypeBC getTipoCC() {
99  return FTipoCC;
100  }
101  ;
102 
103  int getNumeroCC() {
104  return FNumeroCC;
105  }
106  ;
107 
108  int getNumeroTubosCC() {
109  return FNumeroTubosCC;
110  }
111  ;
112 
113  bool getUnionDPF() {
114  return FUnionDPF;
115  }
116  ;
117 
118  stTuboExtremo GetTuboExtremo(int i);
119 
120  double GetLanda(int i);
121  double GetBeta(int i);
122  double GetEntropia(int i);
123  void PutBeta(int i, double valor);
124  void PutEntropia(int i, double valor);
125  void PutLanda(int i, double valor);
126 
127  void PutPosicionNodo(double valor) {
128  FPosicionNodo = valor;
129  }
130  double FPosicionNodo;
131  double getPosicionNodo() {
132  return FPosicionNodo;
133  }
134 
135  double getGamma() {
136  return FGamma;
137  }
138  ;
139 
140  double getR() {
141  return FRMezcla;
142  }
143  ;
144  double GetFraccionMasicaEspecie(int i);
145 
146  TCondicionContorno(nmTypeBC Tipo, int numCC, nmTipoCalculoEspecies SpeciesModel, int numeroespecies,
147  nmCalculoGamma GammaCalculation, bool ThereIsEGR);
148 
149  virtual ~TCondicionContorno() = 0;
150 
151  virtual void CalculaCaracteristicas(double Time);
152 
153  virtual void CalculaCondicionContorno(double Time) = 0;
154 
155  virtual void TuboCalculandose(int i) {
156  }
157  ;
158 
159  virtual void ReadBoundaryData(const char *FileWAM, fpos_t &filepos, int NumberOfPipes, TTubo **Pipe, int nDPF,
160  TDPF **DPF) {
161  }
162  ;
163 
164  virtual void AsignAmbientConditions(double Tamb, double Pamb, double *AtmosphericComposition) {
165  }
166  ;
167 
168  virtual void AsignaTubos(int NumberOfPipes, TTubo **Pipe) {
169  }
170  ;
171 
172 };
173 
174 #endif
175 
TTubo
a Finite differences pipe.
Definition: TTubo.h:116
stTuboExtremo
Definition: Globales.h:730
TDPF
Definition: TDPF.h:45
TCondicionContorno
Definition: TCondicionContorno.h:54