https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Classes | Typedefs | Functions | Variables
NASA7 Namespace Reference

Standard-state thermodynamic properties of ideal-gas species from NASA 7-coefficient polynomials. More...

Classes

struct  SpeciesData
 NASA 7-coefficient data of one species. More...
 

Typedefs

using Coefficients = std::array< Real, 7 >
 Coefficients a_0, ..., a_6 of the polynomial for one temperature interval.
 

Functions

const SpeciesData & speciesData (const std::string &name)
 Data of a built-in species.
 
std::string speciesNames ()
 Names of the built-in species, separated by spaces.
 
template<typename CppType >
const Coefficients & coefficients (const SpeciesData &data, const CppType &T)
 Coefficients of the polynomial that applies at a temperature.
 
template<typename CppType >
CppType cpOverR (const SpeciesData &data, const CppType &T)
 Standard-state molar isobaric heat capacity divided by the gas constant, cp/R.
 
template<typename CppType >
CppType hOverRT (const SpeciesData &data, const CppType &T)
 Standard-state molar enthalpy divided by the gas constant and temperature, h/(RT)
 
template<typename CppType >
CppType sOverR (const SpeciesData &data, const CppType &T)
 Standard-state molar entropy divided by the gas constant, s/R, at the reference pressure of the data (reference_pressure for the built-in species)
 

Variables

constexpr Real reference_pressure = 101325.0
 Pressure at which the standard-state entropy of the built-in species applies [Pa].
 

Detailed Description

Standard-state thermodynamic properties of ideal-gas species from NASA 7-coefficient polynomials.

Each species has two polynomials, one for temperatures up to a midpoint temperature and one above it. The evaluators return the dimensionless forms cp/R, h/(RT), and s/R, so that they are independent of the value of the universal gas constant.

Typedef Documentation

◆ Coefficients

using NASA7::Coefficients = typedef std::array<Real, 7>

Coefficients a_0, ..., a_6 of the polynomial for one temperature interval.

Definition at line 28 of file NASA7Polynomials.h.

Function Documentation

◆ coefficients()

template<typename CppType >
const Coefficients & NASA7::coefficients ( const SpeciesData &  data,
const CppType &  T 
)

Coefficients of the polynomial that applies at a temperature.

The low-temperature polynomial applies at the midpoint temperature itself, as in Cantera. The temperature range of the fit is not checked.

Definition at line 69 of file NASA7Polynomials.h.

70{
71 return MetaPhysicL::raw_value(T) <= data.T_mid ? data.low : data.high;
72}
const double T
auto raw_value(const Eigen::Map< T > &in)
Real T_mid
Temperature where the low- and high-temperature polynomials meet [K].
Coefficients low
Coefficients for T <= T_mid.
Coefficients high
Coefficients for T > T_mid.

Referenced by cpOverR(), hOverRT(), and sOverR().

◆ cpOverR()

template<typename CppType >
CppType NASA7::cpOverR ( const SpeciesData &  data,
const CppType &  T 
)

Standard-state molar isobaric heat capacity divided by the gas constant, cp/R.

Definition at line 77 of file NASA7Polynomials.h.

78{
79 const auto & a = coefficients(data, T);
80 return a[0] + T * (a[1] + T * (a[2] + T * (a[3] + T * a[4])));
81}
const Coefficients & coefficients(const SpeciesData &data, const CppType &T)
Coefficients of the polynomial that applies at a temperature.

Referenced by NASA7IdealGasFluidProperties::cp_from_T(), NASA7IdealGasFluidProperties::cv_from_T(), NASA7IdealGasFluidProperties::gamma_from_T(), NASA7IdealGasFluidProperties::k_from_T(), NASA7IdealGasFluidProperties::T_from_energy(), NASA7IdealGasFluidProperties::T_from_p_s(), TEST(), and TEST_F().

◆ hOverRT()

template<typename CppType >
CppType NASA7::hOverRT ( const SpeciesData &  data,
const CppType &  T 
)

Standard-state molar enthalpy divided by the gas constant and temperature, h/(RT)

Definition at line 86 of file NASA7Polynomials.h.

87{
88 const auto & a = coefficients(data, T);
89 return a[0] + T * (a[1] / 2 + T * (a[2] / 3 + T * (a[3] / 4 + T * a[4] / 5))) + a[5] / T;
90}

Referenced by NASA7IdealGasFluidProperties::e_from_T(), NASA7IdealGasFluidProperties::h_from_T(), NASA7IdealGasFluidProperties::T_from_energy(), and TEST().

◆ sOverR()

template<typename CppType >
CppType NASA7::sOverR ( const SpeciesData &  data,
const CppType &  T 
)

Standard-state molar entropy divided by the gas constant, s/R, at the reference pressure of the data (reference_pressure for the built-in species)

Definition at line 98 of file NASA7Polynomials.h.

99{
100 using std::log;
101 const auto & a = coefficients(data, T);
102 return a[0] * log(T) + T * (a[1] + T * (a[2] / 2 + T * (a[3] / 3 + T * a[4] / 4))) + a[6];
103}

Referenced by NASA7IdealGasFluidProperties::T_from_p_s(), and TEST().

◆ speciesData()

const SpeciesData & NASA7::speciesData ( const std::string &  name)

Data of a built-in species.

Parameters
[in]namespecies name: H2, O2, H2O, CH4, CO, CO2, or N2

Definition at line 159 of file NASA7Polynomials.C.

160{
161 for (const auto & data : species_data)
162 if (data.name == name)
163 return data;
164
165 mooseError("Unknown NASA-7 species '", name, "'.");
166}
void mooseError(Args &&... args)
const std::string name
Definition Setup.h:21

Referenced by TEST(), TEST(), TEST_F(), TEST_F(), and TEST_F().

◆ speciesNames()

std::string NASA7::speciesNames ( )

Names of the built-in species, separated by spaces.

Definition at line 169 of file NASA7Polynomials.C.

170{
171 std::vector<std::string> names;
172 for (const auto & data : species_data)
173 names.push_back(data.name);
174 return MooseUtils::join(names, " ");
175}

Referenced by NASA7IdealGasFluidProperties::validParams().

Variable Documentation

◆ reference_pressure

constexpr Real NASA7::reference_pressure = 101325.0
constexpr

Pressure at which the standard-state entropy of the built-in species applies [Pa].

Definition at line 50 of file NASA7Polynomials.h.

Referenced by NASA7IdealGasFluidProperties::T_from_p_s().