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")
68template <
typename CppType>
73 if (std::isnan(T_raw) || T_raw <= 0)
74 flagInvalidSolution(
"Non-positive or not-a-number temperature");
75 else if (T_raw < _data.T_min || T_raw >
_data.
T_max)
77 "Temperature outside the range of the NASA-7 data; the polynomials are extrapolated");
80template <
typename CppType>
88 if (
_is_steam && (T_raw < 273.16 || T_raw > 1173.15))
89 flagSolutionWarning(
"Temperature outside the range of validity of the IAPWS transport "
90 "formulations for steam");
93template <
typename CppType>
101template <
typename CppType>
109template <
typename CppType>
117template <
typename CppType>
125template <
typename CppType>
131 return cp_R / (cp_R - 1);
134template <
typename CppType>
144template <
typename CppType>
159template <
typename CppType>
161NASA7IdealGasFluidProperties::rho_from_p_T_template(
const CppType &
p,
const CppType &
T)
const
166template <
typename CppType>
168NASA7IdealGasFluidProperties::v_from_p_T_template(
const CppType &
p,
const CppType &
T)
const
173template <
typename CppType>
175NASA7IdealGasFluidProperties::e_from_p_T_template(
const CppType & ,
const CppType &
T)
const
180template <
typename CppType>
182NASA7IdealGasFluidProperties::h_from_p_T_template(
const CppType & ,
const CppType &
T)
const
187template <
typename CppType>
189NASA7IdealGasFluidProperties::s_from_p_T_template(
const CppType &
p,
const CppType &
T)
const
196template <
typename CppType>
198NASA7IdealGasFluidProperties::cp_from_p_T_template(
const CppType & ,
const CppType &
T)
const
203template <
typename CppType>
205NASA7IdealGasFluidProperties::cv_from_p_T_template(
const CppType & ,
const CppType &
T)
const
210template <
typename CppType>
212NASA7IdealGasFluidProperties::c_from_p_T_template(
const CppType & ,
const CppType &
T)
const
218template <
typename CppType>
220NASA7IdealGasFluidProperties::gamma_from_p_T_template(
const CppType & ,
221 const CppType &
T)
const
226template <
typename CppType>
228NASA7IdealGasFluidProperties::mu_from_p_T_template(
const CppType & ,
const CppType &
T)
const
233template <
typename CppType>
235NASA7IdealGasFluidProperties::k_from_p_T_template(
const CppType & ,
const CppType &
T)
const
240template <
typename CppType>
242NASA7IdealGasFluidProperties::p_from_T_v_template(
const CppType &
T,
const CppType &
v)
const
247template <
typename CppType>
249NASA7IdealGasFluidProperties::e_from_T_v_template(
const CppType &
T,
const CppType & )
const
254template <
typename CppType>
256NASA7IdealGasFluidProperties::h_from_T_v_template(
const CppType &
T,
const CppType & )
const
261template <
typename CppType>
263NASA7IdealGasFluidProperties::s_from_T_v_template(
const CppType &
T,
const CppType &
v)
const
265 return s_from_p_T_template(p_from_T_v_template(
T,
v),
T);
268template <
typename CppType>
270NASA7IdealGasFluidProperties::cv_from_T_v_template(
const CppType &
T,
const CppType & )
const
275template <
typename CppType>
277NASA7IdealGasFluidProperties::e_from_p_rho_template(
const CppType &
p,
const CppType &
rho)
const
282template <
typename CppType>
301 const auto shifted_y = [
this, k, shift](
const CppType & ,
312 const CppType target =
y + shift;
318 name() +
"::T_from_energy",
324template <
typename CppType>
326NASA7IdealGasFluidProperties::T_from_v_e_template(
const CppType & ,
const CppType & e)
const
333template <
typename CppType>
335NASA7IdealGasFluidProperties::p_from_v_e_template(
const CppType &
v,
const CppType & e)
const
342template <
typename CppType>
344NASA7IdealGasFluidProperties::c_from_v_e_template(
const CppType & ,
const CppType & e)
const
351template <
typename CppType>
353NASA7IdealGasFluidProperties::cp_from_v_e_template(
const CppType & ,
const CppType & e)
const
358template <
typename CppType>
360NASA7IdealGasFluidProperties::cv_from_v_e_template(
const CppType & ,
const CppType & e)
const
365template <
typename CppType>
367NASA7IdealGasFluidProperties::gamma_from_v_e_template(
const CppType & ,
368 const CppType & e)
const
373template <
typename CppType>
375NASA7IdealGasFluidProperties::s_from_v_e_template(
const CppType &
v,
const CppType & e)
const
380template <
typename CppType>
382NASA7IdealGasFluidProperties::g_from_v_e_template(
const CppType &
v,
const CppType & e)
const
393template <
typename CppType>
395NASA7IdealGasFluidProperties::mu_from_v_e_template(
const CppType & ,
const CppType & e)
const
400template <
typename CppType>
402NASA7IdealGasFluidProperties::k_from_v_e_template(
const CppType & ,
const CppType & e)
const
407template <
typename CppType>
409NASA7IdealGasFluidProperties::T_from_p_h_template(
const CppType & ,
const CppType & h)
const
416template <
typename CppType>
418NASA7IdealGasFluidProperties::s_from_h_p_template(
const CppType & h,
const CppType &
p)
const
423template <
typename CppType>
425NASA7IdealGasFluidProperties::p_from_h_s_template(
const CppType & h,
const CppType & s)
const
434template <
typename CppType>
436NASA7IdealGasFluidProperties::e_from_v_h_template(
const CppType & ,
const CppType & h)
const
443template <
typename CppType>
447 using std::exp, std::log;
455 const auto s0_from_x = [
this](
const CppType & ,
458 CppType & ds0_x_dtarget,
461 const CppType
T = exp(
x);
472 name() +
"::T_from_p_s",
478template <
typename CppType>
480NASA7IdealGasFluidProperties::rho_from_p_s_template(
const CppType &
p,
const CppType & s)
const
491#define definePropertyFromTemplate(want, prop1, prop2) \
492 template <typename CppType> \
493 void NASA7IdealGasFluidProperties::want##_from_##prop1##_##prop2##_template( \
494 const CppType & prop1, \
495 const CppType & prop2, \
497 CppType & d##want##d1, \
498 CppType & d##want##d2) const \
500 const auto value = [this](const auto & x, const auto & y) \
501 { return this->want##_from_##prop1##_##prop2##_template(x, y); }; \
502 xyDerivatives(prop1, prop2, val, d##want##d1, d##want##d2, value); \
505 Real NASA7IdealGasFluidProperties::want##_from_##prop1##_##prop2(Real prop1, Real prop2) const \
507 return want##_from_##prop1##_##prop2##_template(prop1, prop2); \
510 ADReal NASA7IdealGasFluidProperties::want##_from_##prop1##_##prop2(const ADReal & prop1, \
511 const ADReal & prop2) const \
513 return want##_from_##prop1##_##prop2##_template(prop1, prop2); \
516 void NASA7IdealGasFluidProperties::want##_from_##prop1##_##prop2( \
517 Real prop1, Real prop2, Real & val, Real & d##want##d1, Real & d##want##d2) const \
519 want##_from_##prop1##_##prop2##_template(prop1, prop2, val, d##want##d1, d##want##d2); \
522 void NASA7IdealGasFluidProperties::want##_from_##prop1##_##prop2(const ADReal & prop1, \
523 const ADReal & prop2, \
525 ADReal & d##want##d1, \
526 ADReal & d##want##d2) const \
528 want##_from_##prop1##_##prop2##_template(prop1, prop2, val, d##want##d1, d##want##d2); \
532definePropertyFromTemplate(
rho,
p,
T)
533definePropertyFromTemplate(
v,
p,
T)
534definePropertyFromTemplate(e,
p,
T)
535definePropertyFromTemplate(h,
p,
T)
536definePropertyFromTemplate(s,
p,
T)
537definePropertyFromTemplate(cp,
p,
T)
538definePropertyFromTemplate(cv,
p,
T)
539definePropertyFromTemplate(
c,
p,
T)
540definePropertyFromTemplate(gamma,
p,
T)
541definePropertyFromTemplate(
mu,
p,
T)
542definePropertyFromTemplate(k,
p,
T)
543definePropertyFromTemplate(
p,
T,
v)
544definePropertyFromTemplate(e,
T,
v)
545definePropertyFromTemplate(h,
T,
v)
546definePropertyFromTemplate(s,
T,
v)
547definePropertyFromTemplate(cv,
T,
v)
548definePropertyFromTemplate(e,
p,
rho)
549definePropertyFromTemplate(
T,
v, e)
550definePropertyFromTemplate(
p,
v, e)
551definePropertyFromTemplate(
c,
v, e)
552definePropertyFromTemplate(cp,
v, e)
553definePropertyFromTemplate(cv,
v, e)
554definePropertyFromTemplate(gamma,
v, e)
555definePropertyFromTemplate(s,
v, e)
556definePropertyFromTemplate(g,
v, e)
557definePropertyFromTemplate(
mu,
v, e)
558definePropertyFromTemplate(k,
v, e)
559definePropertyFromTemplate(
T,
p, h)
560definePropertyFromTemplate(s, h,
p)
561definePropertyFromTemplate(
p, h, s)
562definePropertyFromTemplate(e,
v, h)
563definePropertyFromTemplate(
rho,
p, s)
566#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)
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 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].
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].