24 "Action that creates the necessary objects, for the solid side, to couple a " 25 "solid heat conduction region to a 1-D flow channel via convective heat transfer");
28 "Boundary name(s) on the solid side");
29 params.
addRequiredParam<VariableName>(
"T",
"Solid side temperature variable");
31 "T_wall",
"Variable on the flow channel side into which to transfer the solid temperature");
33 "T_fluid",
"Variable(s) on the solid side into which to transfer the fluid temperature(s)");
36 "Variable(s) on the solid side into which to transfer the heat transfer coefficient(s)");
37 params.
addParam<std::vector<VariableName>>(
38 "kappa",
"Variables on the solid side into which to transfer the wall contact fractions");
39 params.
addParam<std::vector<UserObjectName>>(
40 "T_fluid_user_objects",
"Spatial user object(s) holding the fluid temperature values");
41 params.
addParam<std::vector<UserObjectName>>(
42 "htc_user_objects",
"Spatial user object(s) holding the heat transfer coefficient values");
44 "T_fluid_user_object",
45 "Spatial user object holding the fluid temperature values",
46 "This parameter is deprecated in favor of 'T_fluid_user_objects' (just add an 's' to " 50 "Spatial user object holding the heat transfer coefficient values",
51 "This parameter is deprecated in favor of 'htc_user_objects' (just add an 's' to parameter " 53 params.
addParam<std::vector<UserObjectName>>(
54 "kappa_user_objects",
"Spatial user object(s) holding the wall contact fraction values");
60 "The direction of the layers.",
61 "The usage of 'direction' and 'num_layers' is deprecated. Use 'position', 'orientation', " 62 "'rotation', 'length', and 'n_elems' instead. The latter parameters correspond to the " 63 "parameters of the same names in the coupled flow channel component.");
66 "The number of layers.",
67 "The usage of 'direction' and 'num_layers' is deprecated. Use 'position', 'orientation', " 68 "'rotation', 'length', and 'n_elems' instead. The latter parameters correspond to the " 69 "parameters of the same names in the coupled flow channel component.");
71 params.
addParam<Point>(
"position",
"Start position of axis in 3-D space [m]");
74 "Direction of axis from start position to end position (no need to normalize)");
75 params.
addParam<
Real>(
"rotation", 0.0,
"Angle of rotation about the x-axis [degrees]");
76 params.
addParam<std::vector<Real>>(
"length",
"Length of each axial section [m]");
77 params.
addParam<std::vector<unsigned int>>(
"n_elems",
"Number of elements in each axial section");
79 params.
addRequiredParam<std::string>(
"multi_app",
"The name of the multi-app.");
82 "fixed_bounding_box_size",
83 "fixed_bounding_box_size >= 0",
84 "The 'fixed_bounding_box_size' value to use for each MultiAppGeneralFieldUserObjectTransfer. " 85 "If this parameter is not provided, a greedy search will be used instead of bounding boxes, " 86 "which may be slower.");
89 "positions",
"Sub-app positions. Each set of 3 values represents a Point.");
92 "Name of file containing sub-app positions. Each set of 3 values represents a Point.");
100 _boundary(getParam<
std::vector<BoundaryName>>(
"boundary")),
102 _T_solid_var_name(getParam<VariableName>(
"T")),
103 _T_wall_var_name(getParam<VariableName>(
"T_wall")),
104 _T_fluid_var_names(getParam<
std::vector<VariableName>>(
"T_fluid")),
105 _htc_var_names(getParam<
std::vector<VariableName>>(
"htc")),
107 _n_phases(_T_fluid_var_names.size()),
109 _T_wall_user_object_name(
name() +
"_T_avg_uo"),
111 _multi_app_name(getParam<
std::string>(
"multi_app"))
118 mooseError(
"The parameter 'T_fluid_user_objects' must be specified.");
125 mooseError(
"The parameter 'htc_user_objects' must be specified.");
129 mooseError(
"The parameters 'T_fluid', 'htc', 'T_fluid_user_objects', and 'htc_user_objects' " 130 "must have the same numbers of elements.");
135 mooseError(
"If there is only one phase (e.g., only one element in 'T_fluid'), then the " 136 "parameters 'kappa' and 'kappa_user_objects' must not be provided.");
141 mooseError(
"If there is more than one phase (e.g., more than one element in 'T_fluid'), then " 142 "the parameters 'kappa' and 'kappa_user_objects' must be provided.");
148 mooseError(
"The parameters 'kappa' and 'kappa_user_objects' must have the same number of " 149 "elements as 'T_fluid'.");
155 const auto & orientation = getParam<RealVectorValue>(
"orientation");
157 mooseError(
"The direction given by the parameter 'orientation' must be aligned with the x, " 178 const std::string class_name =
"CoupledConvectiveHeatFluxBC";
181 params.
set<std::vector<BoundaryName>>(
"boundary") = {
_boundary};
186 _problem->addBoundaryCondition(class_name,
name() +
"_bc" + std::to_string(
k), params);
195 const std::string class_name =
"NearestPointLayeredSideAverage";
198 params.
set<std::vector<BoundaryName>>(
"boundary") = {
_boundary};
202 params.
set<std::vector<Point>>(
"points") = getParam<std::vector<Point>>(
"positions");
204 params.
set<FileName>(
"points_file") = getParam<FileName>(
"positions_file");
206 params.
set<std::vector<Point>>(
"points") = {Point(0, 0, 0)};
211 params.
set<
MooseEnum>(
"direction") = getParam<MooseEnum>(
"direction");
212 params.
set<
unsigned int>(
"num_layers") = getParam<unsigned int>(
"num_layers");
217 const auto & position = getParam<Point>(
"position");
218 const auto & orientation = getParam<RealVectorValue>(
"orientation");
219 const auto & rotation = getParam<Real>(
"rotation");
220 const auto & lengths = getParam<std::vector<Real>>(
"length");
221 const auto & n_elems = getParam<std::vector<unsigned int>>(
"n_elems");
225 params.
set<std::vector<Real>>(
"bounds") =
227 position, orientation, rotation, lengths, n_elems);
231 "The parameters 'position', 'orientation', 'length', and 'n_elems' must be provided.");
242 const bool skip_coordinate_collapsing = getParam<bool>(
"skip_coordinate_collapsing");
244 const bool use_bounding_boxes =
isParamValid(
"fixed_bounding_box_size");
245 std::vector<Real> fixed_bounding_box_size;
246 if (use_bounding_boxes)
247 fixed_bounding_box_size = getParam<std::vector<Real>>(
"fixed_bounding_box_size");
250 const std::string class_name =
"MultiAppGeneralFieldUserObjectTransfer";
255 params.
set<
bool>(
"skip_coordinate_collapsing") = skip_coordinate_collapsing;
256 params.
set<
bool>(
"error_on_miss") =
true;
257 if (use_bounding_boxes)
258 params.
set<std::vector<Real>>(
"fixed_bounding_box_size") = fixed_bounding_box_size;
261 params.
set<
bool>(
"use_bounding_boxes") =
false;
262 params.
set<
bool>(
"greedy_search") =
true;
264 _problem->addTransfer(class_name,
name() +
"_T_solid_transfer", params);
275 const std::string class_name =
"MultiAppGeneralFieldUserObjectTransfer";
280 params.
set<
bool>(
"skip_coordinate_collapsing") = skip_coordinate_collapsing;
281 params.
set<
bool>(
"error_on_miss") =
true;
282 if (use_bounding_boxes)
283 params.
set<std::vector<Real>>(
"fixed_bounding_box_size") = fixed_bounding_box_size;
286 params.
set<
bool>(
"use_bounding_boxes") =
false;
287 params.
set<
bool>(
"greedy_search") =
true;
289 _problem->addTransfer(class_name,
name() +
"_T_fluid_transfer" + std::to_string(
k), params);
292 const std::string class_name =
"MultiAppGeneralFieldUserObjectTransfer";
297 params.
set<
bool>(
"skip_coordinate_collapsing") = skip_coordinate_collapsing;
298 params.
set<
bool>(
"error_on_miss") =
true;
299 if (use_bounding_boxes)
300 params.
set<std::vector<Real>>(
"fixed_bounding_box_size") = fixed_bounding_box_size;
303 params.
set<
bool>(
"use_bounding_boxes") =
false;
304 params.
set<
bool>(
"greedy_search") =
true;
306 _problem->addTransfer(class_name,
name() +
"_htc_transfer" + std::to_string(
k), params);
310 const std::string class_name =
"MultiAppGeneralFieldUserObjectTransfer";
315 params.
set<
bool>(
"skip_coordinate_collapsing") = skip_coordinate_collapsing;
316 params.
set<
bool>(
"error_on_miss") =
true;
317 if (use_bounding_boxes)
318 params.
set<std::vector<Real>>(
"fixed_bounding_box_size") = fixed_bounding_box_size;
321 params.
set<
bool>(
"use_bounding_boxes") =
false;
322 params.
set<
bool>(
"greedy_search") =
true;
324 _problem->addTransfer(class_name,
name() +
"_kappa_transfer" + std::to_string(
k), params);
virtual void addUserObjects()
CoupledHeatTransferAction(const InputParameters ¶ms)
static InputParameters validParams()
const VariableName _T_wall_var_name
Variable on the flow channel side into which to transfer the solid temperature.
virtual void act() override
const std::vector< VariableName > _T_fluid_var_names
Variable(s) on the solid side into which to transfer the fluid temperature(s)
InputParameters getValidParams(const std::string &name) const
const VariableName _T_solid_var_name
Solid side temperature variable name.
virtual const std::string & name() const
const std::vector< VariableName > _htc_var_names
Variable(s) on the solid side into which to transfer the heat transfer coefficient(s) ...
static const std::string directions[3]
bool isParamValid(const std::string &name) const
virtual void addTransfers()
Action that creates the necessary objects, for the solid side, to couple a solid heat conduction regi...
MultiAppName _multi_app_name
Name of the THM multi-app.
registerMooseAction("ThermalHydraulicsApp", CoupledHeatTransferAction, "add_bc")
static InputParameters validParams()
const unsigned int _n_phases
Number of fluid phases.
const std::string & _current_task
const UserObjectName _T_wall_user_object_name
User object name with solid temperature.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
MooseEnum getAlignmentAxis() const
Gets an axis MooseEnum for the axis the component is aligned with.
std::vector< UserObjectName > _htc_user_object_names
Spatial user object(s) holding the heat transfer coefficient values.
void mooseError(Args &&... args) const
std::shared_ptr< FEProblemBase > & _problem
static void addSkipCoordCollapsingParam(InputParameters ¶ms)
std::vector< UserObjectName > _kappa_user_object_names
Spatial user objects holding the wall contact fraction values.
std::vector< BoundaryName > _boundary
Boundary where the BC is applied.
std::vector< VariableName > _kappa_var_names
Variables on the solid side into which to transfer the wall contact fractions.
std::vector< Real > getElementBoundaryCoordinates() const
Gets the element boundary coordinates for the aligned axis.
virtual bool isValid() const override
static const std::string k
std::vector< UserObjectName > _T_fluid_user_object_names
Spatial user object(s) holding the fluid temperature values.