27 params.
addClassDescription(
"Ideal gas with temperature-dependent heat capacity, enthalpy, and "
28 "entropy from NASA 7-coefficient polynomials");
36 _R_specific(_R / _data.molar_mass),
38 _is_steam(_data.
name ==
"H2O"),
39 _is_helium(_data.
name ==
"He")
69template <
typename CppType>
74 if (std::isnan(T_raw) || T_raw <= 0)
75 flagInvalidSolution(
"Non-positive or not-a-number temperature");
76 else if (T_raw < _data.T_min || T_raw >
_data.
T_max)
78 "Temperature outside the range of the NASA-7 data; the polynomials are extrapolated");
81template <
typename CppType>
89 if (
_is_steam && (T_raw < 273.16 || T_raw > 1173.15))
90 flagSolutionWarning(
"Temperature outside the range of validity of the IAPWS transport "
91 "formulations for steam");
93 if (
_is_helium && (T_raw < 273.15 || T_raw > 1800))
94 flagSolutionWarning(
"Temperature outside the range of validity of the transport correlations "
98template <
typename CppType>
106template <
typename CppType>
114template <
typename CppType>
122template <
typename CppType>
130template <
typename CppType>
136 return cp_R / (cp_R - 1);
139template <
typename CppType>
153template <
typename CppType>
170template <
typename CppType>
172NASA7IdealGasFluidProperties::rho_from_p_T_template(
const CppType &
p,
const CppType &
T)
const
177template <
typename CppType>
179NASA7IdealGasFluidProperties::v_from_p_T_template(
const CppType &
p,
const CppType &
T)
const
184template <
typename CppType>
186NASA7IdealGasFluidProperties::e_from_p_T_template(
const CppType & ,
const CppType &
T)
const
191template <
typename CppType>
193NASA7IdealGasFluidProperties::h_from_p_T_template(
const CppType & ,
const CppType &
T)
const
198template <
typename CppType>
200NASA7IdealGasFluidProperties::s_from_p_T_template(
const CppType &
p,
const CppType &
T)
const
207template <
typename CppType>
209NASA7IdealGasFluidProperties::cp_from_p_T_template(
const CppType & ,
const CppType &
T)
const
214template <
typename CppType>
216NASA7IdealGasFluidProperties::cv_from_p_T_template(
const CppType & ,
const CppType &
T)
const
221template <
typename CppType>
223NASA7IdealGasFluidProperties::c_from_p_T_template(
const CppType & ,
const CppType &
T)
const
229template <
typename CppType>
231NASA7IdealGasFluidProperties::gamma_from_p_T_template(
const CppType & ,
232 const CppType &
T)
const
237template <
typename CppType>
239NASA7IdealGasFluidProperties::mu_from_p_T_template(
const CppType & ,
const CppType &
T)
const
244template <
typename CppType>
246NASA7IdealGasFluidProperties::k_from_p_T_template(
const CppType & ,
const CppType &
T)
const
251template <
typename CppType>
253NASA7IdealGasFluidProperties::p_from_T_v_template(
const CppType &
T,
const CppType &
v)
const
258template <
typename CppType>
260NASA7IdealGasFluidProperties::e_from_T_v_template(
const CppType &
T,
const CppType & )
const
265template <
typename CppType>
267NASA7IdealGasFluidProperties::h_from_T_v_template(
const CppType &
T,
const CppType & )
const
272template <
typename CppType>
274NASA7IdealGasFluidProperties::s_from_T_v_template(
const CppType &
T,
const CppType &
v)
const
276 return s_from_p_T_template(p_from_T_v_template(
T,
v),
T);
279template <
typename CppType>
281NASA7IdealGasFluidProperties::cv_from_T_v_template(
const CppType &
T,
const CppType & )
const
286template <
typename CppType>
288NASA7IdealGasFluidProperties::e_from_p_rho_template(
const CppType &
p,
const CppType &
rho)
const
293template <
typename CppType>
312 const auto shifted_y = [
this, k, shift](
const CppType & ,
323 const CppType target =
y + shift;
329 name() +
"::T_from_energy",
335template <
typename CppType>
337NASA7IdealGasFluidProperties::T_from_v_e_template(
const CppType & ,
const CppType & e)
const
344template <
typename CppType>
346NASA7IdealGasFluidProperties::p_from_v_e_template(
const CppType &
v,
const CppType & e)
const
353template <
typename CppType>
355NASA7IdealGasFluidProperties::c_from_v_e_template(
const CppType & ,
const CppType & e)
const
362template <
typename CppType>
364NASA7IdealGasFluidProperties::cp_from_v_e_template(
const CppType & ,
const CppType & e)
const
369template <
typename CppType>
371NASA7IdealGasFluidProperties::cv_from_v_e_template(
const CppType & ,
const CppType & e)
const
376template <
typename CppType>
378NASA7IdealGasFluidProperties::gamma_from_v_e_template(
const CppType & ,
379 const CppType & e)
const
384template <
typename CppType>
386NASA7IdealGasFluidProperties::s_from_v_e_template(
const CppType &
v,
const CppType & e)
const
391template <
typename CppType>
393NASA7IdealGasFluidProperties::g_from_v_e_template(
const CppType &
v,
const CppType & e)
const
404template <
typename CppType>
406NASA7IdealGasFluidProperties::mu_from_v_e_template(
const CppType & ,
const CppType & e)
const
411template <
typename CppType>
413NASA7IdealGasFluidProperties::k_from_v_e_template(
const CppType & ,
const CppType & e)
const
418template <
typename CppType>
420NASA7IdealGasFluidProperties::T_from_p_h_template(
const CppType & ,
const CppType & h)
const
427template <
typename CppType>
429NASA7IdealGasFluidProperties::s_from_h_p_template(
const CppType & h,
const CppType &
p)
const
434template <
typename CppType>
436NASA7IdealGasFluidProperties::p_from_h_s_template(
const CppType & h,
const CppType & s)
const
445template <
typename CppType>
447NASA7IdealGasFluidProperties::e_from_v_h_template(
const CppType & ,
const CppType & h)
const
454template <
typename CppType>
458 using std::exp, std::log;
466 const auto s0_from_x = [
this](
const CppType & ,
469 CppType & ds0_x_dtarget,
472 const CppType
T = exp(
x);
483 name() +
"::T_from_p_s",
489template <
typename CppType>
491NASA7IdealGasFluidProperties::rho_from_p_s_template(
const CppType &
p,
const CppType & s)
const
502#define definePropertyFromTemplate(want, prop1, prop2) \
503 template <typename CppType> \
504 void NASA7IdealGasFluidProperties::want##_from_##prop1##_##prop2##_template( \
505 const CppType & prop1, \
506 const CppType & prop2, \
508 CppType & d##want##d1, \
509 CppType & d##want##d2) const \
511 const auto value = [this](const auto & x, const auto & y) \
512 { return this->want##_from_##prop1##_##prop2##_template(x, y); }; \
513 xyDerivatives(prop1, prop2, val, d##want##d1, d##want##d2, value); \
516 Real NASA7IdealGasFluidProperties::want##_from_##prop1##_##prop2(Real prop1, Real prop2) const \
518 return want##_from_##prop1##_##prop2##_template(prop1, prop2); \
521 ADReal NASA7IdealGasFluidProperties::want##_from_##prop1##_##prop2(const ADReal & prop1, \
522 const ADReal & prop2) const \
524 return want##_from_##prop1##_##prop2##_template(prop1, prop2); \
527 void NASA7IdealGasFluidProperties::want##_from_##prop1##_##prop2( \
528 Real prop1, Real prop2, Real & val, Real & d##want##d1, Real & d##want##d2) const \
530 want##_from_##prop1##_##prop2##_template(prop1, prop2, val, d##want##d1, d##want##d2); \
533 void NASA7IdealGasFluidProperties::want##_from_##prop1##_##prop2(const ADReal & prop1, \
534 const ADReal & prop2, \
536 ADReal & d##want##d1, \
537 ADReal & d##want##d2) const \
539 want##_from_##prop1##_##prop2##_template(prop1, prop2, val, d##want##d1, d##want##d2); \
543definePropertyFromTemplate(
rho,
p,
T)
544definePropertyFromTemplate(
v,
p,
T)
545definePropertyFromTemplate(e,
p,
T)
546definePropertyFromTemplate(h,
p,
T)
547definePropertyFromTemplate(s,
p,
T)
548definePropertyFromTemplate(cp,
p,
T)
549definePropertyFromTemplate(cv,
p,
T)
550definePropertyFromTemplate(
c,
p,
T)
551definePropertyFromTemplate(gamma,
p,
T)
552definePropertyFromTemplate(
mu,
p,
T)
553definePropertyFromTemplate(k,
p,
T)
554definePropertyFromTemplate(
p,
T,
v)
555definePropertyFromTemplate(e,
T,
v)
556definePropertyFromTemplate(h,
T,
v)
557definePropertyFromTemplate(s,
T,
v)
558definePropertyFromTemplate(cv,
T,
v)
559definePropertyFromTemplate(e,
p,
rho)
560definePropertyFromTemplate(
T,
v, e)
561definePropertyFromTemplate(
p,
v, e)
562definePropertyFromTemplate(
c,
v, e)
563definePropertyFromTemplate(cp,
v, e)
564definePropertyFromTemplate(cv,
v, e)
565definePropertyFromTemplate(gamma,
v, e)
566definePropertyFromTemplate(s,
v, e)
567definePropertyFromTemplate(g,
v, e)
568definePropertyFromTemplate(
mu,
v, e)
569definePropertyFromTemplate(k,
v, e)
570definePropertyFromTemplate(
T,
p, h)
571definePropertyFromTemplate(s, h,
p)
572definePropertyFromTemplate(
p, h, s)
573definePropertyFromTemplate(e,
v, h)
574definePropertyFromTemplate(
rho,
p, s)
577#undef definePropertyFromTemplate
const std::vector< double > y
const std::vector< double > x
registerMooseObject("FluidPropertiesApp", NASA7IdealGasFluidProperties)
const std::string & name() const
Ideal gas whose heat capacity, enthalpy, and entropy depend on temperature through NASA 7-coefficient...
static InputParameters validParams()
const NASA7::SpeciesData _data
NASA 7-coefficient data of the species.
NASA7IdealGasFluidProperties(const InputParameters ¶meters)
const bool _is_helium
Whether the species is helium, whose viscosity and thermal conductivity come from Petersen.
CppType T_from_energy(const CppType &y, const Real k) const
Temperature at which R_s T (h/(RT) - k) equals y, by Newton's method: k = 1 for the specific internal...
const bool _is_steam
Whether the species is steam, whose viscosity and thermal conductivity come from IAPWS.
std::string fluidName() const override
Fluid name.
CppType gamma_from_T(const CppType &T) const
CppType mu_from_T(const CppType &T) const
CppType T_from_p_s(const CppType &p, const CppType &s) const
Temperature at which the specific entropy at pressure p equals s, by Newton's method on the logarithm...
void checkTemperature(const CppType &T) const
Flags a temperature outside the range of the data as a solution warning, because the polynomials are ...
CppType cp_from_T(const CppType &T) const
CppType k_from_T(const CppType &T) const
Real molarMass() const override
Molar mass [kg/mol].
CppType e_from_T(const CppType &T) const
Properties that depend on temperature only.
CppType h_from_T(const CppType &T) const
CppType cv_from_T(const CppType &T) const
void checkTransportTemperature(const CppType &T) const
Checks the temperature as checkTemperature does and, for steam, also flags a temperature outside the ...
const GasTransportUtils::LennardJonesParameters _lennard_jones
Lennard-Jones parameters of the species.
virtual const GasTransportUtils::LennardJonesParameters * lennardJonesParameters() const override
Lennard-Jones parameters of the gas, from which a mixture computes binary diffusion coefficients,...
const Real _R_specific
Specific gas constant [J/(kg K)].
virtual Real newtonStartTemperature() const override
The upper end of the temperature range of the NASA 7-coefficient data [K].
Common class for single phase fluid properties.
const bool _verbose_newton
Whether to output information about newton solves to console.
static InputParameters validParams()
e e e e s T T T T T rho T
const Real _tolerance
Newton's method may be used to convert between variable sets.
const unsigned int _max_newton_its
Maximum number of iterations for the variable conversion newton solves.
e e e e s T T T T T rho v v T e h
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template * sqrt(_arg)) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(tanh
std::pair< T, T > NewtonSolve(const T &x, const T &y, const Real z_initial_guess, const Real tolerance, const Functor &y_from_x_z, const std::string &caller_name, const unsigned int max_its=100, const bool verbose=false)
NewtonSolve does a 1D Newton Solve to solve the equation y = f(x, z) for variable z.
Transport properties of dilute gases: Lennard-Jones parameters of the NASA 7-coefficient species,...
CppType heliumConductivityZeroPressure(const CppType &T)
Thermal conductivity of helium in the limit of zero pressure [W/(m K)], from the correlation of Peter...
CppType modifiedEuckenConductivity(const CppType &mu, const CppType &cp_over_R, const Real R_specific)
Thermal conductivity of a dilute gas from the modified Eucken correlation [W/(m K)],...
CppType steamViscosityZeroDensity(const CppType &T)
Viscosity of steam in the limit of zero density [Pa s], from the IAPWS 2008 formulation,...
CppType steamConductivityZeroDensity(const CppType &T)
Thermal conductivity of steam in the limit of zero density [W/(m K)], from the IAPWS 2011 formulation...
CppType viscosity(const CppType &T, const Real molar_mass, const LennardJonesParameters &lj)
Chapman-Enskog viscosity of a dilute gas [Pa s].
CppType heliumViscosity(const CppType &T)
Viscosity of helium [Pa s], from the correlation of Petersen (1970), as in HeliumFluidProperties.
Standard-state thermodynamic properties of ideal-gas species from NASA 7-coefficient polynomials.
CppType hOverRT(const SpeciesData &data, const CppType &T)
Standard-state molar enthalpy divided by the gas constant and temperature, h/(RT)
CppType cpOverR(const SpeciesData &data, const CppType &T)
Standard-state molar isobaric heat capacity divided by the gas constant, cp/R.
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 ...
constexpr Real reference_pressure
Pressure at which the standard-state entropy of the built-in species applies [Pa].
std::string speciesNames()
Names of the built-in species, separated by spaces.
Parameters of the Lennard-Jones (12-6) potential of a species.
Real T_max
Upper end of the temperature range of the fit [K].
std::string name
Species name, e.g. "H2O".
Real molar_mass
Molar mass [kg/mol].