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");
40 "T_fluid_user_objects",
"Spatial user object(s) holding the fluid temperature values");
42 "htc_user_objects",
"Spatial user object(s) holding the heat transfer coefficient values");
43 params.
addParam<std::vector<UserObjectName>>(
44 "kappa_user_objects",
"Spatial user object(s) holding the wall contact fraction values");
46 params.
addRequiredParam<Point>(
"position",
"Start position of axis in 3-D space [m]");
49 "Direction of axis from start position to end position (no need to normalize)");
50 params.
addParam<
Real>(
"rotation", 0.0,
"Angle of rotation about the x-axis [degrees]");
51 params.
addRequiredParam<std::vector<Real>>(
"length",
"Length of each axial section [m]");
53 "Number of elements in each axial section");
55 params.
addRequiredParam<std::string>(
"multi_app",
"The name of the multi-app.");
58 "fixed_bounding_box_size",
59 "fixed_bounding_box_size >= 0",
60 "The 'fixed_bounding_box_size' value to use for each MultiAppGeneralFieldUserObjectTransfer. " 61 "If this parameter is not provided, a greedy search will be used instead of bounding boxes, " 62 "which may be slower.");
65 "positions",
"Sub-app positions. Each set of 3 values represents a Point.");
68 "Name of file containing sub-app positions. Each set of 3 values represents a Point.");
76 _boundary(getParam<
std::vector<BoundaryName>>(
"boundary")),
78 _T_solid_var_name(getParam<VariableName>(
"T")),
79 _T_wall_var_name(getParam<VariableName>(
"T_wall")),
80 _T_fluid_var_names(getParam<
std::vector<VariableName>>(
"T_fluid")),
81 _htc_var_names(getParam<
std::vector<VariableName>>(
"htc")),
83 _n_phases(_T_fluid_var_names.size()),
85 _T_wall_user_object_name(
name() +
"_T_avg_uo"),
86 _T_fluid_user_object_names(getParam<
std::vector<UserObjectName>>(
"T_fluid_user_objects")),
87 _htc_user_object_names(getParam<
std::vector<UserObjectName>>(
"htc_user_objects")),
89 _multi_app_name(getParam<
std::string>(
"multi_app"))
93 mooseError(
"The parameters 'T_fluid', 'htc', 'T_fluid_user_objects', and 'htc_user_objects' " 94 "must have the same numbers of elements.");
99 mooseError(
"If there is only one phase (e.g., only one element in 'T_fluid'), then the " 100 "parameters 'kappa' and 'kappa_user_objects' must not be provided.");
105 mooseError(
"If there is more than one phase (e.g., more than one element in 'T_fluid'), then " 106 "the parameters 'kappa' and 'kappa_user_objects' must be provided.");
112 mooseError(
"The parameters 'kappa' and 'kappa_user_objects' must have the same number of " 113 "elements as 'T_fluid'.");
117 const auto & orientation = getParam<RealVectorValue>(
"orientation");
119 mooseError(
"The direction given by the parameter 'orientation' must be aligned with the x, " 139 const std::string class_name =
"CoupledConvectiveHeatFluxBC";
142 params.
set<std::vector<BoundaryName>>(
"boundary") = {
_boundary};
147 _problem->addBoundaryCondition(class_name,
name() +
"_bc" + std::to_string(
k), params);
156 const std::string class_name =
"NearestPointLayeredSideAverage";
159 params.
set<std::vector<BoundaryName>>(
"boundary") = {
_boundary};
163 params.
set<std::vector<Point>>(
"points") = getParam<std::vector<Point>>(
"positions");
165 params.
set<FileName>(
"points_file") = getParam<FileName>(
"positions_file");
167 params.
set<std::vector<Point>>(
"points") = {Point(0, 0, 0)};
169 const auto & position = getParam<Point>(
"position");
170 const auto & orientation = getParam<RealVectorValue>(
"orientation");
171 const auto & rotation = getParam<Real>(
"rotation");
172 const auto & lengths = getParam<std::vector<Real>>(
"length");
173 const auto & n_elems = getParam<std::vector<unsigned int>>(
"n_elems");
177 params.
set<std::vector<Real>>(
"bounds") =
179 position, orientation, rotation, lengths, n_elems);
190 const bool skip_coordinate_collapsing = getParam<bool>(
"skip_coordinate_collapsing");
192 const bool use_bounding_boxes =
isParamValid(
"fixed_bounding_box_size");
193 std::vector<Real> fixed_bounding_box_size;
194 if (use_bounding_boxes)
195 fixed_bounding_box_size = getParam<std::vector<Real>>(
"fixed_bounding_box_size");
198 const std::string class_name =
"MultiAppGeneralFieldUserObjectTransfer";
203 params.
set<
bool>(
"skip_coordinate_collapsing") = skip_coordinate_collapsing;
204 params.
set<
bool>(
"error_on_miss") =
true;
205 if (use_bounding_boxes)
206 params.
set<std::vector<Real>>(
"fixed_bounding_box_size") = fixed_bounding_box_size;
209 params.
set<
bool>(
"use_bounding_boxes") =
false;
210 params.
set<
bool>(
"greedy_search") =
true;
212 _problem->addTransfer(class_name,
name() +
"_T_solid_transfer", params);
223 const std::string class_name =
"MultiAppGeneralFieldUserObjectTransfer";
228 params.
set<
bool>(
"skip_coordinate_collapsing") = skip_coordinate_collapsing;
229 params.
set<
bool>(
"error_on_miss") =
true;
230 if (use_bounding_boxes)
231 params.
set<std::vector<Real>>(
"fixed_bounding_box_size") = fixed_bounding_box_size;
234 params.
set<
bool>(
"use_bounding_boxes") =
false;
235 params.
set<
bool>(
"greedy_search") =
true;
237 _problem->addTransfer(class_name,
name() +
"_T_fluid_transfer" + std::to_string(
k), params);
240 const std::string class_name =
"MultiAppGeneralFieldUserObjectTransfer";
245 params.
set<
bool>(
"skip_coordinate_collapsing") = skip_coordinate_collapsing;
246 params.
set<
bool>(
"error_on_miss") =
true;
247 if (use_bounding_boxes)
248 params.
set<std::vector<Real>>(
"fixed_bounding_box_size") = fixed_bounding_box_size;
251 params.
set<
bool>(
"use_bounding_boxes") =
false;
252 params.
set<
bool>(
"greedy_search") =
true;
254 _problem->addTransfer(class_name,
name() +
"_htc_transfer" + std::to_string(
k), params);
258 const std::string class_name =
"MultiAppGeneralFieldUserObjectTransfer";
263 params.
set<
bool>(
"skip_coordinate_collapsing") = skip_coordinate_collapsing;
264 params.
set<
bool>(
"error_on_miss") =
true;
265 if (use_bounding_boxes)
266 params.
set<std::vector<Real>>(
"fixed_bounding_box_size") = fixed_bounding_box_size;
269 params.
set<
bool>(
"use_bounding_boxes") =
false;
270 params.
set<
bool>(
"greedy_search") =
true;
272 _problem->addTransfer(class_name,
name() +
"_kappa_transfer" + std::to_string(
k), params);
const std::vector< UserObjectName > _T_fluid_user_object_names
Spatial user object(s) holding the fluid temperature values.
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.
const std::vector< VariableName > _htc_var_names
Variable(s) on the solid side into which to transfer the heat transfer coefficient(s) ...
virtual void addTransfers()
Action that creates the necessary objects, for the solid side, to couple a solid heat conduction regi...
const std::string & name() const
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.
const std::vector< UserObjectName > _htc_user_object_names
Spatial user object(s) holding the heat transfer coefficient values.
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.
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.
bool isParamValid(const std::string &name) const
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