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");
85 if (dynamic_cast<const SinglePhaseFluidProperties *>(&
fp) ==
nullptr)
86 logError(
"Supplied fluid properties must be for 1-phase fluids.");
92 return "FlowModelSinglePhase";
95 std::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"};
virtual void checkFluidProperties() const override
Logs an error if the fluid properties is not valid.
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.
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.
const ExecFlagType EXEC_NONLINEAR_CONVERGENCE
static const std::string RHOEA
std::string sortBy() const
T & getUserObject(const std::string &name, unsigned int tid=0) const
FlowChannel1Phase(const InputParameters ¶ms)
virtual void addMooseObjects() override
THMProblem & getTHMProblem() const
Gets the THM problem.
virtual void check() const override
Check the component integrity.
const InputParameters & parameters() const
void addNormalized1PhaseResidualNorm(const VariableName &variable, const std::string &equation)
Adds a residual norm Postprocessor.
InputParameters getValidParams(const std::string &name) const
virtual void addFunctorMaterial(const std::string &functor_material_name, const std::string &name, InputParameters ¶meters)
const ExecFlagType EXEC_TIMESTEP_END
static const std::string TEMPERATURE
virtual void check() const override
Check the component integrity.
registerMooseObject("ThermalHydraulicsApp", FlowChannel1Phase)
void logError(Args &&... args) const
Logs an error.
static const std::string AREA_LINEAR
const UserObjectName _numerical_flux_name
Numerical flux user object name.
virtual void addPostprocessor(const std::string &pp_name, const std::string &name, InputParameters ¶meters)
static const std::string PRESSURE
const std::string & name() const
Single-component, single-phase flow channel.
virtual Convergence & getConvergence(const std::string &name, const THREAD_ID tid=0) const
Point getEndPoint() const
virtual std::string flowModelClassName() const override
Returns the flow model class name.
virtual void addVectorPostprocessor(const std::string &pp_name, const std::string &name, InputParameters ¶meters)
std::string nonlinearConvergenceName() const
Nonlinear Convergence name.
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. ...
virtual void addMooseObjects() override
static const std::string VELOCITY
void addNumericalFluxVectorPostprocessor()
const UserObjectName & _fp_name
Name of fluid properties user object.
Point getStartPoint() const
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
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...
static InputParameters validParams()
Factory & _factory
The Factory associated with the MooseApp.
void addFlowChannel1PhaseFunctorMaterial()
Adds the functor material for the flow channel.
bool isParamValid(const std::string &name) const
static const std::string RHOUA
virtual const std::vector< SubdomainName > & getSubdomainNames() const
Gets the subdomain names for this component.
virtual std::vector< std::string > ICParameters() const override
Returns the names of the IC parameters.
Base class for single-phase flow channels.
static const std::string RHOA
Real getMinimumElemSize() const
Gets the minimum element size.
virtual Convergence * getNonlinearConvergence() const override
Gets the Component's nonlinear Convergence object if it has one.
const ExecFlagType EXEC_INITIAL