21 params.
addRequiredParam<std::string>(
"power",
"Component that provides total power");
23 "power_fraction", 1.,
"Fraction of the total power that goes into the heat structure [-]");
24 params.
addParam<FunctionName>(
"power_shape_function",
"Axial power shape [-]");
32 _power_fraction(getParam<Real>(
"power_fraction")),
33 _has_psf(isParamValid(
"power_shape_function")),
34 _power_shape_func(_has_psf ? getParam<FunctionName>(
"power_shape_function") :
"")
36 checkSizeGreaterThan<std::string>(
"regions", 0);
44 if (hasComponent<TotalPowerBase>(
"power"))
56 checkComponentOfTypeExists<TotalPowerBase>(
"power");
80 const bool is_cylindrical = hs_cyl !=
nullptr;
83 const bool is_plate = hs_plate !=
nullptr;
88 std::string class_name =
"ConstantFunction";
90 pars.
set<Real>(
"value") = 1. / length;
94 const std::string power_shape_integral_name =
_has_psf
99 const std::string class_name =
100 is_cylindrical ?
"FunctionElementIntegralRZ" :
"FunctionElementIntegral";
110 pars.
set<std::vector<OutputName>>(
"outputs") = {
"none"};
115 const std::string class_name =
116 is_cylindrical ?
"ADHeatStructureHeatSourceRZ" :
"ADHeatStructureHeatSource";
120 pars.
set<Real>(
"num_units") = n_units;
123 pars.
set<std::vector<VariableName>>(
"total_power") =
134 pars.
set<Real>(
"scale") = 1.0 / hs_plate->
getDepth();
136 pars.
set<PostprocessorName>(
"power_shape_integral_pp") = power_shape_integral_name;
registerMooseObject("ThermalHydraulicsApp", HeatSourceFromTotalPower)
const ExecFlagType EXEC_INITIAL
virtual void init()
Initializes the component.
THMProblem & getTHMProblem() const
Gets the THM problem.
Factory & _factory
The Factory associated with the MooseApp.
void connectObject(const InputParameters &obj_params, const std::string &obj_name, const std::string ¶m) const
Connects a controllable parameter of the component to a controllable parameter of a constituent objec...
virtual Real getLength() const
virtual RealVectorValue getDirection() const
virtual Point getPosition() const
virtual void addFunction(const std::string &type, const std::string &name, InputParameters ¶meters)
virtual void addPostprocessor(const std::string &pp_name, const std::string &name, InputParameters ¶meters)
virtual void addKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
InputParameters getValidParams(const std::string &name) const
static const std::string TEMPERATURE
Base class for heat source components.
std::vector< SubdomainName > _subdomain_names
Names of the heat structure subdomains corresponding to the given regions.
static InputParameters validParams()
virtual void check() const override
Check the component integrity.
Heat generation from total power.
virtual void init() override
Initializes the component.
HeatSourceFromTotalPower(const InputParameters ¶meters)
FunctionName _power_shape_func
The name of the power shape function.
static InputParameters validParams()
virtual void addMooseObjects() override
const bool _has_psf
true if power shape function is being used
const Real & _power_fraction
The fraction of the power that goes into the heat structure.
virtual void check() const override
Check the component integrity.
VariableName _power_var_name
The name of the variable that represents total power.
Base class for 2D generated heat structures.
Real getNumberOfUnits() const
Gets the number of units that heat structure represents.
Base class for cylindrical heat structure components.
Interface class for heat structure components.
Component to model plate heat structure.
const Real & getDepth() const
Gets the depth of the plate.
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.
Base class for components that provide total power.
virtual const VariableName & getPowerVariableName() const