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 paramError(
"porous_medium_treatment",
"Porous media not supported at this time");
68 const auto var_type =
"MooseLinearVariableFVReal";
74 "Variable (" + variable_name +
75 ") supplied to the WCNSLinearFVFluidHeatTransferPhysics does not exist!");
81 std::string kernel_type =
"LinearFVTimeDerivative";
82 std::string kernel_name =
prefix() +
"ins_energy_time";
85 params.
set<LinearVariableName>(
"variable") =
89 params.
set<MooseFunctorName>(
"factor") =
"rho_cp";
99 std::string kernel_type =
"LinearFVEnergyAdvection";
100 std::string kernel_name =
prefix() +
"ins_energy_advection";
104 if (!getParam<bool>(
"solve_for_enthalpy"))
107 params.
set<
MooseEnum>(
"advected_quantity") =
"temperature";
109 paramError(
"specific_heat",
"Must be a Real number. Functors not supported at this time");
116 getParam<MooseEnum>(
"energy_advection_interpolation");
125 const auto num_used_blocks = num_blocks ? num_blocks : 1;
127 for (
const auto block_i : make_range(num_used_blocks))
129 std::string block_name =
"";
135 const std::string kernel_type =
"LinearFVDiffusion";
148 const auto th_cond_name =
150 params.
set<MooseFunctorName>(
"diffusion_coeff") = th_cond_name +
"_by_cp";
152 std::vector<SubdomainName> block_names =
159 "Vector thermal conductivities not currently supported with the linear finite "
160 "volume discretization");
162 params.
set<
bool>(
"use_nonorthogonal_correction") =
163 getParam<bool>(
"use_nonorthogonal_correction");
166 kernel_type,
prefix() +
"ins_energy_diffusion_" + block_name, params);
174 unsigned int num_used_blocks = num_convection_blocks ? num_convection_blocks : 1;
176 const std::string kernel_type =
"LinearFVVolumetricHeatTransfer";
178 params.
set<LinearVariableName>(
"variable") =
181 params.
set<
bool>(
"is_solid") =
false;
183 for (
unsigned int block_i = 0; block_i < num_used_blocks; ++block_i)
185 std::string block_name =
"";
186 if (num_convection_blocks)
194 block_name = std::to_string(block_i);
201 kernel_type,
prefix() +
"ambient_convection_" + block_name, params);
208 const std::string kernel_type =
"LinearFVSource";
210 params.
set<LinearVariableName>(
"variable") =
213 params.
set<MooseFunctorName>(
"source_density") =
214 getParam<MooseFunctorName>(
"external_heat_source");
215 params.
set<MooseFunctorName>(
"scaling_factor") =
216 std::to_string(getParam<Real>(
"external_heat_source_coeff"));
233 const auto var_type =
"MooseLinearVariableFVReal";
240 ") supplied to the WCNSLinearFVFluidHeatTransferPhysics does not exist!");
250 const std::string kernel_type =
"FunctorAux";
254 params.
set<MooseFunctorName>(
"functor") =
"T_from_p_h";
269 ") should be the same size as inlet_boundaries (size " +
270 std::to_string(inlet_boundaries.size()) +
")");
274 ") should be the same size as inlet_boundaries (size " +
275 std::to_string(inlet_boundaries.size()) +
")");
281 const std::string bc_type =
"LinearFVAdvectionDiffusionFunctorDirichletBC";
285 params.
set<std::vector<BoundaryName>>(
"boundary") = {inlet_boundaries[bc_ind]};
294 params.
set<MooseFunctorName>(
"functor") =
"h_from_p_T";
300 paramError(
"energy_inlet_types",
"Heat flux inlet boundary conditions not yet supported");
303 paramError(
"energy_inlet_types",
"Flux inlet boundary conditions not yet supported");
311 ? getParam<std::vector<BoundaryName>>(
"energy_wall_boundaries")
316 ") should be the same size as wall_boundaries (size " +
317 std::to_string(wall_boundaries.size()) +
")");
321 ") should be the same size as wall_boundaries (size " +
322 std::to_string(wall_boundaries.size()) +
")");
328 const std::string bc_type =
"LinearFVAdvectionDiffusionFunctorDirichletBC";
332 params.
set<std::vector<BoundaryName>>(
"boundary") = {wall_boundaries[bc_ind]};
341 params.
set<MooseFunctorName>(
"functor") =
"h_from_p_T";
348 const std::string bc_type =
"LinearFVAdvectionDiffusionFunctorNeumannBC";
351 params.
set<LinearVariableName>(
"variable") = var_name;
353 params.
set<std::vector<BoundaryName>>(
"boundary") = {wall_boundaries[bc_ind]};
356 bc_type, var_name +
"_heatflux_" + wall_boundaries[bc_ind], params);
360 const std::string bc_type =
"LinearFVConvectiveHeatTransferBC";
362 params.
set<LinearVariableName>(
"variable") =
365 const auto Tinf_htc_functors =
367 if (Tinf_htc_functors.size() != 2)
369 "'convection' wall types require two functors specified as "
370 "<Tinf_functor>:<htc_functor>.");
372 params.
set<MooseFunctorName>(
"h") = Tinf_htc_functors[1];
373 params.
set<std::vector<BoundaryName>>(
"boundary") = {wall_boundaries[bc_ind]};
378 wall_boundaries[bc_ind],
383 "energy_wall_types",
_energy_wall_types[bc_ind],
" wall type is currently unsupported.");
391 if (outlet_boundaries.empty())
394 for (
const auto & outlet_bdy : outlet_boundaries)
396 const std::string bc_type =
"LinearFVAdvectionDiffusionOutflowBC";
399 params.
set<std::vector<BoundaryName>>(
"boundary") = {outlet_bdy};
400 params.
set<
bool>(
"use_two_term_expansion") = getParam<bool>(
"energy_two_term_bc_expansion");
402 params.
set<LinearVariableName>(
"variable") = variable_name;
415 const auto object_type =
"LinearFVEnthalpyFunctorMaterial";
429 if (!
getProblem().hasFunctor(
"h_from_p_T_functor", 0) ||
430 !
getProblem().hasFunctor(
"T_from_p_h_functor", 0))
432 "Either 'fp' must be specified or the 'h_from_p_T_functor' and "
433 "'T_from_p_h_functor' must be defined outside the Physics");
435 params.
set<MooseFunctorName>(
"h_from_p_T_functor") =
"h_from_p_T_functor";
436 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.
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.
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 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