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";
142 params.
set<MooseFunctorName>(
"diffusion_coeff") =
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";
241 ") supplied to the WCNSLinearFVFluidHeatTransferPhysics does not exist!");
251 const std::string kernel_type =
"FunctorAux";
255 params.
set<MooseFunctorName>(
"functor") =
"T_from_p_h";
270 ") should be the same size as inlet_boundaries (size " +
271 std::to_string(inlet_boundaries.size()) +
")");
275 ") should be the same size as inlet_boundaries (size " +
276 std::to_string(inlet_boundaries.size()) +
")");
282 const std::string bc_type =
"LinearFVAdvectionDiffusionFunctorDirichletBC";
286 params.
set<std::vector<BoundaryName>>(
"boundary") = {inlet_boundaries[bc_ind]};
295 params.
set<MooseFunctorName>(
"functor") =
"h_from_p_T";
301 paramError(
"energy_inlet_types",
"Heat flux inlet boundary conditions not yet supported");
304 paramError(
"energy_inlet_types",
"Flux inlet boundary conditions not yet supported");
312 ? getParam<std::vector<BoundaryName>>(
"energy_wall_boundaries")
317 ") should be the same size as wall_boundaries (size " +
318 std::to_string(wall_boundaries.size()) +
")");
322 ") should be the same size as wall_boundaries (size " +
323 std::to_string(wall_boundaries.size()) +
")");
329 const std::string bc_type =
"LinearFVAdvectionDiffusionFunctorDirichletBC";
333 params.
set<std::vector<BoundaryName>>(
"boundary") = {wall_boundaries[bc_ind]};
342 params.
set<MooseFunctorName>(
"functor") =
"h_from_p_T";
349 const std::string bc_type =
"LinearFVAdvectionDiffusionFunctorNeumannBC";
352 params.
set<LinearVariableName>(
"variable") = var_name;
354 params.
set<std::vector<BoundaryName>>(
"boundary") = {wall_boundaries[bc_ind]};
357 bc_type, var_name +
"_heatflux_" + wall_boundaries[bc_ind], params);
361 const std::string bc_type =
"LinearFVConvectiveHeatTransferBC";
363 params.
set<LinearVariableName>(
"variable") =
366 const auto Tinf_htc_functors =
368 if (Tinf_htc_functors.size() != 2)
370 "'convection' wall types require two functors specified as " 371 "<Tinf_functor>:<htc_functor>.");
373 params.
set<MooseFunctorName>(
"h") = Tinf_htc_functors[1];
374 params.
set<std::vector<BoundaryName>>(
"boundary") = {wall_boundaries[bc_ind]};
379 wall_boundaries[bc_ind],
384 "energy_wall_types",
_energy_wall_types[bc_ind],
" wall type is currently unsupported.");
392 if (outlet_boundaries.empty())
395 for (
const auto & outlet_bdy : outlet_boundaries)
397 const std::string bc_type =
"LinearFVAdvectionDiffusionOutflowBC";
400 params.
set<std::vector<BoundaryName>>(
"boundary") = {outlet_bdy};
401 params.
set<
bool>(
"use_two_term_expansion") = getParam<bool>(
"energy_two_term_bc_expansion");
403 params.
set<LinearVariableName>(
"variable") = variable_name;
416 const auto object_type =
"LinearFVEnthalpyFunctorMaterial";
433 "Either 'fp' must be specified or the 'h_from_p_T_functor' and " 434 "'T_from_p_h_functor' must be defined outside the Physics");
436 params.
set<MooseFunctorName>(
"h_from_p_T_functor") =
"h_from_p_T_functor";
437 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 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
void reportPotentiallyMissedParameters(const std::vector< std::string > ¶m_names, const std::string &object_type, const std::string &object_name="") const
unsigned int size() const
static const std::string fluid
bool _has_turbulence_model
Because of the Modules/navierStokesFV syntax, a turbulence physics often exists without a model we sa...
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()
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()
const UserObjectName & rhieChowUOName() const
Return the name of the Rhie Chow user object.
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 addEnergyExternalHeatSource() override
void defineEffectiveThermalDiffusionCoeffFunctors(const bool use_ad)
Define the effective diffusion coefficient when:
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