A single chemical species with its caloric and transport properties. More...
#include <cl_GT_RefGas.hpp>
Public Member Functions | |
| RefGas (const string &aLabel) | |
| ~RefGas () | |
| RefGas (const RefGas &)=delete | |
| RefGas & | operator= (const RefGas &)=delete |
| const string & | label () const |
| real | component_multiplicity (const string &aLabel) const |
| return the composition if the element exists | |
| const real & | M () const |
| molar mass in kg/Mol | |
| real | reference_formation_enthalpy () const |
| reference formation enthalpy | |
| bool | is_liquid () const |
| void | set_mode (const RefGasMode &aMode) |
| Switch between evaluating the CEA polynomials directly and evaluating the splines sampled off them. | |
| GasData * | data () |
| expose data object | |
| const GasData * | data () const |
| expose data object ( const version ) | |
| Spline * | heat_spline () |
| expose heat spline | |
| const Spline * | heat_spline () const |
| expose heat spline ( const version ) | |
| Spline * | viscosity_spline () |
| expose viscosity spline | |
| const Spline * | viscosity_spline () const |
| expose viscosity spline ( const version ) | |
| Spline * | conductivity_spline () |
| expose conductivity spline | |
| const Spline * | conductivity_spline () const |
| expose conductivity spline ( const version ) | |
Caloric properties | |
Upper case is molar, lower case is mass specific: Cp is J/(mol K) and cp is J/(kg K), H is J/mol and h is J/kg. The two differ by the molar mass and nothing else. Temperature is in K. The enthalpy scale is set by the factory, not by the source record: it discards the record's integration constant and shifts every interval so that H( 298.15 K ) = dHf( 298.15 K ) + [ H( 298.15 K ) - H( 0 K ) ] with the formation enthalpy and the sensible term both taken from thermo.inp. Equivalently, H( 0 K ) is the formation enthalpy at 298.15 K. That is a hybrid of the two usual conventions - CEA places the formation enthalpy at 298.15 K, a 0 K scale places it at 0 K - and it is deliberate. No consumer in the tree can see the difference. The combustion solver re-references to the CEA convention itself, subtracting h( 298.15 ) and adding the formation enthalpy back ( cl_CN_Scheme.cpp in the nonfree tree ), and the flow routines only ever evaluate enthalpy differences, where the constant cancels. It would matter only if an absolute enthalpy were compared against an outside table. Entropy is absolute, anchored on the standard state entropy of the record. Which representation answers these calls depends on the mode - the polynomials themselves in POLY, the sampled splines in SPLINE. The factory leaves every gas in SPLINE. | |
| real | Cp (const real T) const |
| real | H (const real T) const |
| real | S (const real T) const |
| real | dSdT (const real T) const |
| real | dCpdT (const real T) const |
| real | d2CpdT2 (const real T) const |
| real | cp (const real T) const |
| real | h (const real T) const |
| real | h_ref () const |
| real | H_ref () const |
| real | s (const real T) const |
| real | dcpdT (const real T) const |
| real | d2cpdT2 (const real T) const |
Transport properties | |
Dynamic viscosity in Pa s and thermal conductivity in W/(m K), both SI - the tabulated CEA coefficients are micropoise and microwatt per centimetre kelvin and are converted on the way out. Temperature is in K. These describe the dilute gas. Pressure dependence is not part of this class; the gasmodels layer adds it. A species with no transport record returns zero rather than raising, except where the factory was able to synthesize viscosity and conductivity from the critical point. | |
| real | mu (const real T) const |
| real | dmudT (const real T) const |
| real | d2mudT2 (const real T) const |
| real | lambda (const real T) const |
| real | dlambdadT (const real T) const |
| real | d2lambdadT2 (const real T) const |
Data availability | |
Which of the source tables actually had a record for this species. Callers use these to decide whether a property is worth asking for - the accessors of a missing set return zero rather than raising, so a silent zero is otherwise indistinguishable from a real one. | |
| bool | has_thermo () const |
| bool | has_conductivity () const |
| bool | has_viscosity () const |
| bool | has_components () const |
| bool | is_noble () const |
Protected Member Functions | |
| void | finalize () |
| to be called by RefGasFactory once all polynomials have been read | |
| void | create_splines (const Vector< real > &T, SpMatrix &aHelpMatrix) |
| void | add_component (const string &aLabel, const real aValue) |
| to be called by InputThermo | |
| void | set_molar_mass (const real aMolarMass) |
| set the molar mass | |
| void | set_reference_formation_enthalpy (const real aDeltaHf) |
| set the formation enthalpy in J/mol | |
| void | set_reference_enthalpy (const real aHref) |
| set the reference enthalpy H(298.15 K) - H(0 K) in J/mol, as read from the thermo.inp record | |
| void | set_liquid_flag () |
| void | set_component_flag () |
| void | unset_liquid_flag () |
| void | add_heat_poly (HeatPoly *aHeatPoly) |
| void | add_transport_poly (TransportPoly *aTransportPoly) |
| void | delete_heat_polys () |
| void | delete_transport_polys () |
| void | create_glue_polys_heat (const uint &aNumberOfOriginalPolynomials) |
| void | create_cryo_poly_heat () |
| void | create_hot_poly_heat (const uint &aNumberOfOriginalPolynomials) |
| void | fix_reference_points (const uint &aStart, const uint &aEnd) |
| const HeatPoly * | find_heat_poly (const real T) const |
| const TransportPoly * | find_viscosity_poly (const real T) const |
| const TransportPoly * | find_conductivity_poly (const real T) const |
| void | finalize_transport () |
| void | create_cryo_poly_transport (Cell< TransportPoly * > &aPolys) |
| void | create_glue_polys_transport (Cell< TransportPoly * > &aPolys, const uint &aNumberOfOriginalPolynomials) |
| void | create_hot_poly_transport (Cell< TransportPoly * > &aPolys, const uint &aNumberOfOriginalPolynomials) |
| void | finalize_thermo () |
| real | zero (const real T) const |
| real | poly_Cp (const real T) const |
| real | poly_dCpdT (const real T) const |
| real | poly_d2CpdT2 (const real T) const |
| real | poly_H (const real T) const |
| real | poly_S (const real T) const |
| real | poly_dSdT (const real T) const |
| real | poly_Mu (const real T) const |
| real | poly_dMudT (const real T) const |
| real | poly_d2MudT2 (const real T) const |
| real | poly_Lambda (const real T) const |
| real | poly_dLambdadT (const real T) const |
| real | poly_d2LambdadT2 (const real T) const |
| real | spline_Cp (const real T) const |
| real | spline_dCpdT (const real T) const |
| real | spline_H (const real T) const |
| real | spline_S (const real T) const |
| real | spline_dSdT (const real T) const |
| real | spline_Mu (const real T) const |
| real | spline_dMudT (const real T) const |
| real | spline_d2MudT2 (const real T) const |
| real | spline_Lambda (const real T) const |
| real | spline_dLambdadT (const real T) const |
| real | spline_d2LambdadT2 (const real T) const |
| void | fix_switches () |
A single chemical species with its caloric and transport properties.
The caloric side is the NASA-9 formulation of CEA ( NASA RP-1311 ): a set of temperature intervals, each carrying a seven coefficient polynomial for cp/R plus two integration constants for H and S. Transport uses the CEA correlation ln( eta ) = A ln T + B/T + C/T^2 + D over its own intervals. Both are read from the shipped tables by RefGasFactory, which also synthesizes the intervals the tables do not cover: glue polynomials across interval junctions, a cryogenic extrapolation below the lowest interval, and viscosity and thermal conductivity from the Lucas and Chung correlations for species with critical data but no transport record.
Everything is molar unless the accessor is lower case: H() is J/mol and h() is J/kg, the same convention as Cp()/cp(). Temperatures are in K throughout.
The object owns its polynomials and deletes them; mData is held by value. Construction is through RefGasFactory, not directly, because a usable object needs the data files.
| belfem::gastables::RefGas::RefGas | ( | const string & | aLabel | ) |
| belfem::gastables::RefGas::~RefGas | ( | ) |
|
delete |
|
protected |
to be called by InputThermo
|
protected |
|
protected |
return the composition if the element exists
|
inline |
expose conductivity spline
|
inline |
expose conductivity spline ( const version )
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
inline |
expose data object
|
inline |
expose data object ( const version )
|
protected |
|
protected |
|
protected |
to be called by RefGasFactory once all polynomials have been read
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| real belfem::gastables::RefGas::H_ref | ( | ) | const |
| real belfem::gastables::RefGas::h_ref | ( | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
expose heat spline
|
inline |
expose heat spline ( const version )
|
inline |
|
inline |
|
inline |
|
inline |
molar mass in kg/Mol
|
inline |
reference formation enthalpy
|
protected |
|
protected |
| void belfem::gastables::RefGas::set_mode | ( | const RefGasMode & | aMode | ) |
Switch between evaluating the CEA polynomials directly and evaluating the splines sampled off them.
The splines are faster because they avoid the interval search, at interpolation accuracy; the factory leaves every gas in SPLINE.
Only rebinds function pointers - both modes describe the same ideal gas, so this is not a change of physics.
|
protected |
set the molar mass
| [in] | aMolarMass | in kg/Mol, not g/Mol! |
|
protected |
set the reference enthalpy H(298.15 K) - H(0 K) in J/mol, as read from the thermo.inp record
|
protected |
set the formation enthalpy in J/mol
|
protected |
|
inline |
expose viscosity spline
|
inline |
expose viscosity spline ( const version )
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |