26 "use_nonorthogonal_correction",
28 "Whether to use a non-orthogonal correction. This can potentially slow down convergence "
29 ", but reduces numerical dispersion on non-orthogonal meshes. Can be safely turned off on "
30 "orthogonal meshes.");
31 params.
set<std::vector<SolverSystemName>>(
"system_names") = {
"energy_system"};
50 "Only applies with the porous medium treatment of the flow physics");
67 const auto var_type =
"MooseLinearVariableFVReal";
73 "Variable (" + variable_name +
74 ") supplied to the WCNSLinearFVFluidHeatTransferPhysics does not exist!");
80 std::string kernel_type =
"LinearFVTimeDerivative";
81 std::string kernel_name =
prefix() +
"ins_energy_time";
84 params.
set<LinearVariableName>(
"variable") =
89 params.
set<MooseFunctorName>(
"factor") =
101 std::string kernel_type =
"LinearFVEnergyAdvection";
102 std::string kernel_name =
prefix() +
"ins_energy_advection";
106 if (!getParam<bool>(
"solve_for_enthalpy"))
109 params.
set<
MooseEnum>(
"advected_quantity") =
"temperature";
111 paramError(
"specific_heat",
"Must be a Real number. Functors not supported at this time");
118 getParam<MooseEnum>(
"energy_advection_interpolation");
127 const auto num_used_blocks = num_blocks ? num_blocks : 1;
129 for (
const auto block_i : make_range(num_used_blocks))
131 std::string block_name =
"";
137 const std::string kernel_type =
"LinearFVDiffusion";
139 const auto th_cond_name =
141 params.
set<LinearVariableName>(
"variable") =
143 const MooseFunctorName diffusion_coeff = th_cond_name + (
_solve_for_enthalpy ?
"_by_cp" :
"");
145 params.
set<MooseFunctorName>(
"diffusion_coeff") =
151 std::vector<SubdomainName> block_names =
158 "Vector thermal conductivities not currently supported with the linear finite "
159 "volume discretization");
161 params.
set<
bool>(
"use_nonorthogonal_correction") =
162 getParam<bool>(
"use_nonorthogonal_correction");
165 kernel_type,
prefix() +
"ins_energy_diffusion_" + block_name, params);
173 unsigned int num_used_blocks = num_convection_blocks ? num_convection_blocks : 1;
177 const std::string kernel_type =
_solve_for_enthalpy ?
"LinearFVEnthalpyVolumetricHeatTransfer"
178 :
"LinearFVVolumetricHeatTransfer";
180 params.
set<LinearVariableName>(
"variable") =
183 params.
set<
bool>(
"is_solid") =
false;
187 for (
unsigned int block_i = 0; block_i < num_used_blocks; ++block_i)
189 std::string block_name =
"";
190 if (num_convection_blocks)
198 block_name = std::to_string(block_i);
205 kernel_type,
prefix() +
"ambient_convection_" + block_name, params);
212 const std::string kernel_type =
"LinearFVSource";
214 params.
set<LinearVariableName>(
"variable") =
217 params.
set<MooseFunctorName>(
"source_density") =
218 getParam<MooseFunctorName>(
"external_heat_source");
219 params.
set<MooseFunctorName>(
"scaling_factor") =
220 std::to_string(getParam<Real>(
"external_heat_source_coeff"));
237 const auto var_type =
"MooseLinearVariableFVReal";
244 ") supplied to the WCNSLinearFVFluidHeatTransferPhysics does not exist!");
254 const std::string kernel_type =
"FunctorAux";
258 params.
set<MooseFunctorName>(
"functor") =
"T_from_p_h";
273 ") should be the same size as inlet_boundaries (size " +
274 std::to_string(inlet_boundaries.size()) +
")");
278 ") should be the same size as inlet_boundaries (size " +
279 std::to_string(inlet_boundaries.size()) +
")");
285 const std::string bc_type =
"LinearFVAdvectionDiffusionFunctorDirichletBC";
289 params.
set<std::vector<BoundaryName>>(
"boundary") = {inlet_boundaries[bc_ind]};
298 params.
set<MooseFunctorName>(
"functor") =
"h_from_p_T";
304 paramError(
"energy_inlet_types",
"Heat flux inlet boundary conditions not yet supported");
307 paramError(
"energy_inlet_types",
"Flux inlet boundary conditions not yet supported");
315 ? getParam<std::vector<BoundaryName>>(
"energy_wall_boundaries")
320 ") should be the same size as wall_boundaries (size " +
321 std::to_string(wall_boundaries.size()) +
")");
325 ") should be the same size as wall_boundaries (size " +
326 std::to_string(wall_boundaries.size()) +
")");
332 const std::string bc_type =
"LinearFVAdvectionDiffusionFunctorDirichletBC";
336 params.
set<std::vector<BoundaryName>>(
"boundary") = {wall_boundaries[bc_ind]};
345 params.
set<MooseFunctorName>(
"functor") =
"h_from_p_T";
352 const std::string bc_type =
"LinearFVAdvectionDiffusionFunctorNeumannBC";
355 params.
set<LinearVariableName>(
"variable") = var_name;
357 params.
set<std::vector<BoundaryName>>(
"boundary") = {wall_boundaries[bc_ind]};
360 bc_type, var_name +
"_heatflux_" + wall_boundaries[bc_ind], params);
364 const std::string bc_type =
"LinearFVConvectiveHeatTransferBC";
366 params.
set<LinearVariableName>(
"variable") =
369 const auto Tinf_htc_functors =
371 if (Tinf_htc_functors.size() != 2)
373 "'convection' wall types require two functors specified as "
374 "<Tinf_functor>:<htc_functor>.");
376 params.
set<MooseFunctorName>(
"h") = Tinf_htc_functors[1];
377 params.
set<std::vector<BoundaryName>>(
"boundary") = {wall_boundaries[bc_ind]};
382 wall_boundaries[bc_ind],
387 "energy_wall_types",
_energy_wall_types[bc_ind],
" wall type is currently unsupported.");
395 if (outlet_boundaries.empty())
398 for (
const auto & outlet_bdy : outlet_boundaries)
400 const std::string bc_type =
"LinearFVAdvectionDiffusionOutflowBC";
403 params.
set<std::vector<BoundaryName>>(
"boundary") = {outlet_bdy};
404 params.
set<
bool>(
"use_two_term_expansion") = getParam<bool>(
"energy_two_term_bc_expansion");
406 params.
set<LinearVariableName>(
"variable") = variable_name;
419 const auto object_type =
"LinearFVEnthalpyFunctorMaterial";
433 if (!
getProblem().hasFunctor(
"h_from_p_T_functor", 0) ||
434 !
getProblem().hasFunctor(
"T_from_p_h_functor", 0))
436 "Either 'fp' must be specified or the 'h_from_p_T_functor' and "
437 "'T_from_p_h_functor' must be defined outside the Physics");
439 params.
set<MooseFunctorName>(
"h_from_p_T_functor") =
"h_from_p_T_functor";
440 params.
set<MooseFunctorName>(
"T_from_p_h_functor") =
"T_from_p_h_functor";
const ExecFlagType EXEC_NONLINEAR
registerNavierStokesPhysicsBaseTasks("NavierStokesApp", WCNSLinearFVFluidHeatTransferPhysics)
registerMooseAction("NavierStokesApp", WCNSLinearFVFluidHeatTransferPhysics, "add_aux_variable")
registerWCNSFVFluidHeatTransferPhysicsBaseTasks("NavierStokesApp", WCNSLinearFVFluidHeatTransferPhysics)
virtual void addLinearFVKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
virtual void addMaterial(const std::string &material_name, const std::string &name, InputParameters ¶meters)
virtual void addAuxKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
virtual void addLinearFVBC(const std::string &fv_bc_name, const std::string &name, InputParameters ¶meters)
InputParameters getValidParams(const std::string &name) const
void paramError(const std::string ¶m, Args... args) const
bool isParamSetByUser(const std::string &name) const
bool isParamValid(const std::string &name) const
unsigned int size() const
bool _define_variables
Whether to define variables if they do not exist.
MooseFunctorName addPorosityScaledFunctor(const MooseFunctorName &porosity, const MooseFunctorName &functor)
Add, if absent, a non-AD functor material defining the product of a porosity and another functor on t...
void addSharedAuxVariable(const std::string &var_type, const VariableName &var_name, const InputParameters ¶ms)
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 reportPotentiallyMissedParameters(const std::vector< std::string > ¶m_names, const std::string &object_type, const std::string &object_name="") const
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)
bool shouldCreateVariable(const VariableName &var_name, const std::vector< SubdomainName > &blocks, const bool error_if_aux)
std::vector< SubdomainName > _blocks
const std::vector< SubdomainName > & blocks() const
const WCNSFVFlowPhysicsBase * _flow_equations_physics
Flow physics.
bool _has_turbulence_model
Because of the Modules/navierStokesFV syntax, a turbulence physics often exists without a model we sa...
const bool _porous_medium_treatment
Switch to show if porous medium treatment is requested or not.
const MooseFunctorName _density_name
Name of the density material property.
const NonlinearVariableName & getPressureName() const
const std::vector< BoundaryName > & getWallBoundaries() const
Get the wall boundaries.
const UserObjectName & rhieChowUOName() const
Return the name of the Rhie Chow user object.
const std::vector< BoundaryName > & getOutletBoundaries() const
Get the outlet boundaries.
const std::vector< BoundaryName > & getInletBoundaries() const
Get the inlet boundaries.
MooseFunctorName getPorosityFunctorName(const bool smoothed) const
Creates all the objects needed to solve the Navier Stokes energy equation.
std::vector< MooseFunctorName > _energy_inlet_functors
Functors describing the inlet boundary values. See energy_inlet_types for what the functors actually ...
std::vector< MooseFunctorName > _energy_wall_functors
Functors describing the wall boundary values. See energy_wall_types for what the functors actually re...
MooseFunctorName _specific_heat_name
Name of the specific heat material property.
std::vector< MooseFunctorName > _ambient_convection_alpha
Name of the ambient convection heat transfer coefficients for each block-group.
static InputParameters validParams()
const VariableName _fluid_enthalpy_name
Name of the fluid specific enthalpy.
bool processThermalConductivity()
Process thermal conductivity (multiple functor input options are available).
std::vector< std::vector< SubdomainName > > _ambient_convection_blocks
Vector of subdomain groups where we want to have different ambient convection.
VariableName _fluid_temperature_name
Fluid temperature name.
void defineEffectiveThermalDiffusionCoeffFunctors(const bool use_ad)
Define the effective diffusion coefficient when:
const bool _has_energy_equation
A boolean to help compatibility with the old Modules/NavierStokesFV syntax.
const bool _solve_for_enthalpy
User-selected option to solve for enthalpy.
std::vector< MooseFunctorName > _thermal_conductivity_name
Name of the thermal conductivity functor for each block-group.
std::vector< std::vector< SubdomainName > > _thermal_conductivity_blocks
Vector of subdomain groups where we want to have different thermal conduction.
MultiMooseEnum _energy_wall_types
Energy wall boundary types.
MultiMooseEnum _energy_inlet_types
Energy inlet boundary types.
std::vector< MooseFunctorName > _ambient_temperature
Name of the solid domain temperature for each block-group.
Creates all the objects needed to solve the Navier Stokes energy equation using a linear finite volum...
void addEnergyInletBC() override
Functions adding boundary conditions for the incompressible / weakly compressible energy equation.
virtual void addAuxiliaryVariables() override
void addEnergyAmbientConvection() override
static InputParameters validParams()
virtual void addAuxiliaryKernels() override
void addEnergyExternalHeatSource() override
void addEnergyTimeKernels() override
Functions adding kernels for the incompressible / weakly compressible energy equation.
void addEnergyOutletBC() override
void addEnergyHeatConductionKernels() override
void addEnergyAdvectionKernels() override
virtual void addMaterials() override
virtual void addSolverVariables() override
void addEnergyWallBC() override
WCNSLinearFVFluidHeatTransferPhysics(const InputParameters ¶meters)
std::vector< std::string > split(const std::string &str, const std::string &delimiter, std::size_t max_count)
std::string stringify(const T &t)
static const std::string T_fluid
static const std::string cp
static const std::string k_eff_t
static const std::string T_solid
static const std::string specific_enthalpy
static const std::string fluid
static const std::string pressure