24 params.addRequiredParam<UserObjectName>(
NS::fluid,
"Fluid properties functor userobject");
25 params.addClassDescription(
"Creates functor fluid properties using a (P, T) formulation");
27 params.addRequiredParam<MooseFunctorName>(
NS::pressure,
"Pressure");
28 params.addRequiredParam<MooseFunctorName>(
NS::T_fluid,
"Fluid temperature");
29 params.addRequiredParam<MooseFunctorName>(
NS::speed,
"Velocity norm");
30 params.addParam<MooseFunctorName>(
NS::density,
"Density");
31 params.addParam<
bool>(
32 "force_define_density",
34 "Whether to force the definition of a density functor from the fluid properties");
35 params.addParam<
bool>(
"neglect_derivatives_of_density_time_derivative",
37 "Whether to neglect the derivatives with regards to nonlinear variables " 38 "of the density time derivatives");
40 params.addParam<FunctionName>(
41 "mu_rampdown", 1,
"A function describing a ramp down of viscosity over time");
42 params.addRequiredParam<MooseFunctorName>(
NS::porosity,
"porosity");
43 params.addRequiredParam<MooseFunctorName>(
44 "characteristic_length",
"characteristic length for Reynolds number calculation");
47 params.addParam<
bool>(
"solving_for_dynamic_pressure",
49 "Whether to solve for the dynamic pressure instead of the total pressure");
50 params.addParam<Point>(
"reference_pressure_point",
52 "Point at which the gravity term for the static pressure is zero");
53 params.addParam<
Real>(
"reference_pressure", 1e5,
"Total pressure at the reference point");
54 params.addParam<Point>(
"gravity", Point(0, 0, -9.81),
"Gravity vector");
56 params.addParamNamesToGroup(
57 "solving_for_dynamic_pressure reference_pressure_point reference_pressure",
61 params.addParam<MooseFunctorName>(
62 "density_name",
NS::density,
"Name to give to the density functor");
63 params.addParam<MooseFunctorName>(
64 "dynamic_viscosity_name",
NS::mu,
"Name to give to the dynamic viscosity functor");
65 params.addParam<MooseFunctorName>(
66 "specific_heat_name",
NS::cp,
"Name to give to the specific heat (cp) functor");
67 params.addParam<MooseFunctorName>(
68 "thermal_conductivity_name",
NS::k,
"Name to give to the thermal conductivity functor");
69 params.addParamNamesToGroup(
70 "density_name dynamic_viscosity_name specific_heat_name thermal_conductivity_name",
71 "Functor property names");
81 _d(getFunctor<
Real>(
"characteristic_length")),
83 _pressure_is_dynamic(getParam<bool>(
"solving_for_dynamic_pressure")),
84 _reference_pressure_point(getParam<Point>(
"reference_pressure_point")),
85 _reference_pressure_value(getParam<
Real>(
"reference_pressure")),
86 _gravity_vec(getParam<Point>(
"gravity")),
91 _force_define_density(getParam<bool>(
"force_define_density")),
93 _mu_rampdown(getFunction(
"mu_rampdown")),
94 _neglect_derivatives_of_density_time_derivative(
95 getParam<bool>(
"neglect_derivatives_of_density_time_derivative")),
97 _density_name(getParam<MooseFunctorName>(
"density_name")),
98 _dynamic_viscosity_name(getParam<MooseFunctorName>(
"dynamic_viscosity_name")),
99 _specific_heat_name(getParam<MooseFunctorName>(
"specific_heat_name")),
100 _thermal_conductivity_name(getParam<MooseFunctorName>(
"thermal_conductivity_name"))
106 "'reference_pressure_point' and 'reference_pressure' should not be set unless " 107 "solving for the dynamic pressure");
122 addFunctorProperty<GenericReal<is_ad>>(
127 addFunctorProperty<GenericReal<is_ad>>(
132 const auto &
cp = addFunctorProperty<GenericReal<is_ad>>(
137 const auto &
mu = addFunctorProperty<GenericReal<is_ad>>(
142 const auto &
k = addFunctorProperty<GenericReal<is_ad>>(
152 addFunctorProperty<GenericReal<is_ad>>(
156 Real rho, drho_dp, drho_dT;
167 addFunctorProperty<GenericReal<is_ad>>(
177 addFunctorProperty<GenericReal<is_ad>>(
181 Real dcp_dp, dcp_dT, dummy;
184 _fluid.cp_from_p_T(raw_pressure, raw_T_fluid, dummy, dcp_dp, dcp_dT);
193 const auto & drho_dp = addFunctorProperty<Real>(
195 [
this](
const auto & r,
const auto & t) ->
Real 197 Real drho_dp, drho_dT, dummy;
201 _fluid.rho_from_p_T(raw_pressure, raw_T_fluid, dummy, drho_dp, drho_dT);
205 const auto & drho_dT = addFunctorProperty<Real>(
207 [
this](
const auto & r,
const auto & t) ->
Real 209 Real drho_dp, drho_dT, dummy;
213 _fluid.rho_from_p_T(raw_pressure, raw_T_fluid, dummy, drho_dp, drho_dT);
217 const auto & dcp_dp = addFunctorProperty<Real>(
219 [
this](
const auto & r,
const auto & t) ->
Real 221 Real dcp_dp, dcp_dT, dummy;
225 _fluid.cp_from_p_T(raw_pressure, raw_T_fluid, dummy, dcp_dp, dcp_dT);
229 const auto & dcp_dT = addFunctorProperty<Real>(
231 [
this](
const auto & r,
const auto & t) ->
Real 233 Real dcp_dp, dcp_dT, dummy;
237 _fluid.cp_from_p_T(raw_pressure, raw_T_fluid, dummy, dcp_dp, dcp_dT);
241 const auto & dmu_dp = addFunctorProperty<Real>(
243 [
this](
const auto & r,
const auto & t) ->
Real 245 Real dmu_dp, dmu_dT, dummy;
249 _fluid.mu_from_p_T(raw_pressure, raw_T_fluid, dummy, dmu_dp, dmu_dT);
253 const auto & dmu_dT = addFunctorProperty<Real>(
255 [
this](
const auto & r,
const auto & t) ->
Real 257 Real dmu_dp, dmu_dT, dummy;
261 _fluid.mu_from_p_T(raw_pressure, raw_T_fluid, dummy, dmu_dp, dmu_dT);
265 const auto & dk_dp = addFunctorProperty<Real>(
267 [
this](
const auto & r,
const auto & t) ->
Real 269 Real dk_dp, dk_dT, dummy;
273 _fluid.k_from_p_T(raw_pressure, raw_T_fluid, dummy, dk_dp, dk_dT);
277 const auto & dk_dT = addFunctorProperty<Real>(
279 [
this](
const auto & r,
const auto & t) ->
Real 281 Real dk_dp, dk_dT, dummy;
285 _fluid.k_from_p_T(raw_pressure, raw_T_fluid, dummy, dk_dp, dk_dT);
293 addFunctorProperty<GenericReal<is_ad>>(
297 static constexpr
Real small_number = 1e-8;
302 addFunctorProperty<Real>(
304 [&
mu, &
cp, &
k, &dmu_dp, &dcp_dp, &dk_dp](
const auto & r,
const auto & t) ->
Real 314 addFunctorProperty<Real>(
316 [&
mu, &
cp, &
k, &dmu_dT, &dcp_dT, &dk_dT](
const auto & r,
const auto & t) ->
Real 332 const auto & Re = addFunctorProperty<GenericReal<is_ad>>(
336 static constexpr
Real small_number = 1e-8;
340 std::max(
mu(r, t), small_number)),
344 addFunctorProperty<Real>(
346 [
this, &Re, &
mu, &drho_dp, &dmu_dp](
const auto & r,
const auto & t) ->
Real 355 addFunctorProperty<Real>(
357 [
this, &Re, &
mu, &drho_dT, &dmu_dT](
const auto & r,
const auto & t) ->
Real 367 addFunctorProperty<GenericReal<is_ad>>(
371 static constexpr
Real small_number = 1e-8;
372 return Re(r, t) / std::max(1 -
_eps(r, t), small_number);
376 addFunctorProperty<GenericReal<is_ad>>(
379 {
return Re(r, t) /
_eps(r, t); });
399 addFunctorProperty<GenericReal<is_ad>>(
409 const auto &
cp = addFunctorProperty<GenericReal<is_ad>>(
419 const auto &
mu = addFunctorProperty<GenericReal<is_ad>>(
429 const auto &
k = addFunctorProperty<GenericReal<is_ad>>(
444 addFunctorProperty<GenericReal<is_ad>>(
451 Real rho, drho_dp, drho_dT;
462 addFunctorProperty<GenericReal<is_ad>>(
475 addFunctorProperty<GenericReal<is_ad>>(
482 Real dcp_dp, dcp_dT, dummy;
485 _fluid.cp_from_p_T(raw_pressure, raw_T_fluid, dummy, dcp_dp, dcp_dT);
494 const auto & drho_dp = addFunctorProperty<Real>(
496 [
this, &rho](
const auto & r,
const auto & t) ->
Real 501 Real drho_dp, drho_dT, dummy;
505 _fluid.rho_from_p_T(raw_pressure, raw_T_fluid, dummy, drho_dp, drho_dT);
509 const auto & drho_dT = addFunctorProperty<Real>(
511 [
this, &rho](
const auto & r,
const auto & t) ->
Real 516 Real drho_dp, drho_dT, dummy;
520 _fluid.rho_from_p_T(raw_pressure, raw_T_fluid, dummy, drho_dp, drho_dT);
524 const auto & dcp_dp = addFunctorProperty<Real>(
526 [
this, &rho](
const auto & r,
const auto & t) ->
Real 531 Real dcp_dp, dcp_dT, dummy;
535 _fluid.cp_from_p_T(raw_pressure, raw_T_fluid, dummy, dcp_dp, dcp_dT);
539 const auto & dcp_dT = addFunctorProperty<Real>(
541 [
this, &rho](
const auto & r,
const auto & t) ->
Real 546 Real dcp_dp, dcp_dT, dummy;
550 _fluid.cp_from_p_T(raw_pressure, raw_T_fluid, dummy, dcp_dp, dcp_dT);
554 const auto & dmu_dp = addFunctorProperty<Real>(
556 [
this, &rho](
const auto & r,
const auto & t) ->
Real 561 Real dmu_dp, dmu_dT, dummy;
565 _fluid.mu_from_p_T(raw_pressure, raw_T_fluid, dummy, dmu_dp, dmu_dT);
569 const auto & dmu_dT = addFunctorProperty<Real>(
571 [
this, &rho](
const auto & r,
const auto & t) ->
Real 576 Real dmu_dp, dmu_dT, dummy;
580 _fluid.mu_from_p_T(raw_pressure, raw_T_fluid, dummy, dmu_dp, dmu_dT);
584 const auto & dk_dp = addFunctorProperty<Real>(
586 [
this, &rho](
const auto & r,
const auto & t) ->
Real 591 Real dk_dp, dk_dT, dummy;
595 _fluid.k_from_p_T(raw_pressure, raw_T_fluid, dummy, dk_dp, dk_dT);
599 const auto & dk_dT = addFunctorProperty<Real>(
601 [
this, &rho](
const auto & r,
const auto & t) ->
Real 606 Real dk_dp, dk_dT, dummy;
610 _fluid.k_from_p_T(raw_pressure, raw_T_fluid, dummy, dk_dp, dk_dT);
618 addFunctorProperty<GenericReal<is_ad>>(
622 static constexpr
Real small_number = 1e-8;
627 addFunctorProperty<Real>(
629 [&
mu, &
cp, &
k, &dmu_dp, &dcp_dp, &dk_dp](
const auto & r,
const auto & t) ->
Real 639 addFunctorProperty<Real>(
641 [&
mu, &
cp, &
k, &dmu_dT, &dcp_dT, &dk_dT](
const auto & r,
const auto & t) ->
Real 657 const auto & Re = addFunctorProperty<GenericReal<is_ad>>(
661 static constexpr
Real small_number = 1e-8;
665 std::max(
mu(r, t), small_number)),
669 addFunctorProperty<Real>(
671 [
this, &Re, &
mu, &drho_dp, &dmu_dp](
const auto & r,
const auto & t) ->
Real 680 addFunctorProperty<Real>(
682 [
this, &Re, &
mu, &drho_dT, &dmu_dT](
const auto & r,
const auto & t) ->
Real 692 addFunctorProperty<GenericReal<is_ad>>(
696 static constexpr
Real small_number = 1e-8;
697 return Re(r, t) / std::max(1 -
_eps(r, t), small_number);
701 addFunctorProperty<GenericReal<is_ad>>(
704 {
return Re(r, t) /
_eps(r, t); });
Moose::GenericType< Real, is_ad > GenericReal
static const std::string cv
const Real _reference_pressure_value
The value of pressure at that point.
static InputParameters validParams()
const Moose::Functor< GenericReal< is_ad > > & _rho
Density as a functor, which could be from the variable set or the property.
static const std::string speed
static InputParameters validParams()
static const std::string Reynolds
Real prandtlPropertyDerivative(const Real &mu, const Real &cp, const Real &k, const Real &dmu, const Real &dcp, const Real &dk)
Computes the derivative of the Prandtl number, $Pr{ C_p}{k}$, with respect to an arbitrary variale $$...
const bool _neglect_derivatives_of_density_time_derivative
Whether to neglect the contributions to the Jacobian of the density time derivative.
const Moose::Functor< Real > & _d
Characteristic length $d$ used in computing the Reynolds number $Re=/$.
static const std::string density
static const std::string fluid
const MaterialPropertyName derivativePropertyNameFirst(const MaterialPropertyName &base, const SymbolName &c1) const
const Moose::Functor< GenericReal< is_ad > > & _pressure
variables
static const std::string total_pressure
const bool _force_define_density
A parameter to force definition of a functor material property for density.
const SinglePhaseFluidProperties & _fluid
Computes fluid properties in (P, T) formulation using functor material properties.
bool isParamValid(const std::string &name) const
static const std::string porosity
static const std::string Prandtl
static const std::string cp
const MooseFunctorName & _specific_heat_name
Name to use for the specific heat functor.
static const std::string T_fluid
const Point _reference_pressure_point
Where the static pressure rho*g*(z-z0) term is 0.
const bool _pressure_is_dynamic
Whether the input pressure is the dynamic pressure.
static const std::string mu
GeneralFunctorFluidPropsTempl(const InputParameters ¶meters)
static const std::string Reynolds_hydraulic
Common class for single phase fluid properties.
Real reynoldsPropertyDerivative(const Real &Re, const Real &rho, const Real &mu, const Real &drho, const Real &dmu)
Computes the derivative of the Reynolds number, $Re { Vd}{}$, with respect to an arbitrary variable $...
void paramError(const std::string ¶m, Args... args) const
auto reynolds(const T1 &rho, const T2 &vel, const T3 &L, const T4 &mu)
Compute Reynolds number.
const MooseFunctorName & _thermal_conductivity_name
Name to use for the thermal conductivity functor.
auto prandtl(const T1 &cp, const T2 &mu, const T3 &k)
Compute Prandtl number.
const Function & _mu_rampdown
Function to ramp down the viscosity, useful for relaxation transient.
const Moose::Functor< GenericReal< is_ad > > & _speed
bool isParamSetByUser(const std::string &nm) const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Moose::Functor< T > & getFunctor(const std::string &name)
const MooseFunctorName & _density_name
Name to use for density functor.
const Moose::FunctorBase< T > & addFunctorProperty(const std::string &name, PolymorphicLambda my_lammy, const std::set< ExecFlagType > &clearance_schedule={EXEC_ALWAYS})
registerMooseObject("NavierStokesApp", GeneralFunctorFluidProps)
static const std::string pressure
const Moose::Functor< GenericReal< is_ad > > & _T_fluid
const MooseFunctorName & _dynamic_viscosity_name
Name to use for the dynamic viscosity functor.
static const std::string k
static const std::string Reynolds_interstitial
const Point _gravity_vec
The gravity vector.
std::string time_deriv(const std::string &var)
const Moose::Functor< GenericReal< is_ad > > & _eps
Porosity.