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]");
46 "symmetry_factor>=1.0",
47 "Azimuthal symmetry correction factor (>= 1.0). Equal to 2*pi " 48 "divided by the azimuthal angle covered by the 3D mesh.");
50 params.
addClassDescription(
"Couples a 2D heat structure boundary to a 3D heat structure boundary " 51 "using gap heat transfer.");
59 _hs_name_2d(getParam<
std::string>(
"heat_structure_2d")),
60 _hs_name_3d(getParam<
std::string>(
"heat_structure_3d")),
61 _boundary_2d(getParam<BoundaryName>(
"boundary_2d")),
62 _boundary_3d(getParam<BoundaryName>(
"boundary_3d")),
63 _symmetry_factor(getParam<
Real>(
"symmetry_factor")),
65 _mesh_alignment(constMesh())
76 if (hasComponentByName<HeatStructureCylindricalBase>(
_hs_name_2d) &&
77 hasComponentByName<HeatStructureFromFile3D>(
_hs_name_3d))
79 const auto & hs_2d = getComponentByName<HeatStructureCylindricalBase>(
_hs_name_2d);
80 const auto & hs_3d = getComponentByName<HeatStructureFromFile3D>(
_hs_name_3d);
88 hs_2d.getDirection());
107 if (getParam<bool>(
"include_radiation"))
110 logError(
"If 'include_radiation' is 'true', then 'emissivity_2d' and 'emissivity_3d' are " 116 logError(
"If 'include_radiation' is 'false', then neither 'emissivity_2d' nor " 117 "'emissivity_3d' can be specified.");
120 if (hasComponentByName<HeatStructureCylindricalBase>(
_hs_name_2d))
122 const auto & hs = getComponentByName<HeatStructureCylindricalBase>(
_hs_name_2d);
126 "' does not have the boundary '",
133 if (hasComponentByName<HeatStructureFromFile3D>(
_hs_name_3d))
135 const auto & hs = getComponentByName<HeatStructureFromFile3D>(
_hs_name_3d);
139 "' does not have the boundary '",
146 if (hasComponentByName<HeatStructureCylindricalBase>(
_hs_name_2d) &&
147 hasComponentByName<HeatStructureFromFile3D>(
_hs_name_3d) &&
149 logError(
"The meshes of the heat structures are not aligned.");
152 if (MOOSE_AD_MAX_DOFS_PER_ELEM < needed_ad_container_size)
153 logError(
"MOOSE must be configured with a larger AD container size (>= ",
154 needed_ad_container_size,
155 "). See HSCoupler2D3D's documentation for more information.");
162 const UserObjectName temperature_2d_uo_name =
genName(
name(),
"2d_uo");
164 const std::string class_name =
"StoreVariableByElemIDSideUserObject";
170 params.
set<
int>(
"execution_order_group") = -1;
175 const auto & hs_2d = getComponentByName<HeatStructureCylindricalBase>(
_hs_name_2d);
176 const auto radius_2d = hs_2d.getInnerRadius() + hs_2d.getTotalWidth();
179 const UserObjectName hs_coupler_2d3d_uo_name =
genName(
name(),
"3d_uo");
181 const std::string class_name =
"HSCoupler2D3DUserObject";
185 params.
set<
Real>(
"radius_2d") = radius_2d;
187 if (getParam<bool>(
"include_radiation"))
189 params.
set<FunctionName>(
"emissivity_2d") = getParam<FunctionName>(
"emissivity_2d");
190 params.
set<FunctionName>(
"emissivity_3d") = getParam<FunctionName>(
"emissivity_3d");
192 params.
set<FunctionName>(
"gap_thickness") = getParam<FunctionName>(
"gap_thickness");
193 params.
set<FunctionName>(
"gap_thermal_conductivity") =
194 getParam<FunctionName>(
"gap_thermal_conductivity");
195 params.
set<FunctionName>(
"gap_htc") = getParam<FunctionName>(
"gap_htc");
196 params.
set<UserObjectName>(
"temperature_2d_uo") = temperature_2d_uo_name;
204 const std::string class_name =
"HSCoupler2D3DBC";
208 params.
set<UserObjectName>(
"hs_coupler_2d3d_uo") = hs_coupler_2d3d_uo_name;
214 const std::string class_name =
"HSCoupler2D3DBC";
218 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.
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.
const BoundaryName & _boundary_2d
2D heat structure boundary
virtual void check() const
Check the component integrity.
const std::string & name() const
static const std::string TEMPERATURE
const Real _symmetry_factor
Symmetry reduction factor.
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.
bool isParamValid(const std::string &name) const
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