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;
233 const auto kernel_type = vector_conductivity ?
"FVAnisotropicDiffusion" :
"FVDiffusion";
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 =
251 params.
set<MooseFunctorName>(
"coeff") =
prefix() +
"combined_thermal_conductivity";
262 const auto num_used_blocks = num_convection_blocks ? num_convection_blocks : 1;
265 const auto kernel_type =
"PINSFVEnergyAmbientConvection";
269 params.
set<
bool>(
"is_solid") =
true;
271 for (
const auto block_i : make_range(num_used_blocks))
273 std::string block_name =
"";
274 if (num_convection_blocks)
282 block_name = std::to_string(block_i);
298 const std::string kernel_type =
"FVCoupledForce";
301 const auto & source_blocks = getParam<std::vector<SubdomainName>>(
"external_heat_source_blocks");
302 if (source_blocks.size())
306 params.
set<MooseFunctorName>(
"v") = getParam<MooseFunctorName>(
"external_heat_source");
307 params.
set<Real>(
"coef") = getParam<Real>(
"external_heat_source_coeff");
316 const auto num_used_blocks = num_convection_blocks ? num_convection_blocks : 1;
321 "Number of ambient convection heat transfer coefficients (" +
323 ") should match the number of "
325 std::to_string(num_convection_blocks) +
") each HTC is defined on.");
332 checkBlockwiseConsistency<MooseFunctorName>(
"thermal_conductivity_blocks",
333 {
"thermal_conductivity_solid"});
334 bool have_scalar =
false;
335 bool have_vector =
false;
356 "We only allow functor of type (AD)Real or (AD)RealVectorValue for thermal "
357 "conductivity! Functor '" +
364 "' was not found in the Problem. Did you mispell it?");
369 if (have_vector && (have_vector == have_scalar))
371 "The entries on thermal conductivity shall either be scalars or vectors, mixing "
372 "them is not supported!");
379 if (!getParam<bool>(
"use_external_enthalpy_material"))
387 params.
set<MaterialPropertyName>(
"declare_suffix") =
"solid";
390 "INSFVEnthalpyFunctorMaterial",
prefix() +
"ins_enthalpy_material", params);
397 const auto combiner_functor = vector_conductivity ?
"PiecewiseByBlockVectorFunctorMaterial"
398 :
"PiecewiseByBlockFunctorMaterial";
400 params.
set<MooseFunctorName>(
"prop_name") =
prefix() +
"combined_thermal_conductivity";
401 std::vector<SubdomainName> blocks_list;
402 std::map<std::string, std::string> blocks_to_functors;
407 blocks_list.push_back(block);
408 blocks_to_functors.insert(
412 params.
set<std::vector<SubdomainName>>(
"block") = blocks_list;
413 params.
set<std::map<std::string, std::string>>(
"subdomain_to_prop_value") = blocks_to_functors;
421 unsigned short necessary_layers = getParam<unsigned short>(
"ghost_layers");
422 if (getParam<MooseEnum>(
"solid_temperature_face_interpolation") ==
"skewness-corrected")
423 necessary_layers = std::max(necessary_layers, (
unsigned short)3);
427 const std::string kernel_type =
"INSFVMixingLengthReynoldsStress";
429 params.template set<unsigned short>(
"ghost_layers") = necessary_layers;
440 const auto all_flow_physics = getCoupledPhysics<const WCNSFVFlowPhysicsBase>(
true);
441 for (
const auto physics : all_flow_physics)
443 physics->name(), physics->blocks(),
false))
446 mooseError(
"Two Fluid flow physics detected on the same blocks as the solid heat transfer "
448 flow_physics = physics;
450 const auto all_fluid_energy_physics =
451 getCoupledPhysics<const WCNSFVFluidHeatTransferPhysicsBase>(
true);
452 for (
const auto physics : all_fluid_energy_physics)
454 physics->name(), physics->blocks(),
false))
456 if (fluid_energy_physics)
457 mooseError(
"Two fluid heat transfer physics detected on the same blocks as the solid heat "
459 fluid_energy_physics = physics;
462 if (!fluid_energy_physics && !flow_physics)
469 paramError(
"rho_solid",
"Fluid and solid density should be different");
471 paramError(
"cp_solid",
"Fluid and solid specific heat should be different");
474 if (fluid_energy_physics)
480 std::sort(fluid_convection_blocks.begin(), fluid_convection_blocks.end());
482 std::sort(copy_solid_blocks.begin(), copy_solid_blocks.end());
484 paramWarning(
"Ambient convection blocks in the solid phase :" +
495 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 checkAmbientConvectionParameters() const
Check the number of ambient convection heat transfer coefficients against the blocks.
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
Base class for Physics which create the Navier Stokes flow equations.
const MooseFunctorName & densityName() const
Return the name of the density functor.
Creates all the objects needed to solve the Navier Stokes energy equation.
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.
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 T_solid
static const std::string specific_enthalpy
static const std::string porosity
std::string time_deriv(const std::string &var)