14 #include "libmesh/string_to_enum.h" 33 "Action that controls the creation of all of the necessary objects for " 34 "calculation of heat transfer through an open/closed gap using a mortar formulation and a " 35 "modular design approach");
39 "Scaling factor to apply to the thermal Lagrange multiplier variable");
45 params.addParam<
bool>(
46 "correct_edge_dropping",
48 "Whether to enable correct edge dropping treatment for mortar constraints. When disabled " 49 "any Lagrange Multiplier degree of freedom on a secondary element without full primary " 50 "contributions will be set (strongly) to 0.");
52 params.makeParamNotRequired<SubdomainName>(
"primary_subdomain");
53 params.makeParamNotRequired<SubdomainName>(
"secondary_subdomain");
54 params.makeParamNotRequired<
Real>(
"gap_conductivity");
59 params.addParam<std::vector<UserObjectName>>(
60 "user_created_gap_flux_models",
62 "The name of the user objects created by the user to represent gap heat transfer physics");
64 params.addParamNamesToGroup(
"primary_subdomain secondary_subdomain",
"Gap surface definition");
65 params.addParamNamesToGroup(
"gap_flux_options user_created_gap_flux_models",
"Gap flux models");
66 params.addParamNamesToGroup(
"thermal_lm_scaling correct_edge_dropping",
67 "Thermal Lagrange multiplier");
74 _user_provided_mortar_meshes(false),
75 _user_provided_gap_flux_models(
76 getParam<
std::vector<UserObjectName>>(
"user_created_gap_flux_models").size() > 0 ? true
83 "Either create user objects for the action in the input file or provide the desire physics " 84 "to the action via the gap_flux_options parameter. Mixed use is not supported");
86 for (
unsigned int i = 0; i < getParam<MultiMooseEnum>(
"gap_flux_options").size(); i++)
87 _gap_flux_models.push_back(static_cast<MortarGapHeatTransfer::UserObjectToBuild>(
88 getParam<MultiMooseEnum>(
"gap_flux_options").get(i)));
92 const unsigned int conduction_build_uos =
96 const unsigned int radiation_build_uos =
101 if (conduction_build_uos > 1 || radiation_build_uos > 1)
103 "You cannot choose to have more than one conduction or more than one radiation user " 104 "objects when they are built by the action. If you want to superimpose multiple " 105 "physics, you can choose to create your own user objects and pass them to this " 106 "action via 'user_created_gap_flux_models'");
111 mooseInfo(
"Mortar gap heat transfer action is using the lower-dimensional domains provided by " 116 mooseInfo(
"Mortar gap heat transfer action is creating new lower-dimensional domains");
120 "User decided to create user objects to model physics for the mortar gap heat transfer " 121 "action independently, i.e. not through the mortar gap heat transfer action.");
123 mooseInfo(
"The mortar gap heat transfer action will add gap heat transfer physics according to " 124 "the gap_flux_options input parameter");
126 const bool wrong_parameters_provided =
135 if (wrong_parameters_provided)
137 "user_created_gap_flux_models",
138 "The mortar gap heat transfer action requires that the input file defines user objects " 139 "with physics or adds physics parameters directly into the action. You have provided both " 140 "user objects and physics parameters (e.g. emissivities, gap conductance, etc.).");
164 const MeshGeneratorName primary_name = action_name +
"_primary_subdomain" +
"_generator";
165 const MeshGeneratorName secondary_name = action_name +
"_secondary_subdomain" +
"_generator";
170 primary_params.
set<SubdomainName>(
"new_block_name") = action_name +
"_primary_subdomain";
171 secondary_params.set<SubdomainName>(
"new_block_name") = action_name +
"_secondary_subdomain";
173 primary_params.set<std::vector<BoundaryName>>(
"sidesets") = {
174 getParam<BoundaryName>(
"primary_boundary")};
175 secondary_params.set<std::vector<BoundaryName>>(
"sidesets") = {
176 getParam<BoundaryName>(
"secondary_boundary")};
190 params.set<
bool>(
"use_displaced_mesh") = getParam<bool>(
"use_displaced_mesh");
191 params.set<BoundaryName>(
"primary_boundary") = getParam<BoundaryName>(
"primary_boundary");
192 params.set<BoundaryName>(
"secondary_boundary") = getParam<BoundaryName>(
"secondary_boundary");
196 params.set<SubdomainName>(
"primary_subdomain") = getParam<SubdomainName>(
"primary_subdomain");
197 params.set<SubdomainName>(
"secondary_subdomain") =
198 getParam<SubdomainName>(
"secondary_subdomain");
202 params.set<SubdomainName>(
"primary_subdomain") = action_name +
"_primary_subdomain";
203 params.set<SubdomainName>(
"secondary_subdomain") = action_name +
"_secondary_subdomain";
216 const std::string &
temperature = getParam<std::vector<VariableName>>(
"temperature")[0];
220 mooseError(
"Temperature variable is missing");
222 const auto primal_type =
224 const int lm_order = primal_type.order.get_order();
227 mooseError(
"The mortar thermal action can only be used with LAGRANGE finite elements");
229 params.
set<
MooseEnum>(
"family") = Utility::enum_to_string<FEFamily>(primal_type.family);
233 params.
set<std::vector<SubdomainName>>(
"block") = {
234 getParam<SubdomainName>(
"secondary_subdomain")};
236 params.
set<std::vector<SubdomainName>>(
"block") = {action_name +
"_secondary_subdomain"};
238 params.
set<std::vector<Real>>(
"scaling") = {getParam<Real>(
"thermal_lm_scaling")};
242 _problem->addVariable(var_type, action_name +
"_thermal_lm", params);
254 params.
set<
bool>(
"use_displaced_mesh") =
true;
256 params.
set<BoundaryName>(
"primary_boundary") = getParam<BoundaryName>(
"primary_boundary");
257 params.
set<BoundaryName>(
"secondary_boundary") = getParam<BoundaryName>(
"secondary_boundary");
261 params.
set<SubdomainName>(
"primary_subdomain") = getParam<SubdomainName>(
"primary_subdomain");
262 params.
set<SubdomainName>(
"secondary_subdomain") =
263 getParam<SubdomainName>(
"secondary_subdomain");
267 params.
set<SubdomainName>(
"primary_subdomain") = action_name +
"_primary_subdomain";
268 params.
set<SubdomainName>(
"secondary_subdomain") = action_name +
"_secondary_subdomain";
271 params.
set<NonlinearVariableName>(
"variable") = action_name +
"_thermal_lm";
273 params.
set<VariableName>(
"secondary_variable") =
274 getParam<std::vector<VariableName>>(
"temperature")[0];
278 std::vector<UserObjectName> uoname_strings(0);
283 uoname_strings.push_back(
"gap_flux_model_conduction_object_" +
286 uoname_strings.push_back(
"gap_flux_model_radiation_object_" +
290 params.
set<std::vector<UserObjectName>>(
"gap_flux_models") = uoname_strings;
293 params.
set<std::vector<UserObjectName>>(
"gap_flux_models") =
294 getParam<std::vector<UserObjectName>>(
"user_created_gap_flux_models");
297 "ModularGapConductanceConstraint", action_name +
"_ModularGapConductanceConstraint", params);
320 mooseAssert(
_problem,
"Problem pointer is null");
322 if (!
_problem->isSNESMFReuseBaseSetbyUser())
323 _problem->setSNESMFReuseBase(
false,
false);
331 var_params.
set<std::vector<VariableName>>(
"temperature") =
332 getParam<std::vector<VariableName>>(
"temperature");
333 var_params.set<
Real>(
"gap_conductivity") = getParam<Real>(
"gap_conductivity");
336 var_params.set<FunctionName>(
"gap_conductivity_function") =
337 getParam<FunctionName>(
"gap_conductivity_function");
340 var_params.set<std::vector<VariableName>>(
"gap_conductivity_function_variable") =
341 getParam<std::vector<VariableName>>(
"gap_conductivity_function_variable");
343 var_params.set<
Real>(
"min_gap") = getParam<Real>(
"min_gap");
344 var_params.set<
unsigned int>(
"min_gap_order") = getParam<unsigned int>(
"min_gap_order");
346 var_params.set<std::vector<BoundaryName>>(
"boundary") =
347 getParam<std::vector<BoundaryName>>(
"boundary");
349 var_params.set<
bool>(
"use_displaced_mesh") =
true;
351 _problem->addUserObject(
"GapFluxModelConduction",
360 var_params.
set<
Real>(
"stefan_boltzmann") = getParam<Real>(
"stefan_boltzmann");
361 var_params.set<
Real>(
"primary_emissivity") = getParam<Real>(
"primary_emissivity");
362 var_params.set<
Real>(
"secondary_emissivity") = getParam<Real>(
"secondary_emissivity");
364 var_params.set<std::vector<BoundaryName>>(
"boundary") =
365 getParam<std::vector<BoundaryName>>(
"boundary");
367 var_params.set<std::vector<VariableName>>(
"temperature") =
368 getParam<std::vector<VariableName>>(
"temperature");
370 var_params.set<
bool>(
"use_displaced_mesh") =
true;
372 _problem->addUserObject(
"GapFluxModelRadiation",
bool isUltimateMaster() const
std::vector< MortarGapHeatTransfer::UserObjectToBuild > _gap_flux_models
static InputParameters validParams()
registerMooseAction("HeatTransferApp", MortarGapHeatTransferAction, "append_mesh_generator")
void mooseInfo(Args &&... args) const
InputParameters getValidParams(const std::string &name) const
static InputParameters validParams()
static const std::string temperature
static InputParameters validParams()
virtual const std::string & name() const
virtual void addConstraints()
std::string shortName(const std::string &name)
static InputParameters validParams()
bool isParamValid(const std::string &name) const
static InputParameters validParams()
virtual void addMortarVariable()
const T & getParam(const std::string &name) const
const std::string & _current_task
virtual void addMortarMesh()
bool _user_provided_mortar_meshes
const MooseMesh * masterMesh() const
static std::string variableType(const libMesh::FEType &fe_type, const bool is_fv=false, const bool is_array=false)
static InputParameters validParams()
void paramError(const std::string ¶m, Args... args) const
const MeshGenerator & appendMeshGenerator(const std::string &type, const std::string &name, InputParameters params)
bool isParamSetByUser(const std::string &nm) const
static libMesh::FEType feType(const InputParameters ¶ms)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual void addRelationshipManagers(Moose::RelationshipManagerType input_rm_type) override
const MultiMooseEnum gapFluxPhysics("conduction radiation")
void mooseError(Args &&... args) const
std::shared_ptr< FEProblemBase > & _problem
const InputParameters & parameters() const
const bool _user_provided_gap_flux_models
void checkForExistingSubdomains()
virtual void coreMortarMesh()
bool isRecovering() const
virtual void addUserObjects()
virtual void act() override
MortarGapHeatTransferAction(const InputParameters ¶ms)