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";
506 params.
set<
bool>(
"assumed_constant_cp") =
false;
519 params.
set<
bool>(
"assumed_constant_cp") =
false;
527 params.
set<std::vector<OutputName>>(
"outputs") = {
"all"};
541 const auto & solver_variable_name =
544 const std::string bc_type =
"INSFVScalarFieldSeparatorBC";
546 params.
set<NonlinearVariableName>(
"variable") = solver_variable_name;
547 params.
set<std::vector<BoundaryName>>(
"boundary") =
std::string prefix() const
void addEnergyExternalHeatSource() override
static InputParameters validParams()
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.
Creates all the objects needed to solve the Navier Stokes energy equation.
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 addSolverVariables() override
void addEnergyHeatConductionKernels() override
void paramError(const std::string ¶m, Args... args) const
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 InputParameters validParams()
static const std::string T_solid
MooseEnum turbulenceTemperatureWallTreatment() const
The turbulence temperature wall treatment (same for all turbulence walls currently) ...
static const std::string density
InputParameters getValidParams(const std::string &name) const
static const std::string TKE
unsigned int size() const
static const std::string fluid
void addEnergySeparatorBC() override
VariableName _fluid_temperature_name
Fluid temperature name.
std::vector< std::vector< SubdomainName > > _ambient_convection_blocks
Vector of subdomain groups where we want to have different ambient convection.
const MooseFunctorName _dynamic_viscosity_name
Name of the dynamic viscosity material property.
MultiMooseEnum _energy_wall_types
Energy wall boundary types.
const std::vector< BoundaryName > & getHydraulicSeparators() const
Get the hydraulic separator boundaries.
std::vector< SubdomainName > _blocks
unsigned int dimension() const
std::vector< MooseFunctorName > _energy_wall_functors
Functors describing the wall boundary values. See energy_wall_types for what the functors actually re...
const WCNSFVTurbulencePhysics * _turbulence_physics
Turbulence.
MultiMooseEnum _energy_inlet_types
Energy inlet boundary types.
virtual FEProblemBase & getProblem()
static const std::string porosity
static const std::string cp
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
registerNavierStokesPhysicsBaseTasks("NavierStokesApp", WCNSFVFluidHeatTransferPhysics)
const MooseEnum _compressibility
Compressibility type, can be compressible, incompressible or weakly-compressible. ...
virtual void addMaterials() override
static const std::string mu
Creates all the objects needed to solve the Navier Stokes energy equation.
MooseFunctorName getPorosityFunctorName(const bool smoothed) const
const bool _porous_medium_treatment
Switch to show if porous medium treatment is requested or not.
const std::vector< PostprocessorName > & getFluxInletPPs() const
Get the inlet flux postprocessor if using a flux inlet.
NS::MomentumInletTypes inletBoundaryType(const BoundaryName &boundary_name) const
Get the type of the inlet BC.
std::string stringify(const T &t)
void addEnergyInletBC() override
Functions adding boundary conditions for the incompressible simulation.
WCNSFVFluidHeatTransferPhysics(const InputParameters ¶meters)
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.
bool _define_variables
Whether to define variables if they do not exist.
const std::vector< std::string > _velocity_names
Velocity names.
std::vector< std::vector< SubdomainName > > _thermal_conductivity_blocks
Vector of subdomain groups where we want to have different thermal conduction.
void addEnergyWallBC() override
static const std::string kappa
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 ...
void addEnergyAdvectionKernels() override
static const std::string pressure
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 mooseError(Args &&... args) const
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
MooseFunctorName tkeName() const
The name of the turbulent kinetic energy variable.
void reportPotentiallyMissedParameters(const std::vector< std::string > ¶m_names, const std::string &object_type) const
const std::string velocity_vector[3]
const std::vector< Point > & getFluxInletDirections() const
Get the inlet direction if using a flux inlet.
std::vector< std::string > split(const std::string &str, const std::string &delimiter, std::size_t max_count)
void addEnergyAmbientConvection() override
virtual void addFVKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
virtual void addFVBC(const std::string &fv_bc_name, const std::string &name, InputParameters ¶meters)
std::vector< BoundaryName > turbulenceWalls() const
The names of the boundaries with turbulence wall functions.
bool isParamSetByUser(const std::string &name) const
static const std::string k
const WCNSFVFlowPhysicsBase * _flow_equations_physics
Flow physics.
auto index_range(const T &sizable)
registerWCNSFVFluidHeatTransferPhysicsBaseTasks("NavierStokesApp", WCNSFVFluidHeatTransferPhysics)
const std::vector< BoundaryName > & getWallBoundaries() const
Get the wall boundaries.
std::string time_deriv(const std::string &var)
const MooseEnum _velocity_interpolation
The velocity / momentum face interpolation method for advecting other quantities. ...
static const std::string specific_enthalpy
void addEnergyTimeKernels() override
Functions adding kernels for the incompressible / weakly compressible energy equation If the material...
const NonlinearVariableName & getPressureName() const