22 "Assembles transport equation for the fluid temperature over a 1D flow path segment.");
25 "Mass flow rate in component. Takes a "
26 "scalar variable name");
29 "Fluid temperature of nominal inlet segment/component (N-1). Takes a "
30 "scalar variable name");
33 "Fluid temperature of nominal outlet segment/component (N+1). Takes a "
34 "scalar variable name");
37 "Wall temperature adjacent to fluid. Takes a "
38 "scalar variable name");
42 "Whether an explicit (previous value calculation) or implicit (current value) is used");
43 params.
addRequiredParam<MooseFunctorName>(
"reference_pressure",
"system reference pressure [Pa]");
44 params.
addRequiredParam<UserObjectName>(
"fp",
"The name of the user object for fluid properties");
45 params.
addParam<UserObjectName>(
"reference_fp",
46 "Liquid-phase fluid properties; see momentum kernel.");
47 params.
addRequiredParam<MooseFunctorName>(
"area",
"Segment/Component flow area [m^2]");
48 params.
addRequiredParam<MooseFunctorName>(
"perimeter",
"Segment/Component wetted perimeter [m]");
49 params.
addRequiredParam<MooseFunctorName>(
"length",
"Segment/Component length [m]");
51 "Heat transfer coefficient of the fluid [W/(m^2-K)]");
53 "use_fluid_node_temp",
55 "Whether to use fluid node temperature for wall heat transfer or a segment-averaged value. "
56 "Must match the setting of the coupled ADPipeInnerWallTemperatureScalarKernel so wall and "
57 "fluid exchange the same heat.");
67 getParam<UserObjectName>(
"reference_fp"))
73 _is_implicit(this->template getParam<bool>(
"is_implicit")),
74 _Pref(this->template getFunctor<
ADReal>(
"reference_pressure")),
75 _area(this->template getFunctor<
ADReal>(
"area")),
76 _perimeter(this->template getFunctor<
ADReal>(
"perimeter")),
77 _length(this->template getFunctor<
ADReal>(
"length")),
78 _h(this->template getFunctor<
ADReal>(
"heat_transfer_coefficient"))
85 ADReal energy_residual = 0;
90 const auto in = 1.0 / 2.0 * (1 -
_m[i] / sqrt(
_m[i] *
_m[i] + 1.0e-08)) *
_Tdown[i] +
91 1.0 / 2.0 * (1 +
_m[i] / sqrt(
_m[i] *
_m[i] + 1.0e-08)) *
_Tup[i];
93 const bool node_bulk = getParam<bool>(
"use_fluid_node_temp");
95 const auto P =
_Pref(arg, state);
96 const auto rho =
_fp.rho_from_p_T(
P, Tm);
97 const auto cp =
_fp.cp_from_p_T(
P, Tm);
101 const auto q =
_h(arg, state) *
_perimeter(arg, state) * (
_Tw[i] - Tm);
103 energy_residual += (
_m[i] / 2.0 * (1 -
_m[i] / sqrt(
_m[i] *
_m[i] + 1.0e-08)) *
_Tdown[i] -
104 _m[i] / 2.0 * (1 +
_m[i] / sqrt(
_m[i] *
_m[i] + 1.0e-08)) *
_Tup[i] +
108 energy_residual -= q /
_area(arg, state) /
rho / cp;
110 return energy_residual;
116 mooseError(
"Internal error, calling computeQpJacobian in AD class.");
registerMooseObject("ThermalHydraulicsApp", ADIncompressibleEnergySPScalarKernel)
DualNumber< Real, DNDerivativeType, true > ADReal
const bool _is_implicit
Property state integration flag.
const ADVariableValue & _Tdown
Coupled temperature of the downstream segment.
static InputParameters validParams()
virtual Real computeQpJacobian() override
const ADVariableValue & _Tup
Coupled temperature of the upstream segment.
const Moose::Functor< ADReal > & _Pref
System reference pressure.
ADIncompressibleEnergySPScalarKernel(const InputParameters ¶meters)
const Moose::Functor< ADReal > & _h
Heat transfer coefficient from functor material.
virtual ADReal computeQpResidual() override
const SinglePhaseFluidProperties & _fp
Fluid properties object.
const SinglePhaseFluidProperties * _fp_ref
Pure liquid fluid properties reference (for draining problems, not for multiphase flow)
const Moose::Functor< ADReal > & _length
Length of the segment.
const ADVariableValue & _Tw
Coupled temperature of the component wall.
const ADVariableValue & _m
Coupled mass flow rate through the segment.
const Moose::Functor< ADReal > & _perimeter
Wetted perimeter of the segment.
const Moose::Functor< ADReal > & _area
Flow area of the segment.
const ADVariableValue & _u
static InputParameters validParams()
void mooseError(Args &&... args) const
Common class for single phase fluid properties.