21 params.
addParam<
Real>(
"gamma_liquid", 2.35,
"Liquid heat capacity ratio");
22 params.
addParam<
Real>(
"cv_liquid", 1816.0,
"Liquid isochoric specific heat capacity");
23 params.
addParam<
Real>(
"q_liquid", -1.167e6,
"Liquid reference specific internal energy");
24 params.
addParam<
Real>(
"p_inf_liquid", 1.0e9,
"Liquid stiffness pressure");
25 params.
addParam<
Real>(
"q_prime_liquid", 0,
"Liquid reference specific entropy");
26 params.
addParam<
Real>(
"k_liquid", 0.5,
"Liquid thermal conductivity");
27 params.
addParam<
Real>(
"mu_liquid", 281.8e-6,
"Liquid dynamic viscosity");
28 params.
addParam<
Real>(
"M_liquid", 0.01801488,
"Liquid molar mass");
30 params.
addParam<
Real>(
"gamma_vapor", 1.43,
"Vapor heat capacity ratio");
31 params.
addParam<
Real>(
"cv_vapor", 1040.0,
"Vapor isochoric specific heat capacity");
32 params.
addParam<
Real>(
"q_vapor", 2.03e6,
"Vapor reference specific internal energy");
33 params.
addParam<
Real>(
"p_inf_vapor", 0.0,
"Vapor stiffness pressure");
34 params.
addParam<
Real>(
"q_prime_vapor", -2.3e4,
"Vapor reference specific entropy");
35 params.
addParam<
Real>(
"k_vapor", 0.026,
"Vapor thermal conductivity");
36 params.
addParam<
Real>(
"mu_vapor", 134.4e-7,
"Vapor dynamic viscosity");
37 params.
addParam<
Real>(
"M_vapor", 0.01801488,
"Vapor molar mass");
39 params.
addParam<
Real>(
"T_c", 647.096,
"Critical temperature [K]");
40 params.
addParam<
Real>(
"p_c", 22.09e6,
"Critical pressure [Pa]");
41 params.
addParam<
Real>(
"rho_c", 322.0,
"Critical density [kg/m^3]");
42 params.
addParam<
Real>(
"e_c", 2702979.84310559,
"Critical specific internal energy [J/kg]");
43 params.
addParam<
Real>(
"T_triple", 273.16,
"Triple-point temperature [K]");
44 params.
addParam<
Real>(
"L_fusion", 0.334,
"Latent heat of fusion [J/kg]");
47 "sigma_A", 0.2358,
"'A' constant used in surface tension correlation [N/m]");
48 params.
addParam<
Real>(
"sigma_B", 1.256,
"'B' constant used in surface tension correlation");
49 params.
addParam<
Real>(
"sigma_C", 0.625,
"'C' constant used in surface tension correlation");
53 params.
addParam<
Real>(
"T_sat_min", 274.0,
"Minimum temperature value in saturation curve [K]");
54 params.
addParam<
Real>(
"T_sat_max", 647.0,
"Maximum temperature value in saturation curve [K]");
56 "p_sat_guess", 611.0,
"Initial guess for saturation pressure Newton solve [Pa]");
58 "n_sat_samples", 374,
"Number of samples to take in saturation curve");
70 _gamma_liquid(getParam<
Real>(
"gamma_liquid")),
71 _cv_liquid(getParam<
Real>(
"cv_liquid")),
72 _cp_liquid(_gamma_liquid * _cv_liquid),
73 _q_liquid(getParam<
Real>(
"q_liquid")),
74 _p_inf_liquid(getParam<
Real>(
"p_inf_liquid")),
75 _q_prime_liquid(getParam<
Real>(
"q_prime_liquid")),
77 _gamma_vapor(getParam<
Real>(
"gamma_vapor")),
78 _cv_vapor(getParam<
Real>(
"cv_vapor")),
79 _cp_vapor(_gamma_vapor * _cv_vapor),
80 _q_vapor(getParam<
Real>(
"q_vapor")),
81 _p_inf_vapor(getParam<
Real>(
"p_inf_vapor")),
82 _q_prime_vapor(getParam<
Real>(
"q_prime_vapor")),
84 _T_c(getParam<
Real>(
"T_c")),
85 _p_c(getParam<
Real>(
"p_c")),
86 _T_triple(getParam<
Real>(
"T_triple")),
87 _L_fusion(getParam<
Real>(
"L_fusion")),
89 _sigma_A(getParam<
Real>(
"sigma_A")),
90 _sigma_B(getParam<
Real>(
"sigma_B")),
91 _sigma_C(getParam<
Real>(
"sigma_C")),
93 _T_sat_min(getParam<
Real>(
"T_sat_min")),
94 _T_sat_max(getParam<
Real>(
"T_sat_max")),
95 _p_sat_guess(getParam<
Real>(
"p_sat_guess")),
96 _n_sat_samples(getParam<unsigned
int>(
"n_sat_samples")),
97 _dT_sat((_T_sat_max - _T_sat_min) / (_n_sat_samples - 1)),
99 _A((_cp_liquid - _cp_vapor + _q_prime_vapor - _q_prime_liquid) / (_cp_vapor - _cv_vapor)),
100 _B((_q_liquid - _q_vapor) / (_cp_vapor - _cv_vapor)),
101 _C((_cp_vapor - _cp_liquid) / (_cp_vapor - _cv_vapor)),
102 _D((_cp_liquid - _cv_liquid) / (_cp_vapor - _cv_vapor)),
105 _newton_max_iter(200)
109 std::string class_name =
"StiffenedGasFluidProperties";
111 params.
set<
MooseEnum>(
"emit_on_nan") = getParam<MooseEnum>(
"emit_on_nan");
112 params.
set<
bool>(
"allow_nonphysical_states") =
false;
118 params.
set<
Real>(
"k") = getParam<Real>(
"k_liquid");
119 params.
set<
Real>(
"mu") = getParam<Real>(
"mu_liquid");
120 params.
set<
Real>(
"M") = getParam<Real>(
"M_liquid");
127 std::string class_name =
"StiffenedGasFluidProperties";
129 params.
set<
MooseEnum>(
"emit_on_nan") = getParam<MooseEnum>(
"emit_on_nan");
130 params.
set<
bool>(
"allow_nonphysical_states") =
false;
136 params.
set<
Real>(
"k") = getParam<Real>(
"k_vapor");
137 params.
set<
Real>(
"mu") = getParam<Real>(
"mu_vapor");
138 params.
set<
Real>(
"M") = getParam<Real>(
"M_vapor");
139 params.
set<
Real>(
"T_c") = getParam<Real>(
"T_c");
140 params.
set<
Real>(
"rho_c") = getParam<Real>(
"rho_c");
141 params.
set<
Real>(
"e_c") = getParam<Real>(
"e_c");
202 unsigned int iter = 1;
207 mooseError(
"StiffenedGasTwoPhaseFluidProperties::compute_p_sat: ",
208 "Newton solve did not converge after ",
218 f_norm =
f / f_prime;
244 const Real dsigma_daux =
247 return dsigma_daux * daux_dT;
const SinglePhaseFluidProperties * _fp_vapor
The user object that provides vapor phase fluid properties.
virtual Real L_fusion() const override
Returns the latent heat of fusion.
const UserObjectName _vapor_name
The name of the user object that provides vapor phase fluid properties.
const unsigned int & _n_sat_samples
Number of samples to take in saturation curve.
T & getUserObject(const std::string &name, unsigned int tid=0) const
virtual Real T_triple() const override
Returns the triple-point temperature.
const UserObjectName _liquid_name
The name of the user object that provides liquid phase fluid properties.
virtual Real p_sat(Real temperature) const override
Computes the saturation pressure at a temperature.
virtual Real dT_sat_dp(Real pressure) const override
Computes dT/dp along the saturation line.
const Real _dT_sat
Temperature increments on saturation curve.
const Real _q_prime_vapor
const Real _q_prime_liquid
virtual Real p_critical() const override
Returns the critical pressure.
InputParameters getValidParams(const std::string &name) const
const Real _newton_tol
Newton solve tolerance.
T sample(const T &x) const
const SinglePhaseFluidProperties * _fp_liquid
The user object that provides liquid phase fluid properties.
static const std::string temperature
virtual Real sigma_from_T(Real T) const override
Computes surface tension sigma of saturated liquid in contact with saturated vapor.
LinearInterpolation _ipol_pressure
const Real & _sigma_B
'B' constant used in surface tension correlation
std::vector< Real > _p_sat_vec
static InputParameters validParams()
LinearInterpolation _ipol_temp
Base class for fluid properties used with two-phase flow.
Two-phase stiffened gas fluid properties.
const Real & _p_c
critical pressure
static InputParameters validParams()
T sampleDerivative(const T &x) const
const unsigned int _newton_max_iter
Newton max number of iterations.
const Real & _sigma_C
'C' constant used in surface tension correlation
Real f(Real x)
Test function for Brents method.
const Real & _T_c
critical temperature
const Real & _T_triple
Triple-point temperature.
const Real & _L_fusion
Latent heat of fusion.
Common class for single phase fluid properties.
void setData(const std::vector< Real > &X, const std::vector< Real > &Y)
const Real & _p_sat_guess
Initial guess for saturation pressure Newton solve.
StiffenedGasTwoPhaseFluidProperties(const InputParameters ¶meters)
Real compute_p_sat(const Real &T) const
Computes saturation pressure value using Newton solve.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
FEProblemBase & _fe_problem
virtual std::vector< std::shared_ptr< UserObject > > addUserObject(const std::string &user_object_name, const std::string &name, InputParameters ¶meters)
static const std::string pressure
void mooseError(Args &&... args) const
registerMooseObject("FluidPropertiesApp", StiffenedGasTwoPhaseFluidProperties)
static InputParameters validParams()
const Real & _T_sat_min
Minimum temperature value in saturation curve.
const Real & _sigma_A
'A' constant used in surface tension correlation
Interface class for producing errors, warnings, or just quiet NaNs.
std::vector< Real > _T_vec
MooseUnits pow(const MooseUnits &, int)
virtual Real T_sat(Real pressure) const override
Computes the saturation temperature at a pressure.
virtual Real dsigma_dT_from_T(Real T) const override
Computes dsigma/dT along the saturation line.
void ErrorVector unsigned int