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;
350 "We only allow functor of type (AD)Real or (AD)RealVectorValue for thermal " 351 "conductivity! Functor '" +
357 if (have_vector == have_scalar)
359 "The entries on thermal conductivity shall either be scalars or vectors, mixing " 360 "them is not supported!");
367 if (!getParam<bool>(
"use_external_enthalpy_material"))
375 params.
set<MaterialPropertyName>(
"declare_suffix") =
"solid";
378 "INSFVEnthalpyFunctorMaterial",
prefix() +
"ins_enthalpy_material", params);
385 const auto combiner_functor = vector_conductivity ?
"PiecewiseByBlockVectorFunctorMaterial" 386 :
"PiecewiseByBlockFunctorMaterial";
388 params.
set<MooseFunctorName>(
"prop_name") =
prefix() +
"combined_thermal_conductivity";
389 std::vector<SubdomainName> blocks_list;
390 std::map<std::string, std::string> blocks_to_functors;
395 blocks_list.push_back(block);
396 blocks_to_functors.insert(
400 params.
set<std::vector<SubdomainName>>(
"block") = blocks_list;
401 params.
set<std::map<std::string, std::string>>(
"subdomain_to_prop_value") = blocks_to_functors;
409 unsigned short necessary_layers = getParam<unsigned short>(
"ghost_layers");
410 if (getParam<MooseEnum>(
"solid_temperature_face_interpolation") ==
"skewness-corrected")
411 necessary_layers = std::max(necessary_layers, (
unsigned short)3);
415 const std::string kernel_type =
"INSFVMixingLengthReynoldsStress";
417 params.template set<unsigned short>(
"ghost_layers") = necessary_layers;
428 const auto all_flow_physics = getCoupledPhysics<const WCNSFVFlowPhysics>(
true);
429 for (
const auto physics : all_flow_physics)
431 physics->name(), physics->blocks(),
false))
434 mooseError(
"Two Fluid flow physics detected on the same blocks as the solid heat transfer " 436 flow_physics = physics;
438 const auto all_fluid_energy_physics =
439 getCoupledPhysics<const WCNSFVFluidHeatTransferPhysics>(
true);
440 for (
const auto physics : all_fluid_energy_physics)
442 physics->name(), physics->blocks(),
false))
444 if (fluid_energy_physics)
445 mooseError(
"Two fluid heat transfer physics detected on the same blocks as the solid heat " 447 fluid_energy_physics = physics;
450 if (!fluid_energy_physics && !flow_physics)
457 paramError(
"rho_solid",
"Fluid and solid density should be different");
459 paramError(
"cp_solid",
"Fluid and solid specific heat should be different");
462 if (fluid_energy_physics)
468 std::sort(fluid_convection_blocks.begin(), fluid_convection_blocks.end());
470 std::sort(copy_solid_blocks.begin(), copy_solid_blocks.end());
472 paramWarning(
"Ambient convection blocks in the solid phase :" +
483 paramWarning(
"Ambient convection HTCs in the solid phase :" +
std::string prefix() const
bool parsesToReal(const std::string &input)
static InputParameters validParams()
Creates all the objects needed to solve the Navier Stokes energy equation.
void assignBlocks(InputParameters ¶ms, const std::vector< SubdomainName > &blocks) const
void addPINSSolidEnergyHeatConductionKernels()
void addPINSSolidEnergyAmbientConvection()
virtual void addMaterial(const std::string &material_name, const std::string &name, InputParameters ¶meters)
static const std::string T_solid
void addPINSSolidEnergyExternalHeatSource()
static const std::string density
InputParameters getValidParams(const std::string &name) const
Creates all the objects needed to solve the Navier Stokes mass and momentum equations.
const std::vector< SubdomainName > & blocks() const
void checkFluidAndSolidHeatTransferPhysicsParameters() const
Battery of additional checks on parameters.
registerPhysicsBaseTasks("NavierStokesApp", PNSFVSolidHeatTransferPhysics)
static InputParameters validParams()
virtual void addFVKernels() override
std::vector< SubdomainName > _blocks
const MooseFunctorName & densityName() const
Return the name of the density functor.
std::vector< MooseFunctorName > _thermal_conductivity_name
Name of the thermal conductivity functor for each block-group.
bool isParamValid(const std::string &name) const
virtual FEProblemBase & getProblem()
static const std::string porosity
static const std::string cp
std::vector< MooseFunctorName > _ambient_convection_alpha
Name of the ambient convection heat transfer coefficients for each block-group.
const SolverSystemName & getSolverSystem(unsigned int variable_index) const
const MooseFunctorName & getSpecificHeatName() const
Get the name of the specific heat material property.
static const std::string T_fluid
bool processThermalConductivity()
Process thermal conductivity (multiple functor input options are available).
bool hasFunctorWithType(const std::string &name, const THREAD_ID tid) const
Creates all the objects needed to solve the porous media solid energy equation.
const T & getParam(const std::string &name) const
const MooseFunctorName _specific_heat_name
Name of the specific heat functor (usually material property)
void paramError(const std::string ¶m, Args... args) const
std::string stringify(const T &t)
virtual void addVariable(const std::string &var_type, const std::string &var_name, InputParameters ¶ms)
static InputParameters validParams()
bool variableExists(const VariableName &var_name, bool error_if_aux) const
bool checkBlockRestrictionIdentical(const std::string &object_name, const std::vector< SubdomainName > &blocks, const bool error_if_not_identical=true) const
const NonlinearVariableName _solid_temperature_name
Solid temperature name.
std::vector< std::vector< SubdomainName > > _thermal_conductivity_blocks
Vector of subdomain groups where we want to have different thermal conduction.
static const std::string kappa
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< MooseFunctorName > _ambient_temperature
Name of the solid domain temperature for each block-group.
const std::vector< MooseFunctorName > & getAmbientConvectionHTCs() const
Name of the ambient convection heat transfer coefficients for each block-group.
void addPINSSolidEnergyTimeKernels()
Functions adding kernels for the solid energy equation.
registerMooseAction("NavierStokesApp", PNSFVSolidHeatTransferPhysics, "add_variable")
const NonlinearVariableName _fluid_temperature_name
Fluid temperature name.
IntRange< T > make_range(T beg, T end)
void mooseError(Args &&... args) const
const MooseFunctorName _porosity_name
Name of the porosity functor (usually material property)
virtual void addSolverVariables() override
const MooseFunctorName _density_name
Name of the density functor (usually material property)
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
void paramWarning(const std::string ¶m, Args... args) const
bool hasFunctor(const std::string &name, const THREAD_ID tid) const
PNSFVSolidHeatTransferPhysics(const InputParameters ¶meters)
virtual void addFVKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
void saveSolverVariableName(const VariableName &var_name)
static const std::string k
virtual InputParameters getAdditionalRMParams() const override
auto index_range(const T &sizable)
Creates all the objects needed to solve the heat conduction equations with a finite volume discretiza...
std::vector< std::vector< SubdomainName > > _ambient_convection_blocks
Vector of subdomain groups where we want to have different ambient convection.
std::string time_deriv(const std::string &var)
static const std::string specific_enthalpy
const std::vector< std::vector< SubdomainName > > & getAmbientConvectionBlocks() const
Get the ambient convection parameters for parameter checking.
virtual void addMaterials() override