24 params.
addParam<std::vector<FunctionName>>(
27 "Initial passive transport variable values in the flow channel, if any (units are "
28 "[amount/m^3], where 'amount' may be mass (kg) or a number (molecules, moles, etc.))");
29 params.
addParam<std::vector<VariableName>>(
32 "Names for each passive transport variable [amount/m^3]. Note that the conserved (solution) "
33 "variables will be an amount per unit volume multiplied by the channel cross-sectional area, "
34 "yielding an amount per unit length; these solution variable names will append '_times_area' "
35 "to the names given in this parameter.");
37 MooseEnum wave_speed_formulation(
"einfeldt davis",
"einfeldt");
39 "wave_speed_formulation", wave_speed_formulation,
"Method for computing wave speeds");
41 std::vector<Real> sf_1phase(3, 1.0);
43 "scaling_factor_1phase",
45 "Scaling factors for each single phase variable (rhoA, rhouA, rhoEA)");
46 params.
addParam<std::vector<Real>>(
"scaling_factor_passives",
47 "Scaling factor for each passive transport variable");
51 "If true, create a VectorPostprocessor with the the mass, momentum, and energy side fluxes");
53 params.
addParam<Real>(
"p_rel_step_tol", 1e-5,
"Pressure relative step tolerance");
54 params.
addParam<Real>(
"T_rel_step_tol", 1e-5,
"Temperature relative step tolerance");
55 params.
addParam<Real>(
"vel_rel_step_tol", 1e-5,
"Velocity relative step tolerance");
56 params.
addParam<Real>(
"mass_res_tol", 1e-5,
"Mass equation normalized residual tolerance");
58 "momentum_res_tol", 1e-5,
"Momentum equation normalized residual tolerance");
59 params.
addParam<Real>(
"energy_res_tol", 1e-5,
"Energy equation normalized residual tolerance");
76 checkEqualSize<VariableName, FunctionName>(
"passives_names",
"initial_passives");
78 checkEqualSize<VariableName, Real>(
"passives_names",
"scaling_factor_passives");
86 logError(
"Supplied fluid properties must be for 1-phase fluids.");
92 return "FlowModelSinglePhase";
95std::vector<std::string>
98 return {
"initial_p",
"initial_T",
"initial_vel"};
106 if (getParam<bool>(
"create_flux_vpp"))
111 const std::vector<std::pair<std::string, Real>> var_norm_pairs{
115 for (
const auto & [var, norm] : var_norm_pairs)
118 THM::functorMaterialPropertyName<false>(var), var +
"_change",
false);
123 const std::vector<std::pair<std::string, std::string>> var_eq_pairs{
125 for (
const auto & [var, eq] : var_eq_pairs)
135 {
"step: p",
"step: T",
"step: vel",
"res: mass",
"res: momentum",
"res: energy"},
136 {getParam<Real>(
"p_rel_step_tol"),
137 getParam<Real>(
"T_rel_step_tol"),
138 getParam<Real>(
"vel_rel_step_tol"),
139 getParam<Real>(
"mass_res_tol"),
140 getParam<Real>(
"momentum_res_tol"),
141 getParam<Real>(
"energy_res_tol")});
147 const std::string class_name =
"NumericalFlux3EqnInternalValues";
152 params.
set<std::string>(
"sort_by") =
sortBy();
160 const std::string class_name =
"FlowModel1PhaseFunctorMaterial";
161 const std::string obj_name =
genName(
name(),
"fm1phase_fmat");
164 params.
set<UserObjectName>(
"fluid_properties") =
_fp_name;
170 const std::string & equation)
172 const std::string class_name =
"Normalized1PhaseResidualNorm";
175 params.
set<VariableName>(
"variable") = variable;
179 params.
set<Point>(
"point") = mid_point;
180 params.
set<UserObjectName>(
"fluid_properties") =
_fp_name;
183 params.
set<std::vector<OutputName>>(
"outputs") = {
"none"};
registerMooseObject("ThermalHydraulicsApp", FlowChannel1Phase)
const ExecFlagType EXEC_TIMESTEP_END
const ExecFlagType EXEC_INITIAL
const ExecFlagType EXEC_NONLINEAR_CONVERGENCE
std::string sortBy() const
virtual const std::vector< SubdomainName > & getSubdomainNames() const
Gets the subdomain names for this component.
void logError(Args &&... args) const
Logs an error.
void addMaximumFunctorPostprocessor(const std::string &functor_name, const std::string &pp_name, const Real normalization, const std::vector< SubdomainName > &subdomains)
Adds a Postprocessor to compute the maximum of a functor over some domain.
THMProblem & getTHMProblem() const
Gets the THM problem.
Factory & _factory
The Factory associated with the MooseApp.
std::string nonlinearConvergenceName() const
Nonlinear Convergence name.
void addNonlinearStepFunctorMaterial(const std::string &functor_name, const std::string &property, bool functor_is_ad)
Adds a functor material to compute the absolute value of the change (step) of some functor between no...
void addMultiPostprocessorConvergence(const std::vector< PostprocessorName > &postprocessors, const std::vector< std::string > &descriptions, const std::vector< Real > &tolerances)
Adds a MultiPostprocessorConvergence for nonlinear convergence for the component.
Point getStartPoint() const
Real getMinimumElemSize() const
Gets the minimum element size.
Point getEndPoint() const
T & getUserObject(const std::string &name, unsigned int tid=0) const
virtual void addVectorPostprocessor(const std::string &pp_name, const std::string &name, InputParameters ¶meters)
virtual Convergence & getConvergence(const std::string &name, const THREAD_ID tid=0) const
virtual void addPostprocessor(const std::string &pp_name, const std::string &name, InputParameters ¶meters)
virtual void addFunctorMaterial(const std::string &functor_material_name, const std::string &name, InputParameters ¶meters)
InputParameters getValidParams(const std::string &name) const
Base class for single-phase flow channels.
virtual void addMooseObjects() override
const UserObjectName _numerical_flux_name
Numerical flux user object name.
virtual void check() const override
Check the component integrity.
static InputParameters validParams()
Single-component, single-phase flow channel.
virtual void checkFluidProperties() const override
Logs an error if the fluid properties is not valid.
void addNormalized1PhaseResidualNorm(const VariableName &variable, const std::string &equation)
Adds a residual norm Postprocessor.
FlowChannel1Phase(const InputParameters ¶ms)
static InputParameters validParams()
virtual Convergence * getNonlinearConvergence() const override
Gets the Component's nonlinear Convergence object if it has one.
virtual std::string flowModelClassName() const override
Returns the flow model class name.
void addFlowChannel1PhaseFunctorMaterial()
Adds the functor material for the flow channel.
virtual void addMooseObjects() override
virtual void check() const override
Check the component integrity.
virtual std::vector< std::string > ICParameters() const override
Returns the names of the IC parameters.
void addNumericalFluxVectorPostprocessor()
const UserObjectName & _fp_name
Name of fluid properties user object.
const InputParameters & parameters() const
bool isParamValid(const std::string &name) const
std::string genName(const std::string &prefix, unsigned int id, const std::string &suffix="") const
Build a name from a prefix, number and possible suffix.
Common class for single phase fluid properties.
static const std::string RHOEA
static const std::string AREA_LINEAR
static const std::string TEMPERATURE
static const std::string VELOCITY
static const std::string RHOUA
static const std::string PRESSURE
static const std::string RHOA