25 "check_bc_compatibility",
27 "Whether to check for known incompatibility between boundary conditions for "
28 "the heat transport equation physics and other physics");
48 const auto & solver_variable_name =
55 "energy_face_interpolation",
56 "energy_two_term_bc_expansion"},
57 "INSFVEnergyVariable");
62 params.set<std::vector<Real>>(
"scaling") = {getParam<Real>(
"energy_scaling")};
63 params.set<
MooseEnum>(
"face_interp_method") = getParam<MooseEnum>(
"energy_face_interpolation");
64 params.set<
bool>(
"two_term_boundary_expansion") =
65 getParam<bool>(
"energy_two_term_bc_expansion");
66 params.set<SolverSystemName>(
"solver_sys") =
getSolverSystem(solver_variable_name);
72 "Variable (" + solver_variable_name +
73 ") supplied to the WCNSFVFluidHeatTransferPhysics does not exist!");
79 std::string kernel_type =
81 :
"INSFVEnergyTimeDerivative");
82 std::string kernel_name =
86 kernel_type =
"PINSFVEnergyTimeDerivative";
91 const auto & solver_variable_name =
96 params.
set<NonlinearVariableName>(
"variable") = solver_variable_name;
116 params.
set<
bool>(
"is_solid") =
false;
125 std::string kernel_type =
"INSFVEnergyAdvection";
126 std::string kernel_name =
prefix() +
"ins_energy_advection";
129 kernel_type =
"PINSFVEnergyAdvection";
130 kernel_name =
prefix() +
"pins_energy_advection";
133 const auto & solver_variable_name =
137 params.
set<NonlinearVariableName>(
"variable") = solver_variable_name;
142 getParam<MooseEnum>(
"energy_advection_interpolation");
152 const auto num_used_blocks = num_blocks ? num_blocks : 1;
153 const auto & solver_variable_name =
156 for (
const auto block_i : make_range(num_used_blocks))
158 std::string block_name =
"";
166 const auto kernel_type =
167 vector_conductivity ?
"PINSFVEnergyAnisotropicDiffusion" :
"PINSFVEnergyDiffusion";
170 params.
set<NonlinearVariableName>(
"variable") = solver_variable_name;
173 const auto conductivity_name = vector_conductivity ?
NS::kappa :
NS::k;
176 params.
set<
bool>(
"effective_conductivity") = getParam<bool>(
"effective_conductivity");
180 params.
set<MooseFunctorName>(conductivity_name) =
184 kernel_type,
prefix() +
"pins_energy_diffusion_" + block_name, params);
188 const std::string kernel_type =
"FVDiffusion";
190 params.
set<NonlinearVariableName>(
"variable") = solver_variable_name;
191 std::vector<SubdomainName> block_names =
200 kernel_type,
prefix() +
"ins_energy_diffusion_" + block_name, params);
209 unsigned int num_used_blocks = num_convection_blocks ? num_convection_blocks : 1;
210 const auto & solver_variable_name =
213 const std::string kernel_type =
"PINSFVEnergyAmbientConvection";
215 params.
set<NonlinearVariableName>(
"variable") = solver_variable_name;
217 params.
set<
bool>(
"is_solid") =
false;
219 for (
unsigned int block_i = 0; block_i < num_used_blocks; ++block_i)
221 std::string block_name =
"";
222 if (num_convection_blocks)
230 block_name = std::to_string(block_i);
243 const auto & solver_variable_name =
245 const std::string kernel_type =
"FVCoupledForce";
247 params.
set<NonlinearVariableName>(
"variable") = solver_variable_name;
249 params.
set<MooseFunctorName>(
"v") = getParam<MooseFunctorName>(
"external_heat_source");
250 params.
set<Real>(
"coef") = getParam<Real>(
"external_heat_source_coeff");
264 ") should be the same size as inlet_boundaries (size " +
265 std::to_string(inlet_boundaries.size()) +
")");
269 ") should be the same size as inlet_boundaries (size " +
270 std::to_string(inlet_boundaries.size()) +
")");
272 const auto & solver_variable_name =
275 unsigned int flux_bc_counter = 0;
281 ?
"FVSpecificEnthalpyFromPressureTemperatureDirichletBC"
282 :
"FVADFunctorDirichletBC";
284 params.
set<NonlinearVariableName>(
"variable") = solver_variable_name;
294 params.
set<std::vector<BoundaryName>>(
"boundary") = {inlet_boundaries[bc_ind]};
296 getProblem().
addFVBC(bc_type, solver_variable_name +
"_" + inlet_boundaries[bc_ind], params);
299 const auto momentum_inlet_type =
301 if (getParam<bool>(
"check_bc_compatibility") &&
305 "At inlet '" + inlet_boundaries[bc_ind] +
306 "', you are using a Dirichlet boundary condition on temperature, and a "
307 "flux boundary condition on momentum. This is known to create an "
308 "undesirable inlet source term.");
312 const std::string bc_type =
"FVFunctionNeumannBC";
314 params.
set<NonlinearVariableName>(
"variable") = solver_variable_name;
316 params.
set<std::vector<BoundaryName>>(
"boundary") = {inlet_boundaries[bc_ind]};
318 getProblem().
addFVBC(bc_type, solver_variable_name +
"_" + inlet_boundaries[bc_ind], params);
323 const std::string bc_type =
"WCNSFVEnergyFluxBC";
325 params.
set<NonlinearVariableName>(
"variable") = solver_variable_name;
329 if (flux_inlet_pps.size() < flux_bc_counter)
332 "Should be specified for all 'flux-mass/velocity' boundary conditions");
334 if (flux_inlet_directions.size())
336 if (flux_inlet_directions.size() < flux_bc_counter)
338 "Should be specified for all or none of the "
339 "'flux-mass/velocity' boundary conditions");
340 params.
set<Point>(
"direction") = flux_inlet_directions[flux_bc_counter];
344 params.
set<PostprocessorName>(
"mdot_pp") = flux_inlet_pps[flux_bc_counter];
345 params.
set<PostprocessorName>(
"area_pp") =
"area_pp_" + inlet_boundaries[bc_ind];
348 params.
set<PostprocessorName>(
"velocity_pp") = flux_inlet_pps[flux_bc_counter];
367 params.
set<std::vector<BoundaryName>>(
"boundary") = {inlet_boundaries[bc_ind]};
369 getProblem().
addFVBC(bc_type, solver_variable_name +
"_" + inlet_boundaries[bc_ind], params);
370 flux_bc_counter += 1;
379 ? getParam<std::vector<BoundaryName>>(
"energy_wall_boundaries")
384 ") should be the same size as wall_boundaries (size " +
385 std::to_string(wall_boundaries.size()) +
")");
389 ") should be the same size as wall_boundaries (size " +
390 std::to_string(wall_boundaries.size()) +
")");
392 const auto & solver_variable_name =
400 ?
"FVSpecificEnthalpyFromPressureTemperatureDirichletBC"
401 :
"FVADFunctorDirichletBC";
403 params.
set<NonlinearVariableName>(
"variable") = solver_variable_name;
412 params.
set<std::vector<BoundaryName>>(
"boundary") = {wall_boundaries[bc_ind]};
414 getProblem().
addFVBC(bc_type, solver_variable_name +
"_" + wall_boundaries[bc_ind], params);
418 const std::string bc_type =
"FVFunctorNeumannBC";
420 params.
set<NonlinearVariableName>(
"variable") = solver_variable_name;
422 params.
set<std::vector<BoundaryName>>(
"boundary") = {wall_boundaries[bc_ind]};
424 getProblem().
addFVBC(bc_type, solver_variable_name +
"_" + wall_boundaries[bc_ind], params);
428 const std::string bc_type =
"FVFunctorConvectiveHeatFluxBC";
430 params.
set<NonlinearVariableName>(
"variable") = solver_variable_name;
432 params.
set<std::vector<BoundaryName>>(
"boundary") = {wall_boundaries[bc_ind]};
433 params.
set<
bool>(
"is_solid") =
false;
434 const auto Tinf_htc_functors =
436 if (Tinf_htc_functors.size() != 2)
438 "'convective' wall types require two functors specified as "
439 "<Tinf_functor>:<htc_functor>.");
440 params.
set<MooseFunctorName>(
"T_solid") = Tinf_htc_functors[0];
441 params.
set<MooseFunctorName>(
"heat_transfer_coefficient") = Tinf_htc_functors[1];
443 getProblem().
addFVBC(bc_type, solver_variable_name +
"_" + wall_boundaries[bc_ind], params);
452 "A coupled turbulence Physics was not found for defining the wall function "
453 "boundary condition on boundary: " +
454 wall_boundaries[bc_ind]);
455 const std::string bc_type =
"INSFVTurbulentTemperatureWallFunction";
457 params.
set<NonlinearVariableName>(
"variable") = solver_variable_name;
458 params.
set<std::vector<BoundaryName>>(
"boundary") = {wall_boundaries[bc_ind]};
466 mooseError(
"Several anisotropic thermal conductivity (kappa) regions have been specified. "
467 "Selecting the right kappa coefficient for the turbulence boundaries is not "
468 "currently implemented.\nBoundaries:\n" +
473 const std::string u_names[3] = {
"u",
"v",
"w"};
477 params.
set<
bool>(
"newton_solve") =
true;
482 "energy_wall_types",
_energy_wall_types[bc_ind],
" wall type is currently unsupported.");
494 const auto object_type =
"INSFVEnthalpyFunctorMaterial";
508 params.
set<
bool>(
"assumed_constant_cp") =
false;
523 params.
set<
bool>(
"assumed_constant_cp") =
false;
532 params.
set<std::vector<OutputName>>(
"outputs") = {
"all"};
547 const auto & solver_variable_name =
550 const std::string bc_type =
"INSFVScalarFieldSeparatorBC";
552 params.
set<NonlinearVariableName>(
"variable") = solver_variable_name;
553 params.
set<std::vector<BoundaryName>>(
"boundary") =
registerNavierStokesPhysicsBaseTasks("NavierStokesApp", WCNSFVFluidHeatTransferPhysics)
registerWCNSFVFluidHeatTransferPhysicsBaseTasks("NavierStokesApp", WCNSFVFluidHeatTransferPhysics)
virtual void addMaterial(const std::string &material_name, const std::string &name, InputParameters ¶meters)
virtual void addVariable(const std::string &var_type, const std::string &var_name, InputParameters ¶ms)
virtual void addFVBC(const std::string &fv_bc_name, const std::string &name, InputParameters ¶meters)
virtual void addFVKernel(const std::string &kernel_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
void mooseError(Args &&... args) const
bool isParamValid(const std::string &name) const
unsigned int size() const
static InputParameters validParams()
bool _define_variables
Whether to define variables if they do not exist.
virtual FEProblemBase & getProblem()
void assignBlocks(InputParameters ¶ms, const std::vector< SubdomainName > &blocks) const
unsigned int dimension() 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
const SolverSystemName & getSolverSystem(unsigned int variable_index) const
bool shouldCreateVariable(const VariableName &var_name, const std::vector< SubdomainName > &blocks, const bool error_if_aux)
std::vector< SubdomainName > _blocks
bool hasFunctor(const std::string &name, const THREAD_ID tid) const
const WCNSFVFlowPhysicsBase * _flow_equations_physics
Flow physics.
const WCNSFVTurbulencePhysicsBase * _turbulence_physics
Turbulence.
const MooseFunctorName _dynamic_viscosity_name
Name of the dynamic viscosity material property.
const std::vector< std::string > _velocity_names
Velocity names.
const MooseEnum _compressibility
Compressibility type, can be compressible, incompressible or weakly-compressible.
const bool _porous_medium_treatment
Switch to show if porous medium treatment is requested or not.
const MooseEnum _velocity_interpolation
The velocity / momentum face interpolation method for advecting other quantities.
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 > & getHydraulicSeparators() const
Get the hydraulic separator boundaries.
const std::vector< BoundaryName > & getInletBoundaries() const
Get the inlet boundaries.
MooseFunctorName getPorosityFunctorName(const bool smoothed) const
const std::vector< PostprocessorName > & getFluxInletPPs() const
Get the inlet flux postprocessor if using a flux inlet.
const std::vector< Point > & getFluxInletDirections() const
Get the inlet direction if using a flux inlet.
NS::MomentumInletTypes inletBoundaryType(const BoundaryName &boundary_name) const
Get the type of the inlet BC.
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.
void addEnergyWallBC() override
void addEnergyAdvectionKernels() override
void addEnergyAmbientConvection() override
void addEnergyExternalHeatSource() override
virtual void addSolverVariables() override
WCNSFVFluidHeatTransferPhysics(const InputParameters ¶meters)
void addEnergyTimeKernels() override
Functions adding kernels for the incompressible / weakly compressible energy equation If the material...
void addEnergyHeatConductionKernels() override
static InputParameters validParams()
void addEnergyInletBC() override
Functions adding boundary conditions for the incompressible simulation.
virtual void addMaterials() override
void addEnergySeparatorBC() override
std::vector< BoundaryName > turbulenceWalls() const
The names of the boundaries with turbulence wall functions.
MooseEnum turbulenceTemperatureWallTreatment() const
The turbulence temperature wall treatment (same for all turbulence walls currently)
MooseFunctorName tkeName() const
The name of the turbulent kinetic energy variable.
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 density
static const std::string T_fluid
static const std::string cp
static const std::string mu
const std::string velocity_vector[3]
static const std::string TKE
static const std::string k
static const std::string T_solid
static const std::string specific_enthalpy
static const std::string kappa
static const std::string porosity
std::string time_deriv(const std::string &var)
static const std::string fluid
static const std::string pressure