SU2
fluid_model.hpp
Go to the documentation of this file.
1 
34 #pragma once
35 
36 #include "../../Common/include/mpi_structure.hpp"
37 
38 #include <stdio.h>
39 #include <string.h>
40 #include <iostream>
41 #include <string>
42 #include <cmath>
43 
44 #define LEN_COMPONENTS 32
45 
46 #include "stdio.h"
47 #include "math.h"
48 
49 using namespace std;
50 
51 #include "../include/transport_model.hpp"
52 #include "../../Common/include/config_structure.hpp"
53 
54 
62 class CFluidModel {
63 protected:
64 su2double StaticEnergy,
65  Entropy,
66  Density,
67  Pressure,
68  SoundSpeed2,
69  Temperature,
70  dPdrho_e,
71  dPde_rho,
72  dTdrho_e,
73  dTde_rho,
74  Cp,
75  Mu,
76  dmudrho_T,
77  dmudT_rho,
78  Kt,
79  dktdrho_T,
80  dktdT_rho;
85 public:
86 
90  CFluidModel(void);
91 
95  virtual ~CFluidModel(void);
96 
100  su2double GetPressure ();
101 
105  su2double GetTemperature ();
106 
110  su2double GetEntropy ();
111 
115  su2double GetStaticEnergy ();
116 
120  su2double GetDensity ();
121 
125  su2double GetSoundSpeed ();
126 
130  su2double GetSoundSpeed2 ();
131 
135  su2double GetCp ();
136 
141  su2double GetLaminarViscosity ();
142 
147  su2double GetThermalConductivity ();
148 
152  su2double GetdPdrho_e ();
153 
157  su2double GetdPde_rho ();
158 
162  su2double GetdTdrho_e ();
163 
167  su2double GetdTde_rho ();
168 
172  su2double Getdmudrho_T ();
173 
177  su2double GetdmudT_rho ();
178 
182  su2double Getdktdrho_T ();
183 
187  su2double GetdktdT_rho ();
188 
192  void SetLaminarViscosityModel (CConfig *config);
193 
197  void SetThermalConductivityModel (CConfig *config);
198 
206  virtual void SetTDState_rhoe (su2double rho, su2double e );
207 
215  virtual void SetTDState_PT (su2double P, su2double T );
216 
224  virtual void SetTDState_Prho (su2double P, su2double rho );
225 
234  virtual void SetEnergy_Prho (su2double P, su2double rho );
235 
243  virtual void SetTDState_hs (su2double h, su2double s );
244 
245 
253  virtual void SetTDState_rhoT (su2double rho, su2double T );
254 
255 
263  virtual void SetTDState_Ps (su2double P, su2double s );
264 
265 };
266 
267 
274 class CIdealGas : public CFluidModel {
275 
276 protected:
277  su2double Gamma,
278  Gamma_Minus_One,
279  Gas_Constant;
282 public:
283 
287  CIdealGas(void);
288 
292  CIdealGas(su2double gamma, su2double R);
293 
294 
298  virtual ~CIdealGas(void);
299 
306  void SetTDState_rhoe (su2double rho, su2double e );
307 
314  void SetTDState_PT (su2double P, su2double T );
315 
322  void SetTDState_Prho (su2double P, su2double rho );
323 
330  void SetEnergy_Prho (su2double P, su2double rho );
331 
338  void SetTDState_hs (su2double h, su2double s );
339 
340 
347  void SetTDState_rhoT (su2double rho, su2double T );
348 
355  void SetTDState_Ps (su2double P, su2double s );
356 };
357 
358 
365 class CVanDerWaalsGas : public CIdealGas {
366 
367 protected:
368  su2double
369  a, b, Zed;
371 public:
372 
376  CVanDerWaalsGas(void);
377 
381  CVanDerWaalsGas(su2double gamma, su2double R, su2double Pstar, su2double Tstar);
382 
383 
387  virtual ~CVanDerWaalsGas(void);
388 
394  void SetTDState_rhoe (su2double rho, su2double e );
395 
401  void SetTDState_PT (su2double P, su2double T );
402 
408  void SetTDState_Prho (su2double P, su2double rho );
409 
415  void SetEnergy_Prho (su2double P, su2double rho );
416 
423  void SetTDState_hs (su2double h, su2double s );
424 
425 
432  void SetTDState_rhoT (su2double rho, su2double T );
433 
440  void SetTDState_Ps (su2double P, su2double s );
441 
442 };
443 
444 
451 class CPengRobinson : public CIdealGas {
452 
453 protected:
454  su2double a,
455  b,
456  k,
457  Zed,
458  TstarCrit;
460 private:
461 
465  su2double alpha2 (su2double T);
466 
467 
471  su2double T_v_h (su2double v, su2double h);
475  su2double T_P_rho(su2double P, su2double rho);
476 
477 
478 
479 public:
480 
484  CPengRobinson(void);
485 
489  CPengRobinson(su2double gamma, su2double R, su2double Pstar, su2double Tstar, su2double w);
490 
494  virtual ~CPengRobinson(void);
495 
501  void SetTDState_rhoe (su2double rho, su2double e );
502 
508  void SetTDState_PT (su2double P, su2double T );
509 
515  void SetTDState_Prho (su2double P, su2double rho );
516 
522  void SetEnergy_Prho (su2double P, su2double rho );
530  void SetTDState_hs (su2double h, su2double s );
531 
539  void SetTDState_rhoT (su2double rho, su2double T );
540 
547  void SetTDState_Ps (su2double P, su2double s );
548 
549 };
550 
551 
552 
553 #include "fluid_model.inl"
554 
Main class for defining the Thermo-Physical Model a child class for each particular Model (Ideal-Gas...
Definition: fluid_model.hpp:62
su2double Zed
Parameters for the Dimensionless Equation.
Definition: fluid_model.hpp:369
In-Line subroutines of the solver_structure.hpp file.
CViscosityModel * LaminarViscosity
Laminar Viscosity Model.
Definition: fluid_model.hpp:82
Child class for defining the Van der Waals model.
Definition: fluid_model.hpp:365
su2double Zed
compressibility factor.
Definition: fluid_model.hpp:454
Definition: transport_model.hpp:187
Child class for defining the Peng-Robinson model.
Definition: fluid_model.hpp:451
su2double Gas_Constant
Gas Constant.
Definition: fluid_model.hpp:277
Main class for defining the Transport-Physical Model a child class for each particular Model (Power l...
Definition: transport_model.hpp:62
CConductivityModel * ThermalConductivity
Thermal Conductivity Model.
Definition: fluid_model.hpp:83
su2double Temperature
Temperature.
Definition: fluid_model.hpp:64
Main class for defining the problem; basically this class reads the configuration file...
Definition: config_structure.hpp:68
Child class for defining ideal gas model.
Definition: fluid_model.hpp:274