22 "Computes a normalized residual norm for the single-phase flow model.");
27 params.
addRequiredParam<FunctionName>(
"A",
"Cross-sectional area function [m^2]");
29 "Point at which to evaluate cross-sectional area function [m]");
31 "Single-phase fluid properties object");
59 const auto h_min = getParam<Real>(
"min_elem_size");
62 const auto & point = getParam<Point>(
"point");
63 const auto A_ref = A_fn.value(0.0, point);
65 const auto p_ref = getParam<Real>(
"p_ref");
66 const auto T_ref = getParam<Real>(
"T_ref");
67 const auto vel_ref = getParam<Real>(
"vel_ref");
69 const auto &
fp = getUserObject<SinglePhaseFluidProperties>(
"fluid_properties");
70 const auto rho_ref =
fp.rho_from_p_T(p_ref, T_ref);
72 const auto variable = getParam<VariableName>(
"variable");
73 if (variable ==
"rhoA")
74 return rho_ref * A_ref * h_min;
75 else if (variable ==
"rhouA")
76 return rho_ref * vel_ref * A_ref * h_min;
77 else if (variable ==
"rhoEA")
79 const auto e_ref =
fp.e_from_p_T(p_ref, T_ref);
80 const auto E_ref = e_ref + 0.5 * vel_ref * vel_ref;
81 return rho_ref * E_ref * A_ref * h_min;
84 mooseError(
"The 'variable' parameter must be one of the following: {rhoA, rhouA, rhoEA}.");
virtual PostprocessorValue getValue() const override
Computes a normalized residual norm for the mass, momentum, or energy equation for a flow channel...
const Function & getFunction(const std::string &name) const
bool _initialized
Initialized.
Real computeNormalization() const
Computes (but does not update) the normalization constant.
registerMooseObject("ThermalHydraulicsApp", Normalized1PhaseResidualNorm)
static InputParameters validParams()
Normalized1PhaseResidualNorm(const InputParameters ¶meters)
static InputParameters validParams()
virtual Real getValue() const override
virtual void initialize() override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real _normalization
Normalization constant.
void mooseError(Args &&... args) const
virtual void initialize() override