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");
169 params.set<std::vector<Real>>(
"scaling") = {getParam<Real>(
"temperature_scaling")};
170 params.set<
MooseEnum>(
"face_interp_method") =
171 getParam<MooseEnum>(
"solid_temperature_face_interpolation");
172 params.set<
bool>(
"two_term_boundary_expansion") =
173 getParam<bool>(
"solid_temperature_two_term_bc_expansion");
188 if (
getParam<std::vector<MooseFunctorName>>(
"ambient_convection_alpha").size())
197 const auto kernel_type =
"PINSFVEnergyTimeDerivative";
198 const auto kernel_name =
prefix() +
"pins_solid_energy_time";
223 params.
set<
bool>(
"is_solid") =
true;
233 const auto kernel_type =
234 vector_conductivity ?
"PINSFVEnergyAnisotropicDiffusion" :
"PINSFVEnergyDiffusion";
242 std::vector<SubdomainName> thermal_conductivity_blocks;
244 thermal_conductivity_blocks.insert(thermal_conductivity_blocks.end(),
245 std::make_move_iterator(block_group.begin()),
246 std::make_move_iterator(block_group.end()));
247 const auto block_names =
252 const auto conductivity_name = vector_conductivity ?
NS::kappa :
NS::k;
254 params.
set<MooseFunctorName>(conductivity_name) =
prefix() +
"combined_thermal_conductivity";
265 const auto num_used_blocks = num_convection_blocks ? num_convection_blocks : 1;
270 "Number of ambient convection heat transfer coefficients (" +
272 ") should match the number of "
274 std::to_string(num_convection_blocks) +
") each HTC is defined on.");
276 const auto kernel_type =
"PINSFVEnergyAmbientConvection";
280 params.
set<
bool>(
"is_solid") =
true;
282 for (
const auto block_i : make_range(num_used_blocks))
284 std::string block_name =
"";
285 if (num_convection_blocks)
293 block_name = std::to_string(block_i);
309 const std::string kernel_type =
"FVCoupledForce";
312 const auto & source_blocks = getParam<std::vector<SubdomainName>>(
"external_heat_source_blocks");
313 if (source_blocks.size())
317 params.
set<MooseFunctorName>(
"v") = getParam<MooseFunctorName>(
"external_heat_source");
318 params.
set<Real>(
"coef") = getParam<Real>(
"external_heat_source_coeff");
327 checkBlockwiseConsistency<MooseFunctorName>(
"thermal_conductivity_blocks",
328 {
"thermal_conductivity_solid"});
329 bool have_scalar =
false;
330 bool have_vector =
false;
351 "We only allow functor of type (AD)Real or (AD)RealVectorValue for thermal "
352 "conductivity! Functor '" +
359 "' was not found in the Problem. Did you mispell it?");
364 if (have_vector && (have_vector == have_scalar))
366 "The entries on thermal conductivity shall either be scalars or vectors, mixing "
367 "them is not supported!");
374 if (!getParam<bool>(
"use_external_enthalpy_material"))
382 params.
set<MaterialPropertyName>(
"declare_suffix") =
"solid";
385 "INSFVEnthalpyFunctorMaterial",
prefix() +
"ins_enthalpy_material", params);
392 const auto combiner_functor = vector_conductivity ?
"PiecewiseByBlockVectorFunctorMaterial"
393 :
"PiecewiseByBlockFunctorMaterial";
395 params.
set<MooseFunctorName>(
"prop_name") =
prefix() +
"combined_thermal_conductivity";
396 std::vector<SubdomainName> blocks_list;
397 std::map<std::string, std::string> blocks_to_functors;
402 blocks_list.push_back(block);
403 blocks_to_functors.insert(
407 params.
set<std::vector<SubdomainName>>(
"block") = blocks_list;
408 params.
set<std::map<std::string, std::string>>(
"subdomain_to_prop_value") = blocks_to_functors;
416 unsigned short necessary_layers = getParam<unsigned short>(
"ghost_layers");
417 if (getParam<MooseEnum>(
"solid_temperature_face_interpolation") ==
"skewness-corrected")
418 necessary_layers = std::max(necessary_layers, (
unsigned short)3);
422 const std::string kernel_type =
"INSFVMixingLengthReynoldsStress";
424 params.template set<unsigned short>(
"ghost_layers") = necessary_layers;
435 const auto all_flow_physics = getCoupledPhysics<const WCNSFVFlowPhysics>(
true);
436 for (
const auto physics : all_flow_physics)
438 physics->name(), physics->blocks(),
false))
441 mooseError(
"Two Fluid flow physics detected on the same blocks as the solid heat transfer "
443 flow_physics = physics;
445 const auto all_fluid_energy_physics =
446 getCoupledPhysics<const WCNSFVFluidHeatTransferPhysics>(
true);
447 for (
const auto physics : all_fluid_energy_physics)
449 physics->name(), physics->blocks(),
false))
451 if (fluid_energy_physics)
452 mooseError(
"Two fluid heat transfer physics detected on the same blocks as the solid heat "
454 fluid_energy_physics = physics;
457 if (!fluid_energy_physics && !flow_physics)
464 paramError(
"rho_solid",
"Fluid and solid density should be different");
466 paramError(
"cp_solid",
"Fluid and solid specific heat should be different");
469 if (fluid_energy_physics)
475 std::sort(fluid_convection_blocks.begin(), fluid_convection_blocks.end());
477 std::sort(copy_solid_blocks.begin(), copy_solid_blocks.end());
479 paramWarning(
"Ambient convection blocks in the solid phase :" +
490 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 addVariable(const std::string &var_type, const std::string &var_name, InputParameters ¶ms)
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
const SolverSystemName & getSolverSystem(unsigned int variable_index) const
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)