31 params.
suppressParameter<std::vector<BoundaryName>>(
"fixed_convection_boundaries");
32 params.
suppressParameter<std::vector<MooseFunctorName>>(
"fixed_convection_T_fluid");
38 "solid_temperature_variable",
39 "Name of the solid phase temperature variable");
40 params.
set<VariableName>(
"solid_temperature_variable") =
NS::T_solid;
41 params.
addParam<NonlinearVariableName>(
42 "fluid_temperature_variable",
NS::T_fluid,
"Name of the fluid temperature variable");
43 MooseEnum face_interpol_types(
"average skewness-corrected",
"average");
45 "solid_temperature_face_interpolation",
47 "The numerical scheme to interpolate the temperature/energy to the "
48 "face for conduction (separate from the advected quantity interpolation).");
50 "solid_temperature_two_term_bc_expansion",
52 "If a two-term Taylor expansion is needed for the determination of the boundary values"
53 "of the temperature/energy.");
61 params.
addParam<MooseFunctorName>(
"cp_solid",
NS::cp +
"_solid",
"Specific heat functor");
64 params.
addParam<std::vector<std::vector<SubdomainName>>>(
65 "thermal_conductivity_blocks",
"Blocks which each thermal conductivity is defined");
68 "thermal_conductivity_solid",
69 "Thermal conductivity, which may have different names depending on the subdomain");
72 params.
addParam<std::vector<std::vector<SubdomainName>>>(
73 "ambient_convection_blocks", {},
"The blocks where the ambient convection is present.");
74 params.
addParam<std::vector<MooseFunctorName>>(
75 "ambient_convection_alpha",
77 "The heat exchange coefficients for each block in 'ambient_convection_blocks'.");
78 params.
addParam<std::vector<MooseFunctorName>>(
79 "ambient_convection_temperature",
81 "The fluid temperature for each block in 'ambient_convection_blocks'.");
84 params.
addParam<std::vector<SubdomainName>>(
"external_heat_source_blocks",
85 std::vector<SubdomainName>(),
86 "The blocks where the heat source is present.");
88 "external_heat_source",
89 "The name of a functor which contains the external heat source for the energy equation.");
91 "external_heat_source_coeff", 1.0,
"Multiplier for the coupled heat source term.");
92 params.
addParam<
bool>(
"use_external_enthalpy_material",
94 "To indicate if the enthalpy material is set up outside of the action.");
101 "ghost_layers", 2,
"Number of layers of elements to ghost near process domain boundaries");
103 MooseEnum pc_options(
"default none",
"none");
109 "thermal_conductivity_blocks use_external_enthalpy_material",
110 "Material properties");
112 "ambient_convection_temperature",
113 "Ambient convection");
115 "external_heat_source_blocks external_heat_source external_heat_source_coeff",
116 "Solid porous medium heat source");
118 "solid_temperature_face_interpolation solid_temperature_two_term_bc_expansion",
127 _solid_temperature_name(getParam<VariableName>(
"solid_temperature_variable")),
128 _fluid_temperature_name(getParam<NonlinearVariableName>(
"fluid_temperature_variable")),
129 _porosity_name(getParam<MooseFunctorName>(
NS::porosity)),
130 _density_name(getParam<MooseFunctorName>(
"rho_solid")),
131 _specific_heat_name(getParam<MooseFunctorName>(
"cp_solid")),
132 _thermal_conductivity_blocks(
133 parameters.isParamValid(
"thermal_conductivity_blocks")
134 ? getParam<
std::vector<
std::vector<SubdomainName>>>(
"thermal_conductivity_blocks")
135 :
std::vector<
std::vector<SubdomainName>>()),
136 _thermal_conductivity_name(
137 getParam<
std::vector<MooseFunctorName>>(
"thermal_conductivity_solid")),
138 _ambient_convection_blocks(
139 getParam<
std::vector<
std::vector<SubdomainName>>>(
"ambient_convection_blocks")),
140 _ambient_convection_alpha(getParam<
std::vector<MooseFunctorName>>(
"ambient_convection_alpha")),
141 _ambient_temperature(getParam<
std::vector<MooseFunctorName>>(
"ambient_convection_temperature"))
146 if (
getParam<std::vector<MooseFunctorName>>(
"ambient_convection_temperature").size() != 1)
147 checkVectorParamsSameLengthIfSet<MooseFunctorName, MooseFunctorName>(
148 "ambient_convection_alpha",
"ambient_convection_temperature");
152 "Solid and fluid cannot share the same temperature variable");
167 params.
set<std::vector<Real>>(
"scaling") = {getParam<Real>(
"temperature_scaling")};
168 params.set<
MooseEnum>(
"face_interp_method") =
169 getParam<MooseEnum>(
"solid_temperature_face_interpolation");
170 params.set<
bool>(
"two_term_boundary_expansion") =
171 getParam<bool>(
"solid_temperature_two_term_bc_expansion");
186 if (
getParam<std::vector<MooseFunctorName>>(
"ambient_convection_alpha").size())
195 const auto kernel_type =
"PINSFVEnergyTimeDerivative";
196 const auto kernel_name =
prefix() +
"pins_solid_energy_time";
221 params.
set<
bool>(
"is_solid") =
true;
231 const auto kernel_type =
232 vector_conductivity ?
"PINSFVEnergyAnisotropicDiffusion" :
"PINSFVEnergyDiffusion";
240 std::vector<SubdomainName> thermal_conductivity_blocks;
242 thermal_conductivity_blocks.insert(thermal_conductivity_blocks.end(),
243 std::make_move_iterator(block_group.begin()),
244 std::make_move_iterator(block_group.end()));
245 const auto block_names =
250 const auto conductivity_name = vector_conductivity ?
NS::kappa :
NS::k;
252 params.
set<MooseFunctorName>(conductivity_name) =
prefix() +
"combined_thermal_conductivity";
263 const auto num_used_blocks = num_convection_blocks ? num_convection_blocks : 1;
268 "Number of ambient convection heat transfer coefficients (" +
270 ") should match the number of "
272 std::to_string(num_convection_blocks) +
") each HTC is defined on.");
274 const auto kernel_type =
"PINSFVEnergyAmbientConvection";
278 params.
set<
bool>(
"is_solid") =
true;
280 for (
const auto block_i : make_range(num_used_blocks))
282 std::string block_name =
"";
283 if (num_convection_blocks)
291 block_name = std::to_string(block_i);
307 const std::string kernel_type =
"FVCoupledForce";
310 const auto & source_blocks = getParam<std::vector<SubdomainName>>(
"external_heat_source_blocks");
311 if (source_blocks.size())
315 params.
set<MooseFunctorName>(
"v") = getParam<MooseFunctorName>(
"external_heat_source");
316 params.
set<Real>(
"coef") = getParam<Real>(
"external_heat_source_coeff");
325 checkBlockwiseConsistency<MooseFunctorName>(
"thermal_conductivity_blocks",
326 {
"thermal_conductivity_solid"});
327 bool have_scalar =
false;
328 bool have_vector =
false;
349 "We only allow functor of type (AD)Real or (AD)RealVectorValue for thermal "
350 "conductivity! Functor '" +
357 "' was not found in the Problem. Did you mispell it?");
362 if (have_vector && (have_vector == have_scalar))
364 "The entries on thermal conductivity shall either be scalars or vectors, mixing "
365 "them is not supported!");
372 if (!getParam<bool>(
"use_external_enthalpy_material"))
380 params.
set<MaterialPropertyName>(
"declare_suffix") =
"solid";
383 "INSFVEnthalpyFunctorMaterial",
prefix() +
"ins_enthalpy_material", params);
390 const auto combiner_functor = vector_conductivity ?
"PiecewiseByBlockVectorFunctorMaterial"
391 :
"PiecewiseByBlockFunctorMaterial";
393 params.
set<MooseFunctorName>(
"prop_name") =
prefix() +
"combined_thermal_conductivity";
394 std::vector<SubdomainName> blocks_list;
395 std::map<std::string, std::string> blocks_to_functors;
400 blocks_list.push_back(block);
401 blocks_to_functors.insert(
405 params.
set<std::vector<SubdomainName>>(
"block") = blocks_list;
406 params.
set<std::map<std::string, std::string>>(
"subdomain_to_prop_value") = blocks_to_functors;
414 unsigned short necessary_layers = getParam<unsigned short>(
"ghost_layers");
415 if (getParam<MooseEnum>(
"solid_temperature_face_interpolation") ==
"skewness-corrected")
416 necessary_layers = std::max(necessary_layers, (
unsigned short)3);
420 const std::string kernel_type =
"INSFVMixingLengthReynoldsStress";
422 params.template set<unsigned short>(
"ghost_layers") = necessary_layers;
433 const auto all_flow_physics = getCoupledPhysics<const WCNSFVFlowPhysics>(
true);
434 for (
const auto physics : all_flow_physics)
436 physics->name(), physics->blocks(),
false))
439 mooseError(
"Two Fluid flow physics detected on the same blocks as the solid heat transfer "
441 flow_physics = physics;
443 const auto all_fluid_energy_physics =
444 getCoupledPhysics<const WCNSFVFluidHeatTransferPhysics>(
true);
445 for (
const auto physics : all_fluid_energy_physics)
447 physics->name(), physics->blocks(),
false))
449 if (fluid_energy_physics)
450 mooseError(
"Two fluid heat transfer physics detected on the same blocks as the solid heat "
452 fluid_energy_physics = physics;
455 if (!fluid_energy_physics && !flow_physics)
462 paramError(
"rho_solid",
"Fluid and solid density should be different");
464 paramError(
"cp_solid",
"Fluid and solid specific heat should be different");
467 if (fluid_energy_physics)
473 std::sort(fluid_convection_blocks.begin(), fluid_convection_blocks.end());
475 std::sort(copy_solid_blocks.begin(), copy_solid_blocks.end());
477 paramWarning(
"Ambient convection blocks in the solid phase :" +
488 paramWarning(
"Ambient convection HTCs in the solid phase :" +
DualNumber< Real, DNDerivativeType, true > ADReal
registerPhysicsBaseTasks("NavierStokesApp", PNSFVSolidHeatTransferPhysics)
registerMooseAction("NavierStokesApp", PNSFVSolidHeatTransferPhysics, "add_variable")
virtual void addMaterial(const std::string &material_name, const std::string &name, InputParameters ¶meters)
virtual void addFVKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
InputParameters getValidParams(const std::string &name) const
Creates all the objects needed to solve the heat conduction equations with a finite volume discretiza...
static InputParameters validParams()
void paramWarning(const std::string ¶m, Args... args) const
void paramError(const std::string ¶m, Args... args) const
void mooseError(Args &&... args) const
const T & getParam(const std::string &name) const
bool isParamValid(const std::string &name) const
static InputParameters validParams()
Creates all the objects needed to solve the porous media solid energy equation.
const MooseFunctorName _porosity_name
Name of the porosity functor (usually material property)
const NonlinearVariableName _fluid_temperature_name
Fluid temperature name.
virtual void addFVKernels() override
std::vector< MooseFunctorName > _thermal_conductivity_name
Name of the thermal conductivity functor for each block-group.
std::vector< MooseFunctorName > _ambient_temperature
Name of the solid domain temperature for each block-group.
std::vector< std::vector< SubdomainName > > _ambient_convection_blocks
Vector of subdomain groups where we want to have different ambient convection.
bool processThermalConductivity()
Process thermal conductivity (multiple functor input options are available).
std::vector< std::vector< SubdomainName > > _thermal_conductivity_blocks
Vector of subdomain groups where we want to have different thermal conduction.
virtual InputParameters getAdditionalRMParams() const override
PNSFVSolidHeatTransferPhysics(const InputParameters ¶meters)
void addPINSSolidEnergyHeatConductionKernels()
const NonlinearVariableName _solid_temperature_name
Solid temperature name.
virtual void addSolverVariables() override
void addPINSSolidEnergyAmbientConvection()
static InputParameters validParams()
const MooseFunctorName _specific_heat_name
Name of the specific heat functor (usually material property)
virtual void addMaterials() override
std::vector< MooseFunctorName > _ambient_convection_alpha
Name of the ambient convection heat transfer coefficients for each block-group.
const MooseFunctorName _density_name
Name of the density functor (usually material property)
void addPINSSolidEnergyExternalHeatSource()
void addPINSSolidEnergyTimeKernels()
Functions adding kernels for the solid energy equation.
void checkFluidAndSolidHeatTransferPhysicsParameters() const
Battery of additional checks on parameters.
virtual FEProblemBase & getProblem()
bool checkBlockRestrictionIdentical(const std::string &object_name, const std::vector< SubdomainName > &blocks, const bool error_if_not_identical=true) const
void assignBlocks(InputParameters ¶ms, const std::vector< SubdomainName > &blocks) const
void saveSolverVariableName(const VariableName &var_name)
std::string prefix() const
bool variableExists(const VariableName &var_name, bool error_if_aux) const
void addSharedSolverVariable(const std::string &var_type, const VariableName &var_name, InputParameters params)
std::vector< SubdomainName > _blocks
const std::vector< SubdomainName > & blocks() const
bool hasFunctor(const std::string &name, const THREAD_ID tid) const
bool hasFunctorWithType(const std::string &name, const THREAD_ID tid) const
const MooseFunctorName & densityName() const
Return the name of the density functor.
Creates all the objects needed to solve the Navier Stokes mass and momentum equations.
const std::vector< MooseFunctorName > & getAmbientConvectionHTCs() const
Name of the ambient convection heat transfer coefficients for each block-group.
const std::vector< std::vector< SubdomainName > > & getAmbientConvectionBlocks() const
Get the ambient convection parameters for parameter checking.
const MooseFunctorName & getSpecificHeatName() const
Get the name of the specific heat material property.
Creates all the objects needed to solve the Navier Stokes energy equation.
bool parsesToReal(const std::string &input, Real *parsed_real)
std::string stringify(const T &t)
static const std::string density
static const std::string T_fluid
static const std::string cp
static const std::string k
static const std::string T_solid
static const std::string specific_enthalpy
static const std::string kappa
static const std::string porosity
std::string time_deriv(const std::string &var)