Lagrangian Particle Code for The Simulation of 2D/3D Fluid Dynamics
 All Classes Files Functions Variables Typedefs Friends Pages
eos.h
Go to the documentation of this file.
1 
19 #ifndef __EOS_H__
20 #define __EOS_H__
21 
22 #include <vector>
23 
24 
42 class EOS {
43 protected:
45 public:
47  virtual ~EOS() {};
48 
50  int getEOSChoice() {return m_iEOSChoice;}
51 
57  virtual void getParameters(std::vector<double>& params) = 0;
58 
65  virtual double getEnergy(double pressure, double density) = 0;
66 
73  virtual double getSoundSpeed(double pressure, double density) = 0;
74 };
75 
76 
77 
78 
79 
80 
81 
82 
83 
84 
101 class PolytropicGasEOS : public EOS {
102 protected:
103  double m_fGamma;
104 
105 public:
110  PolytropicGasEOS(double gamma) : m_fGamma(gamma) {m_iEOSChoice=1;}
111 
112  // Destructor
113  virtual ~PolytropicGasEOS() {}
114 
120  virtual void getParameters(std::vector<double>& params) {params.push_back(m_fGamma);}
121 
128  virtual double getEnergy(double pressure, double density);
129 
136  virtual double getSoundSpeed(double pressure, double density);
137 };
138 
139 
140 
141 
142 
143 
144 
145 
146 
147 
148 
149 
166 class StiffPolytropicGasEOS : public EOS {
167 protected:
168  double m_fGamma;
169  double m_fPinf;
170  double m_fEinf;
171 
172 public:
179  StiffPolytropicGasEOS(double gamma, double pinf, double einf):
180  m_fGamma(gamma), m_fPinf(pinf), m_fEinf(einf) {m_iEOSChoice=2;}
181 
184 
190  virtual void getParameters(std::vector<double>& params) {
191  params.push_back(m_fGamma);
192  params.push_back(m_fPinf);
193  params.push_back(m_fEinf);
194  }
195 
203  virtual double getEnergy(double pressure, double density);
204 
212  virtual double getSoundSpeed(double pressure, double density);
213 };
214 
215 
216 
217 #endif // __EOS_H__
virtual ~StiffPolytropicGasEOS()
Destructor.
Definition: eos.h:183
virtual double getEnergy(double pressure, double density)
Calculates energy based on the Polytropic gas eos and the input pressure and density values...
Definition: eos.cpp:10
virtual ~EOS()
Destructor.
Definition: eos.h:47
PolytropicGasEOS(double gamma)
Constructor.
Definition: eos.h:110
double m_fEinf
The parameter energy infinity.
Definition: eos.h:170
virtual double getEnergy(double pressure, double density)=0
Calculates energy based on this EOS and the input pressure and density values.
virtual void getParameters(std::vector< double > &params)=0
Getter function of all the parameters specified in the construtor argument list.
int getEOSChoice()
Getter function of the protected data member m_iEOSChoice.
Definition: eos.h:50
double m_fPinf
The parameter pressure infinity.
Definition: eos.h:169
double m_fGamma
The parameter gamma.
Definition: eos.h:168
virtual void getParameters(std::vector< double > &params)
Getter function of all the parameters specified in the construtor argument list.
Definition: eos.h:120
virtual double getSoundSpeed(double pressure, double density)
Calculates sound speed based on the Polytropic gas eos and the input pressure and density values...
Definition: eos.cpp:20
An abstract class for the calculation of energy and sound speed based on different EOS models...
Definition: eos.h:42
virtual double getSoundSpeed(double pressure, double density)
Calculates sound speed based on the Stiffened Polytropic gas eos and the input pressure and density v...
Definition: eos.cpp:67
double m_fGamma
The parameter gamma.
Definition: eos.h:103
virtual double getSoundSpeed(double pressure, double density)=0
Calculates sound speed based on this EOS and the input pressure and density values.
virtual double getEnergy(double pressure, double density)
Calculates energy based on the Stiffened Polytropic gas eos and the input pressure and density values...
Definition: eos.cpp:55
StiffPolytropicGasEOS(double gamma, double pinf, double einf)
Constructor.
Definition: eos.h:179
virtual void getParameters(std::vector< double > &params)
Getter function of all the parameters specified in the construtor argument list.
Definition: eos.h:190
Calculates energy and sound speed based on the Stiffened Polytropic gas eos model.
Definition: eos.h:166
int m_iEOSChoice
The eos choice: 1=Polytropic gas; 2=Stiffened Polytropic gas.
Definition: eos.h:44
Calculates energy and sound speed based on the Polytropic gas eos model.
Definition: eos.h:101