|
| | Gas () |
| | default constructor, creates air as idgas
|
| | Gas (const string &aLabel, const GasModel aGasModel=GasModel::IDGAS) |
| | creates a pure gas
|
| | Gas (const HelmholtzModel aHelmholtzModel) |
| | create a cryogenic gas
|
| | Gas (const Cell< string > &aSpecies, const Vector< real > &aMolarFractions, const GasModel aGasModel=GasModel::IDGAS) |
| | advanced constructor
|
| virtual | ~Gas () |
| | Gas (const Gas &)=delete |
| Gas & | operator= (const Gas &)=delete |
| const uint & | number_of_components () const |
| virtual void | remix (const Vector< real > &aMolarFractions, bool aRemixHeat=true, bool aRemixTransport=true) |
| virtual void | remix_mass (const Vector< real > &aMassFractions, bool aRemixHeat=true, bool aRemixTransport=true) |
| virtual void | reset_mixture () |
| gasmodels::Statevals & | statevals () |
| | expose statevals object
|
| gastables::GasData * | data (const index_t aIndex) |
| | expose the data object of a refgas
|
| const gastables::GasData * | data (const index_t aIndex) const |
| | expose the data object of a refgas ( const version )
|
| gasmodels::EoS * | eos () |
| | expose state equation of a refgas
|
| bool | is_idgas () const |
| const Vector< real > & | molar_fractions () const |
| | expose the molar fractions
|
| const Vector< real > & | mass_fractions () const |
| | expose the mass fractions
|
| const real & | molar_fraction (const uint aIndex) const |
| | return one single milar fraction
|
| const real & | mass_fraction (const uint aIndex) const |
| | return one single mass fraction
|
| Cell< gastables::RefGas * > & | elements () |
| | expose the element container
|
| Cell< gastables::RefGas * > & | components () |
| | expose the component container
|
| gastables::RefGas *& | component (const index_t aIndex) |
| | expose one component
|
| const Matrix< real > & | formation_table () const |
| | expose the formation table, telling which component is built from which element
|
| bool | is_liquid () const |
| | test if the last evaluated state is liquid.
|
| void | set_liquid_flag (const bool aFlag) |
| | set the liquid flag.
|
| real | p (const real T, const real v) const |
| real | v (const real T, const real p) const |
| real | rho (const real T, const real p) const |
| real | T (const real p, const real v) const |
| virtual real | cp (const real T, const real p) const |
| virtual real | cv (const real T, const real p) const |
| virtual real | gamma (const real T, const real p) const |
| virtual real | c (const real T, const real p) const |
| virtual real | u (const real T, const real p) const |
| virtual real | h (const real T, const real p) const |
| virtual real | s (const real T, const real p) const |
| virtual real | dsdT (const real T, const real p) const |
| virtual real | dsdp (const real T, const real p) const |
| virtual real | dcpdT (const real T, const real p) const |
| virtual real | hd (const real T, const real p) const |
| real | mu (const real T, const real p) const |
| | dynamic viscosity in Pa*s
|
| real | lambda (const real T, const real p) const |
| | thermal conductivity in W/(m*K)
|
| real | Pr (const real T, const real p) const |
| | Prandtl Number.
|
| real | alpha (const real T, const real p) const |
| | thermal expansion coefficient
|
| real | beta (const real T, const real p) const |
| | isochoric stress coefficient
|
| real | kappa (const real T, const real p) const |
| | isothermal compressibility coefficient
|
| void | Gibbs (const real T, Vector< real > &aGibbs) const |
| | return the molar Gibbs potential at reference pressure
|
| void | Hf (const real T, Vector< real > &aHf) const |
| | return the molar formation enthalpy for each component
|
| void | dGibbsdT (const real T, Vector< real > &aGibbs) const |
| | return the temperature derivative of gibs potentia at reference pressure
|
| void | remix_to_equilibrium (const real T, const real p, const bool aRemixHeat=true, const bool aRemixTransport=true) |
| | remix to equilibrium
|
| void | compute_equilibrium (const real T, const real p, Vector< real > &aX) |
| real | T_from_h (const real &h, const real p) const |
| real | isen_T (const real T0, const real p0, const real p1) const |
| | get an isentropic temperature
|
| real | isen_p (const real T0, const real p0, const real T1) const |
| | get an isentropic pressure
|
| void | total (const real T, const real p, const real &u, real &aTt, real &aPt) const |
| | calculate the total state
|
| void | expand (const real &A1, const real T1, const real p1, const real &u1, const real &A2, real &T2, real &p2, real &u2) const |
| | expansion of a gas into a widening duct, A2 >= A1
|
| void | compress (const real &A1, const real T1, const real p1, const real &u1, const real &A2, real &T2, real &p2, real &u2) const |
| | compression of a gas into a narrowing duct, A2 <= A1
|
| real | prandtl_meyer (const real T1, const real p1, const real &u1, const real &alpha, real &T2, real &p2, real &u2) const |
| | Prandtl-Meyer turn of a supersonic stream around a corner, for a thermally perfect ideal gas.
|
| void | shock (const real T1, const real p1, const real &u1, real &T2, real &p2, real &u2) const |
| | perpendicular shock
|
| void | shock (const real T1, const real p1, const real &u1, const real &alpha, real &T2, real &p2, real &u2, real &beta) const |
| | oblique shock
|
| void | print () const |
| Spline & | heat_spline () |
| | expose heat spline
|
| const Spline & | heat_spline () const |
| Spline & | viscosity_spline () |
| | expose viscosity spline
|
| const Spline & | viscosity_spline () const |
| Spline & | conductivity_spline () |
| | expose conductivity spline
|
| const Spline & | conductivity_spline () const |
| const GasModel & | gas_model () const |
| | returns what gas model is used
|
| const HelmholtzModel & | helmholtz_model () const |
| | which Helmholtz model this gas uses, if any
|
| virtual real | dhdp (const real T, const real p) const |
Returned by value.
Both used to hand out a reference into the state cache, which made the result a live view that followed a later remix; a caller wanting that had to know it, and a caller not wanting it had no way to tell. A real is a register return, so the copy costs nothing and the accessor now means what it says.
- Note
- Both currently ignore T and p; the parameters are there for a derived model whose mixture dissociates, where M really does depend on the state.
|
| virtual real | M (const real T, const real p) const |
| virtual real | R (const real T, const real p) const |
Properties of one mixture component, not of the mixture as a whole.
- Warning
- At the reference pressure, the caloric properties h, cp and dcpdT return the ideal gas value, not the component's real gas property.
The indexed departure functions in the cubic equation of state include the reference pressure subtraction, so these functions use the same convention as the mixture level real gas functions. See the note on Gas::realgas_cp in cl_Gas.cpp. The two levels agree and must change together if BELFEM changes this convention.
The finite rate combustion solver uses these functions. It takes its chemistry from the ideal gas Gibbs energy of the thermo tables. Holding component enthalpies at the ideal gas value at the reference pressure keeps the energy equation on the same footing as the equilibrium constants. For combustion at moderate pressure, the ideal gas assumption is a reasonable engineering approximation.
- Parameters
-
| aIndex | component index |
| T | temperature in K |
| p | pressure in Pa |
|
| real | v (const uint aIndex, const real T, const real p) const |
| real | h (const uint aIndex, const real T, const real p) const |
| real | cp (const uint aIndex, const real T, const real p) const |
| real | dcpdT (const uint aIndex, const real T, const real p) const |
|
| uint | mNumberOfComponents |
| | size of components vector
|
| gasmodels::Statevals | mStatevals |
| Vector< real > | mMolarFractions |
| | x or chi
|
| Vector< real > | mMassFractions |
| | y or zeta
|
| Vector< real > | mMolarFractions0 |
| | molar fractions at initialization
|
| Vector< real > | mMolarMasses |
| | molar masses of components
|
| const real & | mM = mStatevals.get( BELFEM_STATEVAL_M ) |
| | Molar Mass in kg/Mol.
|
| const real & | mR = mStatevals.get( BELFEM_STATEVAL_R ) |
| | Gas constant in J/(kg*K).
|
| Cell< gastables::RefGas * > | mComponents |
| | Components of the mixgas.
|
| Cell< gastables::RefGas * > | mElements |
| Cell< string > | mElementNames |
| Cell< gastables::RefGas * > | mExtra |
| SpMatrix | mHelpMatrix |
| | help matrix for remixing
|
| Spline | mHeatSpline |
| Spline | mViscositySpline |
| Spline | mConductivitySpline |
| real | mLastSplineT = BELFEM_REAL_MAX |
| index_t | mLastSplineCol = BELFEM_UINT_MAX |
| GasModel | mGasModel = GasModel::UNDEFINED |
| | gasmodel type
|
| HelmholtzModel | mHelmholzModel = HelmholtzModel::UNDEFINED |
| | helmholz type, if used
|
| Cell< gastables::RefGas * > | mViscosityInteractionRefgas |
| | Interaction polynomials for viscosity.
|
| Matrix< uint > | mViscosityInteractionTable |
| | table telling if interaction parameter exists
|
| Matrix< real > | mWorkMatrix |
| Vector< real > | mWorkVector |
| Vector< real > | mWorkVector2 |
| Vector< real > | mWorkMu |
| Vector< real > | mWorkLambda |
| Vector< real > | mWorkVectorRAND0 |
| Vector< real > | mWorkVectorRAND1 |
| Vector< real > | mWorkVectorRAND2 |
| Matrix< real > | mWorkMatrixRAND |
| Vector< int_t > | mPivotRAND |
| real | mWorkTemperature |
| Matrix< real > | mFormationTable |
| Vector< real > | mFormationWork |
| real | mTcrit = BELFEM_QUIET_NAN |
| real | mPcrit = BELFEM_QUIET_NAN |
| real | mVcrit = BELFEM_QUIET_NAN |
| real | mGamma = 0.0 |
| real | mXi = 0.0 |
| bool | mLiquidFlag = false |
| | liquid flag, written by Helmholtz::v() and read by EoS_Cubic::v()
|
| gasmodels::EoS * | mEoS = nullptr |
| | the equation of state
|
| gasmodels::HelmholtzTransport * | mTransport = nullptr |
| | special class, only needed if this is a helmholtz eos
|
| real(Gas::*) | mFunctionCp (const real T, const real p) const |
| | pointer to cp function
|
| real(Gas::*) | mFunctiondCpdT (const real T, const real p) const |
| | pointer to dcpdT function
|
| real(Gas::*) | mFunctionCv (const real T, const real p) const |
| | pointer to cv function
|
| real(Gas::*) | mFunctionGamma (const real T, const real p) const |
| | pointer to gamma function
|
| real(Gas::*) | mFunctionC (const real T, const real p) const |
| | pointer to c function
|
| real(Gas::*) | mFunctionH (const real T, const real p) const |
| | pointer to h function
|
| real(Gas::*) | mFunctionDHDP (const real T, const real p) const |
| | pointer to dhdp function
|
| real(Gas::*) | mFunctionS (const real T, const real p) const |
| | pointer to s function
|
| real(Gas::*) | mFunctionDSDT (const real T, const real p) const |
| | pointer to dsdT function
|
| real(Gas::*) | mFunctionDSDP (const real T, const real p) const |
| | pointer to dsdp function
|
| real(Gas::*) | mFunctionMU (const real T, const real p) const |
| | pointer to Mu function
|
| real(Gas::*) | mFunctionLAMBDA (const real T, const real p) const |
| | pointer to Lambda function
|
| real | mMixtureEntropy = BELFEM_QUIET_NAN |
| Matrix< real > | mFlowJacobian |
| | scratch for the duct solvers, sized in initialize()
|
| Vector< real > | mFlowResidual |
| Vector< int_t > | mFlowPivot |
| Vector< real > | mGaussPoints |
| | Gauss rule for prandtl_meyer, allocated on first call.
|
| Vector< real > | mGaussWeights |
The gas class that provides the fluid model.
- See also
- Gas Models Usage Guide
- Const correctness
The accessors that evaluate a property of a fixed mixture – cp( T, p ), h( T, p ), mu( T, p ), the flow routines, ... – are const. They do not change the identity of the gas: after the call it holds the same species in the same proportions, and a second call with the same arguments returns the same number. What they do write is the memoization cache and the preallocated scratch, and those members carry mutable for exactly that reason. The methods that change what the gas is – remix(), remix_mass(), the equilibrium solvers, the spline builders – are the ones that stay non-const, so the signature alone separates the two groups.
Only genuine scratch is mutable. A work vector belonging to a composition-changing path (mWorkMu, the RAND equilibrium block, mFormationTable) deliberately is not, so the compiler keeps proving that those paths stay out of the const ones.
- Warning
- const here means logically const, not thread safe. Because the const evaluators write the shared cache, two threads must not call them on the same Gas object even through a const reference. This matches the framework-wide policy: BELFEM parallelises with MPI and is not internally thread safe ( see doc/coding_philosophy.md ).