![]() |
ECOGEN 4.0
Evolutive, Compressible, Open, Genuine, Easy, N-phase
|
Class describing a Noble-Abel stiffened gas equation of state. More...
#include <EosNASG.h>
Inherits Eos.
Public Member Functions | |
EosNASG (std::vector< std::string > &nameParameterEos, int &number) | |
virtual | ~EosNASG () |
virtual void | assignParametersEos (std::string name, std::vector< double > parametersEos) |
assign the values of the attributes for EosNASG from data defined in the code | |
virtual double | computeTemperature (const double &density, const double &pressure) const |
Compute temperature. | |
virtual double | computeEnergy (const double &density, const double &pressure) const |
Compute internal energy. | |
virtual double | computePressure (const double &density, const double &energy) const |
Compute pressure. | |
virtual double | computeDensity (const double &pressure, const double &temperature) const |
Compute density. | |
virtual double | computeSoundSpeed (const double &density, const double &pressure) const |
Compute sound speed. | |
virtual double | computeInterfaceSoundSpeed (const double &density, const double &interfacePressure, const double &pressure) const |
Compute interface sound speed. | |
virtual double | computeAcousticImpedance (const double &density, const double &pressure) const |
Compute acoustic impedance. | |
virtual double | computeDensityTimesInterfaceSoundSpeedSquare (const double &density, const double &interfacePressure, const double &pressure) const |
Compute density times interface sound speed square. | |
virtual double | computeEntropy (const double &temperature, const double &pressure) const |
Compute entropy. | |
virtual double | computePressureIsentropic (const double &initialPressure, const double &initialDensity, const double &finalDensity) const |
Compute phase pressure along an isentropic path. | |
virtual double | computePressureHugoniot (const double &initialPressure, const double &initialDensity, const double &finalDensity) const |
Compute pressure along the Hugoniot curve. | |
virtual double | computeDensityIsentropic (const double &initialPressure, const double &initialDensity, const double &finalPressure, double *drhodp=0) const |
Compute density along an isentropic path AND its derivature versus the pressure at constant entropy. | |
virtual double | computeDensityHugoniot (const double &initialPressure, const double &initialDensity, const double &finalPressure, double *drhodp=0) const |
Compute density along the Hugoniot curve AND its derivature versus the pressure along Hugoniot curve. | |
virtual double | computeDensityPfinal (const double &initialPressure, const double &initialDensity, const double &finalPressure, double *drhodp=0) const |
Compute density during relaxation step AND its derivative versus the pressure. | |
virtual double | computeEnthalpyIsentropic (const double &initialPressure, const double &initialDensity, const double &finalPressure, double *dhdp=0) const |
Compute enthalpy at the end of an isentropic path AND the enthalpy derivature versus the pressure. | |
virtual double | computeDensitySaturation (const double &pressure, const double &Tsat, const double &dTsatdP, double *drhodp=0) const |
Compute density on the saturation curve at the saturation temperature AND its derivative versus the pressure at constant density (OPTIONAL) | |
virtual double | computeDensityEnergySaturation (const double &pressure, const double &rho, const double &drhodp, double *drhoedp=0) const |
Compute the volumic internal energy at the saturation AND its derivative versus the pressure at constant density (OPTIONAL) | |
virtual void | sendSpecialMixtureEos (double &gamPinfOverGamMinusOne, double &eRef, double &oneOverGamMinusOne, double &covolume) const |
Send specific values of the parameters useful for mixture EOS based on Ideal Gas and Stiffened Gas. | |
virtual double | vfpfh (const double &pressure, const double &enthalpy) const |
Compute the specific volume with the pressure and the enthalpy. | |
virtual double | dvdpch (const double &pressure, const double &enthalpy) const |
Compute the partial derivative of the specific volume versus pressure at constant enthalpy. | |
virtual double | dvdhcp (const double &pressure) const |
Compute the partial derivative of the specific volume versus enthalpy at constant pressure. | |
virtual double | drhodpcT (const double &pressure, const double &temperature) const |
Compute the partial derivative of density versus pressure at constant temperature. | |
virtual void | verifyPressure (const double &pressure, const std::string &message="") const |
Add a message error if the pressure is too low and under a limit value equal to \( -(1. - 10^{-15})*p_{\infty} + 10^{-15} \). | |
virtual void | verifyAndModifyPressure (double &pressure) const |
Modify the pressure if its value is under a limit value equal to \( -(1. - 10^{-15})*p_{\infty} + 10^{-15} \). | |
virtual void | verifyAndCorrectDensityMax (const double &mass, double &alpha, double &density) const |
Modify the density if its value is above a limit value equal to \( \frac{1.}{b} - 1. \) and then correct the volume fraction based on mass. | |
virtual void | verifyAndCorrectDensityMax (double &density) const |
Modify the density if its value is above a limit value equal to \( \frac{1.}{b} - 1. \). | |
virtual const double & | getGamma () const |
Get the adiabatic exponent of the fluid. | |
virtual const double & | getPInf () const |
Get the constant pressure. | |
virtual const double & | getCv () const |
Get the volume calorific energy of the fluid. | |
virtual const double & | getERef () const |
Get the energy of reference of the fluid. | |
virtual const double & | getSRef () const |
Get the entropy of reference of the fluid. | |
virtual const double & | getB () const |
Get the covolume of the fluid. | |
virtual TypeEOS | getType () const |
Get the type that is to say the reduced name of the EOS in ECOGEN return \( \ "NASG" \). | |
![]() | |
Eos (int &number) | |
virtual | ~Eos () |
const std::string & | getName () const |
const int & | getNumber () const |
Return the number associated to the EOS. | |
void | readPhysicalParameters (tinyxml2::XMLNode *element) |
Read physical parameters (viscosity, thermal conductivity....) | |
double | computeEnthalpy (const double &density, const double &pressure) const |
Compute the enthalpy of the phase. | |
double | computeTotalEnthalpy (const double &density, const double &pressure, const double &velX, const double &velY=0., const double &velZ=0.) const |
Compute the total enthalpy of the phase. | |
double | computeTotalEnthalpy (const double &density, const double &pressure, const Coord &velocity) const |
Compute the total enthalpy of the phase. | |
const double & | getMu () const |
Return the dynamic viscosity of the fluid return \( \mu \) (Unit: Pa.s). | |
const double & | getLambda () const |
get the thermal conductivity of the fluid return \( \lambda \) (Unit: W/(m.K)). | |
void | assignEpsilonForAlphaNull (bool alphaNull) const |
Assign the epsilonAlphaNull value for alphaNull option (alpha = 0 => epsilonAlphaNull != 0 ; alpha != 0 => epsilonAlphaNull = 0) | |
virtual double | dedrho (const double &, const double &) const |
See derived classes. | |
virtual double | dedrhoSecond (const double &, const double &) const |
See derived classes. | |
Private Attributes | |
double | m_gamma |
Adiabatic exponent of the fluid. | |
double | m_pInf |
Infinit (reference) pressure of the fluid. | |
double | m_b |
Covolume of the fluid. | |
double | m_cv |
Volume calorific energy of the fluid. | |
double | m_eRef |
Energy of reference of the fluid. | |
double | m_sRef |
Entropy of the fluid. | |
Additional Inherited Members | |
![]() | |
int | m_number |
Corresponding number of the equation of state. | |
std::string | m_name |
Name of the equation of state. | |
double | m_mu |
Dynamic viscosity (kg/m/s or Pa.s) | |
double | m_lambda |
Thermal conductivity (W/(m.K)) | |
Class describing a Noble-Abel stiffened gas equation of state.
EosNASG::EosNASG | ( | std::vector< std::string > & | nameParameterEos, |
int & | number | ||
) |
|
virtual |
|
virtual |
assign the values of the attributes for EosNASG from data defined in the code
name | string that contains the reduced name (should be NASG) |
parametersEos | vector (size depending on the Eos, 6 for NASG) |
Are assigned the following attributes: name, \( \gamma, \; p_{infty}, \; b, \; c_v, \; e_{ref}, \; s_{ref}\). If the size of parameterEos \( \neq 6\) then the code aborts.
Implements Eos.
|
virtual |
Compute acoustic impedance.
density | density ( \(\rho\)) |
pressure | pressure (p) |
with : \( z(p, \rho) = \sqrt{ \frac{\rho \ \gamma \ (p+p_{\infty})}{1-\rho b} } \)
Reimplemented from Eos.
|
virtual |
Compute density.
pressure | pressure (p) |
temperature | temperature (T) |
with density : \( \rho(p, T) = \frac{p + p_{\infty} }{c_v T(\gamma-1) + b (p + p_{\infty})} \)
Reimplemented from Eos.
|
virtual |
Compute the volumic internal energy at the saturation AND its derivative versus the pressure at constant density (OPTIONAL)
pressure | pressure (p) |
density | density ( \( \rho \)) |
drhodp | derivative of the density versus pressure ( \(\frac{d \rho}{d p}\) at the saturation state) |
with rhoe : \( \rho\epsilon(p, \rho) = \frac{(p+\gamma p_{\infty})(1-\rho b)}{(\gamma-1)} +\rho\epsilon_{ref} \) AND \( \frac{d \rho\epsilon}{d p} =\left. \frac{\partial \rho\epsilon}{\partial p} \right)_{\rho} + \left. \frac{\partial \rho\epsilon}{\partial\rho } \right)_p \frac{d\rho}{dp} = \frac{1-\rho b}{(\gamma-1)} +\frac{d \rho}{d p}\left(\epsilon_{ref}-b\frac{(p+\gamma p_{\infty})}{\gamma-1}\right) \)
Reimplemented from Eos.
|
virtual |
Compute density along the Hugoniot curve AND its derivature versus the pressure along Hugoniot curve.
initialPressure | initial pressure ( \( p_i \)) |
initialDensity | initial density ( \( \rho_i \)) |
finalPressure | final pressure ( \( p_f \)) |
with finalDensity : \( \rho_f =\rho_i\frac{ (\gamma + 1)*(p_f+p_{\infty}) + (\gamma - 1)*(p_i+p_{\infty})}{(\gamma - 1)(p_f+p_{\infty}) +(\gamma + 1)(p_i+p_{\infty}) + 2 b \rho_0 (p_f-p_i)} \) AND with *drhodp : \( \left. \frac{\partial \rho}{\partial p} \right)_{Hug} = \frac{4\gamma \rho_i \ (p_i+p_{\infty}) \ (1- b\rho_i)}{ \left( (\gamma - 1)(p_f+p_{\infty}) +(\gamma + 1)(p_i+p_{\infty}) +2b\rho_i (p_f-p_i)\right) ^2} \)
Reimplemented from Eos.
|
virtual |
Compute density along an isentropic path AND its derivature versus the pressure at constant entropy.
initialPressure | initial pressure ( \( p_i \)) |
initialDensity | initial density ( \( \rho_i \)) |
finalPressure | final pressure ( \( p_f \)) |
with finalDensity : \( \rho_f = \rho_i \frac{(p_f + p_{\infty})^{1/\gamma}}{(p_i + p_{\infty})^{1/\gamma} (1-\rho_i b) + \rho_i b (p_f + p_{\infty})^{1/\gamma}} \) AND with *drhodp : \( \left. \frac{\partial \rho}{\partial p} \right)_s = \frac{\rho_f (1-\rho_f b)}{\gamma (p_f+p_{\infty})} \)
Reimplemented from Eos.
|
virtual |
Compute density during relaxation step AND its derivative versus the pressure.
initialPressure | initial pressure ( \( p_i \)) |
initialDensity | initial density ( \( \rho_i \)) |
finalPressure | final pressure ( \( p_f \)) |
with finalDensity : \( \rho_f = \rho_i \frac{\gamma (p_f+p_{\infty})}{\gamma (p_f+p_{\infty}) + p_i - p_f + b \rho_i (p_f -p_i)} \) AND with *drhodp : \( \frac{d\rho}{dp} = \rho_i \gamma \frac{\left(p_i + p_{\infty}-b \rho_i (p_i + p_{\infty})\right)}{\left(\gamma (p_f+p_{\infty}) + p_i - p_f+b \rho_i (p_f - p_i)\right)^2} \)
Reimplemented from Eos.
|
virtual |
Compute density on the saturation curve at the saturation temperature AND its derivative versus the pressure at constant density (OPTIONAL)
pressure | pressure (p) |
Tsat | saturation temperature ( \(T_{sat}\)) |
dTsatdP | derivative of the saturation temperature versus pressure ( \(\frac{d T_{sat}}{d p}\)) |
with rho : \( \rho(p, T_{sat}) = \frac{p+p_{\infty}}{T_{sat} \ c_v \ (\gamma-1) + b(p+p_{\infty})} \) AND \( \frac{d \rho}{d p} = \left. \frac{\partial \rho}{\partial p} \right)_{T_{sat}} + \left. \frac{\partial \rho}{\partial T_{sat} } \right)_p \frac{d T_{sat}}{d p} =\frac{(\gamma-1)c_v\left(T_{sat} - (p+p_{\infty})\frac{d T_{sat}}{d p}\right) }{\left((\gamma-1)c_vT_{sat} + b(p+p_{\infty}) \right)^2 } \)
Reimplemented from Eos.
|
virtual |
Compute density times interface sound speed square.
density | density ( \(\rho\)) |
interfacePressure | interface pressure (pI) |
pressure | pressure (p) |
with : \( z(p, \rho) = \frac{(\gamma-1) \ p_I + p + \gamma \ p_{\infty}}{1 - \rho \ b} \)
Reimplemented from Eos.
|
virtual |
Compute internal energy.
density | density ( \(\rho\)) |
pressure | pressure (p) |
with internal energy : \( \epsilon (\rho, p) = \frac{(p + \gamma p_{\infty})(1-\rho b)}{\rho (\gamma-1)} \ + \ \epsilon_{ref} \)
Reimplemented from Eos.
|
virtual |
Compute enthalpy at the end of an isentropic path AND the enthalpy derivature versus the pressure.
initialPressure | initial pressure ( \( p_i \) at the beginning of the isentropic path) |
initialDensity | initial density ( \( \rho_i \) at the beginning of the isentropic path) |
finalPressure | final Pressure ( \( p_f \) at the end of the isentropic path) |
with finalEnthalpy : \( h(p_f,{\rho_f})= \frac{\gamma}{(\gamma-1)}\frac{p_f+p_{\infty}}{\rho_f} (1-\rho_f b) + b p + e_{ref} \). The density \( \rho_f \) is first computed along an isentropic path (see computeDensityIsentropic EosNASG method ). AND with *dhdp : \( \frac{dh}{dp}=\frac{\gamma}{(\gamma-1)}\left[\frac{ \rho_f - (p_f+p_{\infty}) \frac{d\rho}{dp} }{\rho_f^2}-b\right] +b \). The term \(\frac{d\rho}{dp}\) is the derivative obtained along an isentropic path.
Reimplemented from Eos.
|
virtual |
Compute entropy.
temperature | temperature (T) |
pressure | pressure (p) |
with s : \( s(T, p) = c_v \ln \left( \frac{T^\gamma} { (p+p_{\infty})^{\gamma-1} } \right)+s_{ref} \)
Reimplemented from Eos.
|
virtual |
Compute interface sound speed.
density | density ( \(\rho\)) |
interfacePressure | interface pressure (pI) |
pressure | pressure (p) |
with soundSpeed : \( c(p, \rho) = \sqrt{ \frac{(\gamma-1) \ p_I + p + \gamma \ p_{\infty}}{(1 - \rho \ b) \ \rho}} \)
Reimplemented from Eos.
|
virtual |
Compute pressure.
density | density ( \(\rho\)) |
energy | internal energy ( \(\epsilon\)) |
with pressure : \( p(\rho, \epsilon) = (\gamma-1)\rho \frac{(\epsilon - \epsilon_{ref})}{(1-\rho b)} - \gamma p_{\infty} \)
Reimplemented from Eos.
|
virtual |
Compute pressure along the Hugoniot curve.
initialPressure | initial pressure ( \( p_i \)) |
initialDensity | initial density ( \( \rho_i \)) |
finalDensity | final density ( \( \rho_f \)) |
with finalPressure : \( p_f = \frac{\rho_i\left(2\gamma p_{\infty}+p_i (\gamma-1)\right)-\rho_f \left(2\gamma p_{\infty}+p_i (\gamma +1)\right)+2b\rho_i p_i}{\rho_f (\gamma-1)-\rho_i (\gamma+1)+2b\rho_0} \)
Reimplemented from Eos.
|
virtual |
Compute phase pressure along an isentropic path.
initialPressure | initial pressure ( \( p_i \)) |
initialDensity | initial density ( \( \rho_i \)) |
finalDensity | final density ( \( \rho_f \)) |
with finalPressure : \( p_f = (p_i+p_{\infty}) \left( \frac{\rho_f}{\rho_i} \right)^\gamma \left(\frac{1-\rho_i b}{1-\rho_f b}\right)^\gamma -p_{\infty} \)
Reimplemented from Eos.
|
virtual |
Compute sound speed.
density | density ( \(\rho\)) |
pressure | pressure (p) |
with soundSpeed : \( c(p, \rho) = \sqrt{ \frac{\gamma \ (p+p_{\infty})}{\rho (1-\rho b)}} \)
Reimplemented from Eos.
|
virtual |
Compute temperature.
density | density ( \(\rho \)) |
pressure | pressure (p) |
with temperature : \( T(\rho, p) = \frac{(p+p_{\infty})(1-\rho b)}{c_v (\gamma-1)\rho} \)
Reimplemented from Eos.
|
virtual |
Compute the partial derivative of density versus pressure at constant temperature.
pressure | pressure (p) |
temperature | temperature (T) |
Reimplemented from Eos.
|
virtual |
Compute the partial derivative of the specific volume versus enthalpy at constant pressure.
pressure | pressure (p) |
Reimplemented from Eos.
|
virtual |
Compute the partial derivative of the specific volume versus pressure at constant enthalpy.
pressure | pressure (p) |
enthalpy | enthalpy (h) |
Reimplemented from Eos.
|
inlinevirtual |
Get the covolume of the fluid.
|
inlinevirtual |
|
inlinevirtual |
Get the energy of reference of the fluid.
Reimplemented from Eos.
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Get the type that is to say the reduced name of the EOS in ECOGEN return \( \ "NASG" \).
Reimplemented from Eos.
|
virtual |
Send specific values of the parameters useful for mixture EOS based on Ideal Gas and Stiffened Gas.
gamPinfOverGamMinusOne | \( \frac{\gamma p_{\infty}}{(\gamma-1)} \) |
eRef | \( \epsilon_{ref} \) |
oneOverGamMinusOne | \( \frac{1}{(\gamma-1)}\) |
Reimplemented from Eos.
|
virtual |
Modify the density if its value is above a limit value equal to \( \frac{1.}{b} - 1. \) and then correct the volume fraction based on mass.
mass | mass (continuity) |
alpha | volume fraction ( \( \alpha \)) |
density | density ( \( \rho \)) |
Reimplemented from Eos.
|
virtual |
Modify the density if its value is above a limit value equal to \( \frac{1.}{b} - 1. \).
density | density ( \( \rho \)) |
Reimplemented from Eos.
|
virtual |
Modify the pressure if its value is under a limit value equal to \( -(1. - 10^{-15})*p_{\infty} + 10^{-15} \).
pressure | pressure (p) |
Reimplemented from Eos.
|
virtual |
Add a message error if the pressure is too low and under a limit value equal to \( -(1. - 10^{-15})*p_{\infty} + 10^{-15} \).
pressure | pressure (p) |
message | "" |
Reimplemented from Eos.
|
virtual |
Compute the specific volume with the pressure and the enthalpy.
pressure | pressure (p) |
enthalpy | enthalpy (h) |
Reimplemented from Eos.
|
private |
Covolume of the fluid.
|
private |
Volume calorific energy of the fluid.
|
private |
Energy of reference of the fluid.
|
private |
Adiabatic exponent of the fluid.
|
private |
Infinit (reference) pressure of the fluid.
|
private |
Entropy of the fluid.