16 #include "libmesh/edge_edge2.h" 17 #include "libmesh/edge_edge3.h" 19 const std::map<std::string, FlowChannelBase::EConvHeatTransGeom>
21 {
"PIPE", PIPE}, {
"ROD_BUNDLE", ROD_BUNDLE}, {
"HEX_ROD_BUNDLE", HEX_ROD_BUNDLE}};
24 {
"STRAIGHT", STRAIGHT}, {
"CURVED", CURVED}, {
"DOWNCOMER", DOWNCOMER}};
27 {
"INTERIOR", INTERIOR}, {
"EDGE",
EDGE}, {
"CORNER",
CORNER}};
51 return stringToEnum<FlowChannelBase::EConvHeatTransGeom>(
75 params.
addRequiredParam<UserObjectName>(
"fp",
"Fluid properties user object");
77 "A",
"Area of the flow channel, can be a constant or a function");
78 params.
addParam<
Real>(
"roughness", 0.0,
"Roughness [m]");
79 params.
addParam<FunctionName>(
"f",
"Wall friction factor [-]");
82 "Convective heat transfer geometry");
85 "Pipe location within the bundle");
86 params.
addParam<
Real>(
"PoD", 1,
"Pitch-to-diameter ratio for parallel bundle heat transfer [-]");
88 "pipe_pars_transferred",
90 "Set to true if Dh, P_hf and A are going to be transferred in from an external source");
91 params.
addParam<std::vector<std::string>>(
94 "Closures object(s). This is optional since closure relations can be supplied directly by " 95 "Materials as well.");
96 params.
addParam<
bool>(
"name_multiple_ht_by_index",
98 "If true, when there are multiple heat transfer components connected to " 99 "this flow channel, use their index for naming related quantities; " 100 "otherwise, use the name of the heat transfer component.");
104 "Direction of flow channel from start position to end position (no need to normalize). For " 105 "curved flow channels, it is the (tangent) direction at the start position.");
117 _flow_model(nullptr),
118 _fp_name(getParam<UserObjectName>(
"fp")),
121 :
std::acos(_dir * _gravity_vector / (_dir.
norm() * _gravity_magnitude)) *
123 _pipe_pars_transferred(getParam<bool>(
"pipe_pars_transferred")),
124 _roughness(getParam<
Real>(
"roughness")),
126 _pipe_location(getEnumParam<
EPipeLocation>(
"pipe_location")),
127 _PoD(getParam<
Real>(
"PoD")),
128 _has_PoD(isParamValid(
"PoD")),
129 _temperature_mode(false),
130 _n_heat_transfer_connections(0)
134 std::shared_ptr<const FlowModel>
154 return getParam<FunctionName>(
"A");
169 const auto & closures_names = getParam<std::vector<std::string>>(
"closures");
170 for (
const auto & closures_name : closures_names)
200 closures->checkFlowChannel(*
this);
209 logError(
"Heat sources for a flow channel must be all of temperature type or all of heat " 226 const std::string class_name =
"SumIC";
244 std::string class_name =
"DirectionMaterial";
254 std::string class_name =
"FunctionAux";
260 const std::string aux_kernel_name =
genName(
name(),
"area_linear_aux");
265 const std::string class_name =
"ProjectionAux";
271 const std::string aux_kernel_name =
genName(
name(),
"area_aux");
289 const std::string class_name =
"SumAux";
303 const std::string class_name =
"ADWeightedAverageMaterial";
314 const std::string class_name =
"ADConstantMaterial";
327 closures->addMooseObjectsFlowChannel(*
this);
366 std::string suffix =
":";
367 if (getParam<bool>(
"name_multiple_ht_by_index"))
368 suffix += std::to_string(index + 1);
376 "Heat transfer component '", ht_name,
"' was not added to flow channel '",
name(),
"'");
383 std::vector<std::string>
static const std::string AREA_LINEAR
const FunctionName & getAreaFunctionName() const
Get the name of the function describing the flow channel area.
virtual void init() override
Initializes the component.
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.
Component1DConnection::EEndType stringToEnum(const std::string &s)
bool absoluteFuzzyEqual(const T &var1, const T2 &var2, const T3 &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
static InputParameters validParams()
std::shared_ptr< FlowModel > _flow_model
The flow model used by this flow channel.
static const std::string AREA
virtual std::shared_ptr< FlowModel > buildFlowModel()=0
EPipeLocation
Pipe location.
std::vector< VariableName > _P_hf_names
heated perimeter names for connected heat transfers
THMProblem & getTHMProblem() const
Gets the THM problem.
virtual void addMaterial(const std::string &material_name, const std::string &name, InputParameters ¶meters)
const bool & _pipe_pars_transferred
bool _temperature_mode
True if there is one or more sources specified by wall temperature.
InputParameters getValidParams(const std::string &name) const
Interface for specifying gravity at the component level.
static const std::map< std::string, EPipeType > _pipe_type_to_enum
Map of pipe type to enum.
virtual void addAuxKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
static InputParameters validParams()
void makeFunctionControllableIfConstant(const FunctionName &fn_name, const std::string &control_name, const std::string ¶m="value") const
Makes a function controllable if it is constant.
static MooseEnum getPipeType(const std::string &name)
Gets a MooseEnum for pipe type.
bool isRestarting() const
virtual const std::string & name() const
virtual std::shared_ptr< const FlowModel > getFlowModel() const
std::vector< MaterialPropertyName > _q_wall_names
wall heat flux names for connected heat transfers
ExecFlagEnum getDefaultExecFlagEnum()
void logError(Args &&... args) const
Logs an error.
virtual void check() const override
Check the component integrity.
EConvHeatTransGeom
Type of convective heat transfer geometry.
std::vector< std::string > _heat_transfer_names
Names of the heat transfer components connected to this component.
unsigned int _n_heat_transfer_connections
Number of connected heat transfer components.
const ExecFlagType EXEC_TIMESTEP_BEGIN
std::vector< std::string > getHeatTransferNames() const
Gets the names of all connected heat transfer components.
const MaterialPropertyName & getWallHeatFluxName() const
Returns wall heat flux name.
void addHeatTransferName(const std::string &ht_name) const
Adds the name of a heat transfer component to the flow channel's list.
EPipeLocation getPipeLocation() const
Gets the pipe location.
mesh set up, called primary init
virtual void init()
Initializes the component.
Base class for 1D components.
Base class for heat transfer connections.
virtual void getHeatTransferVariableNames()
Populates heat connection variable names lists.
const ExecFlagType EXEC_LINEAR
FunctionName _area_function
Function describing the flow channel area.
virtual void initSecondary()
Perform secondary initialization, which relies on init() being called for all components.
virtual void addVariables() override
std::vector< std::shared_ptr< ClosuresBase > > _closures_objects
Closures object(s)
static const std::string HEAT_FLUX_PERIMETER
virtual void addMooseObjects() override
void addSimInitialCondition(const std::string &type, const std::string &name, InputParameters params)
std::vector< VariableName > _T_wall_names
wall temperature auxvariable names for connected heat transfers
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void checkSetupStatus(const EComponentSetupStatus &status) const
Throws an error if the supplied setup status of this component has not been reached.
static const std::map< std::string, EPipeLocation > _pipe_location_to_enum
Map of pipe location to enum.
Factory & _factory
The Factory associated with the MooseApp.
static InputParameters validParams()
virtual void check() const override
Check the component integrity.
std::vector< MaterialPropertyName > _T_wall_mat_names
wall temperature material names for connected heat transfers
static const std::string HEAT_FLUX_WALL
void mooseError(Args &&... args) const
std::string getHeatTransferNamesSuffix(const std::string &ht_name) const
Gets suffix to add to heat-transfer-related names in a heat transfer component.
const VariableName & getWallTemperatureName() const
Returns wall temperature name.
FlowChannelBase(const InputParameters ¶ms)
static MooseEnum getConvHeatTransGeometry(const std::string &name)
Gets a MooseEnum for convective heat transfer geometry type.
virtual void initSecondary() override
Perform secondary initialization, which relies on init() being called for all components.
virtual const std::vector< SubdomainName > & getSubdomainNames() const
Gets the subdomain names for this component.
const VariableName & getHeatedPerimeterName() const
Returns heated perimeter name.
const MaterialPropertyName & getWallTemperatureMatName() const
Returns wall temperature name.
virtual FunctionName createAreaFunctionAndGetName()
Creates the area function if needed and then stores the name.
virtual void addCommonObjects()
Adds objects which are common for single- and two-phase flow.
virtual bool isTemperatureType() const =0
Returns whether this heat transfer is specified by temperature, rather than heat flux.
static const std::map< std::string, EConvHeatTransGeom > _heat_transfer_geom_to_enum
Map of convective heat transfer geometry type to enum.
const ExecFlagType EXEC_INITIAL