23 params.
addRequiredParam<std::string>(
"heat_structure_2d",
"The 2D heat structure to couple");
24 params.
addRequiredParam<std::string>(
"heat_structure_3d",
"The 3D heat structure to couple");
26 "The boundary of the 2D heat structure to couple");
28 "The boundary of the 3D heat structure to couple");
30 params.
addParam<
bool>(
"include_radiation",
true,
"Include radiation component of heat flux");
33 "Emissivity of the 2D heat structure boundary as a function of temperature [K]");
36 "Emissivity of the 3D heat structure boundary as a function of temperature [K]");
38 "Gap thickness [m] as a function of temperature [K]");
40 "gap_thermal_conductivity",
41 "Gap thermal conductivity [W/(m-K)] as a function of temperature [K]");
43 "gap_htc", 0,
"Gap heat transfer coefficient [W/(m^2-K)] as a function of temperature [K]");
45 params.
addClassDescription(
"Couples a 2D heat structure boundary to a 3D heat structure boundary " 46 "using gap heat transfer.");
54 _hs_name_2d(getParam<
std::string>(
"heat_structure_2d")),
55 _hs_name_3d(getParam<
std::string>(
"heat_structure_3d")),
56 _boundary_2d(getParam<BoundaryName>(
"boundary_2d")),
57 _boundary_3d(getParam<BoundaryName>(
"boundary_3d")),
59 _mesh_alignment(constMesh())
70 if (hasComponentByName<HeatStructureCylindricalBase>(
_hs_name_2d) &&
71 hasComponentByName<HeatStructureFromFile3D>(
_hs_name_3d))
73 const auto & hs_2d = getComponentByName<HeatStructureCylindricalBase>(
_hs_name_2d);
74 const auto & hs_3d = getComponentByName<HeatStructureFromFile3D>(
_hs_name_3d);
82 hs_2d.getDirection());
101 if (getParam<bool>(
"include_radiation"))
104 logError(
"If 'include_radiation' is 'true', then 'emissivity_2d' and 'emissivity_3d' are " 110 logError(
"If 'include_radiation' is 'false', then neither 'emissivity_2d' nor " 111 "'emissivity_3d' can be specified.");
114 if (hasComponentByName<HeatStructureCylindricalBase>(
_hs_name_2d))
116 const auto & hs = getComponentByName<HeatStructureCylindricalBase>(
_hs_name_2d);
120 "' does not have the boundary '",
127 if (hasComponentByName<HeatStructureFromFile3D>(
_hs_name_3d))
129 const auto & hs = getComponentByName<HeatStructureFromFile3D>(
_hs_name_3d);
133 "' does not have the boundary '",
140 if (hasComponentByName<HeatStructureCylindricalBase>(
_hs_name_2d) &&
141 hasComponentByName<HeatStructureFromFile3D>(
_hs_name_3d) &&
143 logError(
"The meshes of the heat structures are not aligned.");
146 if (MOOSE_AD_MAX_DOFS_PER_ELEM < needed_ad_container_size)
147 logError(
"MOOSE must be configured with a larger AD container size (>= ",
148 needed_ad_container_size,
149 "). See HSCoupler2D3D's documentation for more information.");
156 const UserObjectName temperature_2d_uo_name =
genName(
name(),
"2d_uo");
158 const std::string class_name =
"StoreVariableByElemIDSideUserObject";
164 params.
set<
int>(
"execution_order_group") = -1;
169 const auto & hs_2d = getComponentByName<HeatStructureCylindricalBase>(
_hs_name_2d);
170 const auto radius_2d = hs_2d.getInnerRadius() + hs_2d.getTotalWidth();
173 const UserObjectName hs_coupler_2d3d_uo_name =
genName(
name(),
"3d_uo");
175 const std::string class_name =
"HSCoupler2D3DUserObject";
179 params.
set<
Real>(
"radius_2d") = radius_2d;
180 if (getParam<bool>(
"include_radiation"))
182 params.
set<FunctionName>(
"emissivity_2d") = getParam<FunctionName>(
"emissivity_2d");
183 params.
set<FunctionName>(
"emissivity_3d") = getParam<FunctionName>(
"emissivity_3d");
185 params.
set<FunctionName>(
"gap_thickness") = getParam<FunctionName>(
"gap_thickness");
186 params.
set<FunctionName>(
"gap_thermal_conductivity") =
187 getParam<FunctionName>(
"gap_thermal_conductivity");
188 params.
set<FunctionName>(
"gap_htc") = getParam<FunctionName>(
"gap_htc");
189 params.
set<UserObjectName>(
"temperature_2d_uo") = temperature_2d_uo_name;
197 const std::string class_name =
"HSCoupler2D3DBC";
201 params.
set<UserObjectName>(
"hs_coupler_2d3d_uo") = hs_coupler_2d3d_uo_name;
207 const std::string class_name =
"HSCoupler2D3DBC";
211 params.
set<UserObjectName>(
"hs_coupler_2d3d_uo") = hs_coupler_2d3d_uo_name;
MeshAlignment2D3D _mesh_alignment
Mesh alignment.
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.
void initialize(const std::vector< std::tuple< dof_id_type, unsigned short int >> &primary_boundary_info, const std::vector< std::tuple< dof_id_type, unsigned short int >> &secondary_boundary_info, const Point &axis_point, const RealVectorValue &axis_direction)
Extracts mesh information and builds the mapping.
static InputParameters validParams()
const std::string & _hs_name_3d
3D heat structure name
virtual void setupMesh()
Performs mesh setup such as creating mesh or naming mesh sets.
THMProblem & getTHMProblem() const
Gets the THM problem.
void addDependency(const std::string &dependency)
Adds a component name to the list of dependencies.
bool hasCoupledPrimaryElemID(const dof_id_type &secondary_elem_id) const
Returns true if the given secondary element ID has a coupled primary element.
InputParameters getValidParams(const std::string &name) const
Couples a 2D heat structure boundary to a 3D heat structure boundary using gap heat transfer...
Base class for components of a boundary type.
static InputParameters validParams()
virtual void check() const override
Check the component integrity.
virtual const std::string & name() const
bool meshesAreAligned() const
Returns true if the primary and secondary meshes are aligned.
const std::string & _hs_name_2d
2D heat structure name
virtual void addBoundaryCondition(const std::string &bc_name, const std::string &name, InputParameters ¶meters)
void logError(Args &&... args) const
Logs an error.
bool isParamValid(const std::string &name) const
const BoundaryName & _boundary_2d
2D heat structure boundary
virtual void check() const
Check the component integrity.
static const std::string TEMPERATURE
virtual void addMooseObjects() override
const std::vector< dof_id_type > & getSecondaryElemIDs() const
Returns the list of element IDs on the secondary boundary.
const ExecFlagType EXEC_LINEAR
HSCoupler2D3D(const InputParameters ¶meters)
registerMooseObject("ThermalHydraulicsApp", HSCoupler2D3D)
const ExecFlagType EXEC_NONLINEAR
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Factory & _factory
The Factory associated with the MooseApp.
virtual std::vector< std::shared_ptr< UserObject > > addUserObject(const std::string &user_object_name, const std::string &name, InputParameters ¶meters)
dof_id_type getCoupledPrimaryElemID(const dof_id_type &secondary_elem_id) const
Gets the coupled primary element ID for a given secondary element ID.
unsigned int getMaxCouplingSize() const
Gets the maximum number of secondary elements coupled to any primary element.
virtual void setupMesh() override
Performs mesh setup such as creating mesh or naming mesh sets.
Builds mapping between a 2D boundary and a 3D boundary.
virtual void augmentSparsity(const dof_id_type &elem_id1, const dof_id_type &elem_id2)
Hint how to augment sparsity pattern between two elements.
const BoundaryName & _boundary_3d
3D heat structure boundary
const ExecFlagType EXEC_INITIAL