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";
71 params.set<SolverSystemName>(
"solver_sys") =
getSolverSystem(variable_name);
76 "Variable (" + variable_name +
77 ") supplied to the WCNSLinearFVFluidHeatTransferPhysics does not exist!");
83 std::string kernel_type =
"LinearFVTimeDerivative";
84 std::string kernel_name =
prefix() +
"ins_energy_time";
87 params.
set<LinearVariableName>(
"variable") =
91 params.
set<MooseFunctorName>(
"factor") =
"rho_cp";
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";
147 params.
set<MooseFunctorName>(
"diffusion_coeff") =
150 std::vector<SubdomainName> block_names =
157 "Vector thermal conductivities not currently supported with the linear finite " 158 "volume discretization");
160 params.
set<
bool>(
"use_nonorthogonal_correction") =
161 getParam<bool>(
"use_nonorthogonal_correction");
164 kernel_type,
prefix() +
"ins_energy_diffusion_" + block_name, params);
172 unsigned int num_used_blocks = num_convection_blocks ? num_convection_blocks : 1;
174 const std::string kernel_type =
"LinearFVVolumetricHeatTransfer";
176 params.
set<LinearVariableName>(
"variable") =
179 params.
set<
bool>(
"is_solid") =
false;
181 for (
unsigned int block_i = 0; block_i < num_used_blocks; ++block_i)
183 std::string block_name =
"";
184 if (num_convection_blocks)
192 block_name = std::to_string(block_i);
199 kernel_type,
prefix() +
"ambient_convection_" + block_name, params);
206 const std::string kernel_type =
"LinearFVSource";
208 params.
set<LinearVariableName>(
"variable") =
211 params.
set<MooseFunctorName>(
"source_density") =
212 getParam<MooseFunctorName>(
"external_heat_source");
213 params.
set<MooseFunctorName>(
"scaling_factor") =
214 std::to_string(getParam<Real>(
"external_heat_source_coeff"));
231 const auto var_type =
"MooseLinearVariableFVReal";
239 ") supplied to the WCNSLinearFVFluidHeatTransferPhysics does not exist!");
249 const std::string kernel_type =
"FunctorAux";
253 params.
set<MooseFunctorName>(
"functor") =
"T_from_p_h";
268 ") should be the same size as inlet_boundaries (size " +
269 std::to_string(inlet_boundaries.size()) +
")");
273 ") should be the same size as inlet_boundaries (size " +
274 std::to_string(inlet_boundaries.size()) +
")");
280 const std::string bc_type =
"LinearFVAdvectionDiffusionFunctorDirichletBC";
284 params.
set<std::vector<BoundaryName>>(
"boundary") = {inlet_boundaries[bc_ind]};
293 params.
set<MooseFunctorName>(
"functor") =
"h_from_p_T";
299 paramError(
"energy_inlet_types",
"Heat flux inlet boundary conditions not yet supported");
302 paramError(
"energy_inlet_types",
"Flux inlet boundary conditions not yet supported");
310 ? getParam<std::vector<BoundaryName>>(
"energy_wall_boundaries")
315 ") should be the same size as wall_boundaries (size " +
316 std::to_string(wall_boundaries.size()) +
")");
320 ") should be the same size as wall_boundaries (size " +
321 std::to_string(wall_boundaries.size()) +
")");
327 const std::string bc_type =
"LinearFVAdvectionDiffusionFunctorDirichletBC";
331 params.
set<std::vector<BoundaryName>>(
"boundary") = {wall_boundaries[bc_ind]};
340 params.
set<MooseFunctorName>(
"functor") =
"h_from_p_T";
347 const std::string bc_type =
"LinearFVAdvectionDiffusionFunctorNeumannBC";
350 params.
set<LinearVariableName>(
"variable") = var_name;
352 params.
set<std::vector<BoundaryName>>(
"boundary") = {wall_boundaries[bc_ind]};
355 bc_type, var_name +
"_heatflux_" + wall_boundaries[bc_ind], params);
359 const std::string bc_type =
"LinearFVConvectiveHeatTransferBC";
361 params.
set<LinearVariableName>(
"variable") =
364 const auto Tinf_htc_functors =
366 if (Tinf_htc_functors.size() != 2)
368 "'convection' wall types require two functors specified as " 369 "<Tinf_functor>:<htc_functor>.");
371 params.
set<MooseFunctorName>(
"h") = Tinf_htc_functors[1];
372 params.
set<std::vector<BoundaryName>>(
"boundary") = {wall_boundaries[bc_ind]};
377 wall_boundaries[bc_ind],
382 "energy_wall_types",
_energy_wall_types[bc_ind],
" wall type is currently unsupported.");
390 if (outlet_boundaries.empty())
393 for (
const auto & outlet_bdy : outlet_boundaries)
395 const std::string bc_type =
"LinearFVAdvectionDiffusionOutflowBC";
398 params.
set<std::vector<BoundaryName>>(
"boundary") = {outlet_bdy};
399 params.
set<
bool>(
"use_two_term_expansion") = getParam<bool>(
"energy_two_term_bc_expansion");
401 params.
set<LinearVariableName>(
"variable") = variable_name;
414 const auto object_type =
"LinearFVEnthalpyFunctorMaterial";
431 "Either 'fp' must be specified or the 'h_from_p_T_functor' and " 432 "'T_from_p_h_functor' must be defined outside the Physics");
434 params.
set<MooseFunctorName>(
"h_from_p_T_functor") =
"h_from_p_T_functor";
435 params.
set<MooseFunctorName>(
"T_from_p_h_functor") =
"T_from_p_h_functor";
std::string prefix() const
WCNSLinearFVFluidHeatTransferPhysics(const InputParameters ¶meters)
virtual void addMaterials() override
MooseFunctorName _specific_heat_name
Name of the specific heat material property.
void defineKOverCpFunctors(const bool use_ad)
Define the k/cp diffusion coefficients when solving for enthalpy.
void assignBlocks(InputParameters ¶ms, const std::vector< SubdomainName > &blocks) const
bool shouldCreateVariable(const VariableName &var_name, const std::vector< SubdomainName > &blocks, const bool error_if_aux)
const MooseFunctorName _density_name
Name of the density material property.
virtual void addAuxiliaryVariables() override
void paramError(const std::string ¶m, Args... args) const
const std::vector< BoundaryName > & getOutletBoundaries() const
Get the outlet boundaries.
registerNavierStokesPhysicsBaseTasks("NavierStokesApp", WCNSLinearFVFluidHeatTransferPhysics)
const std::vector< BoundaryName > & getInletBoundaries() const
Get the inlet boundaries.
std::vector< MooseFunctorName > _ambient_temperature
Name of the solid domain temperature for each block-group.
virtual void addMaterial(const std::string &material_name, const std::string &name, InputParameters ¶meters)
static const std::string T_solid
void addEnergyWallBC() override
InputParameters getValidParams(const std::string &name) const
const std::vector< SubdomainName > & blocks() const
unsigned int size() const
static const std::string fluid
virtual void addAuxKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
VariableName _fluid_temperature_name
Fluid temperature name.
virtual void addAuxVariable(const std::string &var_type, const std::string &var_name, InputParameters ¶ms)
std::vector< std::vector< SubdomainName > > _ambient_convection_blocks
Vector of subdomain groups where we want to have different ambient convection.
MultiMooseEnum _energy_wall_types
Energy wall boundary types.
std::vector< SubdomainName > _blocks
std::vector< MooseFunctorName > _energy_wall_functors
Functors describing the wall boundary values. See energy_wall_types for what the functors actually re...
MultiMooseEnum _energy_inlet_types
Energy inlet boundary types.
virtual FEProblemBase & getProblem()
registerMooseAction("NavierStokesApp", WCNSLinearFVFluidHeatTransferPhysics, "add_aux_variable")
static InputParameters validParams()
virtual UserObjectName rhieChowUOName() const =0
Return the name of the Rhie Chow user object.
const SolverSystemName & getSolverSystem(unsigned int variable_index) const
static const std::string T_fluid
void addEnergyTimeKernels() override
Functions adding kernels for the incompressible / weakly compressible energy equation.
Creates all the objects needed to solve the Navier Stokes energy equation.
const bool _porous_medium_treatment
Switch to show if porous medium treatment is requested or not.
virtual void addAuxiliaryKernels() override
std::string stringify(const T &t)
const VariableName _fluid_enthalpy_name
Name of the fluid specific enthalpy.
virtual void addVariable(const std::string &var_type, const std::string &var_name, InputParameters ¶ms)
const bool _has_energy_equation
A boolean to help compatibility with the old Modules/NavierStokesFV syntax.
Creates all the objects needed to solve the Navier Stokes energy equation using a linear finite volum...
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
bool _define_variables
Whether to define variables if they do not exist.
virtual void addLinearFVKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
std::vector< std::vector< SubdomainName > > _thermal_conductivity_blocks
Vector of subdomain groups where we want to have different thermal conduction.
const ExecFlagType EXEC_NONLINEAR
void addEnergyAmbientConvection() override
void addEnergyOutletBC() override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
bool processThermalConductivity()
Process thermal conductivity (multiple functor input options are available).
std::vector< MooseFunctorName > _energy_inlet_functors
Functors describing the inlet boundary values. See energy_inlet_types for what the functors actually ...
virtual void addLinearFVBC(const std::string &fv_bc_name, const std::string &name, InputParameters ¶meters)
static const std::string pressure
static InputParameters validParams()
std::vector< MooseFunctorName > _thermal_conductivity_name
Name of the thermal conductivity functor for each block-group.
IntRange< T > make_range(T beg, T end)
const bool _solve_for_enthalpy
User-selected option to solve for enthalpy.
void addEnergyInletBC() override
Functions adding boundary conditions for the incompressible / weakly compressible energy equation...
void addEnergyAdvectionKernels() override
registerWCNSFVFluidHeatTransferPhysicsBaseTasks("NavierStokesApp", WCNSLinearFVFluidHeatTransferPhysics)
std::vector< MooseFunctorName > _ambient_convection_alpha
Name of the ambient convection heat transfer coefficients for each block-group.
bool isParamValid(const std::string &name) const
void addEnergyHeatConductionKernels() override
void reportPotentiallyMissedParameters(const std::vector< std::string > ¶m_names, const std::string &object_type) const
void addEnergyExternalHeatSource() override
bool hasFunctor(const std::string &name, const THREAD_ID tid) const
std::vector< std::string > split(const std::string &str, const std::string &delimiter, std::size_t max_count)
bool isParamSetByUser(const std::string &name) const
const WCNSFVFlowPhysicsBase * _flow_equations_physics
Flow physics.
auto index_range(const T &sizable)
virtual void addSolverVariables() override
const std::vector< BoundaryName > & getWallBoundaries() const
Get the wall boundaries.
static const std::string specific_enthalpy
const NonlinearVariableName & getPressureName() const