https://mooseframework.inl.gov
WCNSFVFlowPhysicsBase.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "WCNSFVFlowPhysicsBase.h"
13 #include "NSFVBase.h"
14 #include "MapConversionUtils.h"
15 #include "NS.h"
16 
19 {
21  params.addClassDescription("Base class for Physics defining the Navier Stokes flow equations");
22 
24  params.addParam<bool>("add_flow_equations",
25  true,
26  "Whether to add the flow equations. This parameter is not necessary when "
27  "using the Physics syntax");
28 
29  // We pull in parameters from various flow objects. This helps make sure the parameters are
30  // spelled the same way and match the evolution of other objects.
31  // If we remove these objects, or change their parameters, these parameters should be updated
32  // Downstream actions must either implement all these options, or redefine the parameter with
33  // a restricted MooseEnum, or place an error in the constructor for unsupported configurations
34  // We mostly pull the boundary parameters from NSFV Action
35 
37  params.addParam<bool>(
38  "include_deviatoric_stress",
39  false,
40  "Whether to include the full expansion (the transposed term as well) of the stress tensor");
41 
42  // Momentum boundary conditions are important for advection problems as well
44 
45  // Specify the weakly compressible boundary flux information. They are used for specifying in flux
46  // boundary conditions for advection physics in WCNSFV
48  params.addParam<std::vector<std::vector<MooseFunctorName>>>(
49  "momentum_wall_functors",
50  {},
51  "Functors for each component of the velocity value on walls. This is only necessary for the "
52  "fixed-velocity momentum wall types.");
53 
54  // Most downstream physics implementations are valid for porous media too
55  // If yours is not, please remember to disable the 'porous_medium_treatment' parameter
56  params.transferParam<bool>(NSFVBase::validParams(), "porous_medium_treatment");
57  params.transferParam<MooseFunctorName>(NSFVBase::validParams(), "porosity");
58 
59  // Initialization parameters
60  params.transferParam<std::vector<FunctionName>>(NSFVBase::validParams(), "initial_velocity");
61  params.transferParam<FunctionName>(NSFVBase::validParams(), "initial_pressure");
62 
63  // Spatial discretization scheme
64  // Specify the numerical schemes for interpolations of velocity and pressure
65  params.transferParam<MooseEnum>(NSFVBase::validParams(), "velocity_interpolation");
66  params.transferParam<MooseEnum>(NSFVBase::validParams(), "momentum_advection_interpolation");
67  params.transferParam<MooseEnum>(NSFVBase::validParams(), "momentum_face_interpolation");
68  params.transferParam<bool>(NSFVBase::validParams(), "momentum_two_term_bc_expansion");
69  params.transferParam<bool>(NSFVBase::validParams(), "pressure_two_term_bc_expansion");
70  MooseEnum coeff_interp_method("average harmonic", "harmonic");
71  params.addParam<MooseEnum>("mu_interp_method",
72  coeff_interp_method,
73  "Switch that can select face interpolation method for the viscosity.");
74 
75  // Fluid properties
76  params.addParam<UserObjectName>(NS::fluid, "Fluid properties userobject");
77  params.addParam<FunctionName>(
78  "mu_rampdown", 1, "A function describing a ramp down of viscosity over time");
79  params.addParamNamesToGroup(NS::fluid + " mu_rampdown", "Material properties");
80 
81  // Parameter groups
82  params.addParamNamesToGroup(
83  "velocity_variable pressure_variable initial_pressure initial_velocity", "Variables");
84  params.addParamNamesToGroup("density dynamic_viscosity", "Material properties");
85  params.addParamNamesToGroup("inlet_boundaries momentum_inlet_types momentum_inlet_functors",
86  "Inlet boundary conditions");
87  params.addParamNamesToGroup("outlet_boundaries momentum_outlet_types pressure_functors",
88  "Outlet boundary conditions");
89  params.addParamNamesToGroup("wall_boundaries momentum_wall_types momentum_wall_functors",
90  "Wall boundary conditions");
91  params.addParamNamesToGroup(
92  "include_deviatoric_stress velocity_interpolation momentum_advection_interpolation "
93  "momentum_two_term_bc_expansion pressure_two_term_bc_expansion mu_interp_method "
94  "momentum_face_interpolation",
95  "Numerical scheme");
96  params.addParamNamesToGroup("thermal_expansion", "Gravity treatment");
97 
98  return params;
99 }
100 
102  : NavierStokesPhysicsBase(parameters),
103  _has_flow_equations(getParam<bool>("add_flow_equations")),
104  _compressibility(getParam<MooseEnum>("compressibility")),
105  _solve_for_dynamic_pressure(getParam<bool>("solve_for_dynamic_pressure")),
106  _porous_medium_treatment(getParam<bool>("porous_medium_treatment")),
107  _porosity_name(getParam<MooseFunctorName>("porosity")),
108  _flow_porosity_functor_name(_porosity_name),
109  _velocity_names(
110  isParamValid("velocity_variable")
111  ? getParam<std::vector<std::string>>("velocity_variable")
112  : (_porous_medium_treatment
113  ? std::vector<std::string>(NS::superficial_velocity_vector,
115  : std::vector<std::string>(NS::velocity_vector, NS::velocity_vector + 3))),
116  _pressure_name(isParamValid("pressure_variable")
117  ? getParam<NonlinearVariableName>("pressure_variable")
118  : NS::pressure),
119  _fluid_temperature_name(isParamValid("fluid_temperature_variable")
120  ? getParam<NonlinearVariableName>("fluid_temperature_variable")
121  : NS::T_fluid),
122  _density_name(getParam<MooseFunctorName>("density")),
123  _density_gravity_name(isParamValid("density_gravity")
124  ? getParam<MooseFunctorName>("density_gravity")
125  : getParam<MooseFunctorName>("density")),
126  _dynamic_viscosity_name(getParam<MooseFunctorName>("dynamic_viscosity")),
127  _velocity_interpolation(getParam<MooseEnum>("velocity_interpolation")),
128  _momentum_advection_interpolation(getParam<MooseEnum>("momentum_advection_interpolation")),
129  _momentum_face_interpolation(getParam<MooseEnum>("momentum_face_interpolation")),
130  _friction_blocks(getParam<std::vector<std::vector<SubdomainName>>>("friction_blocks")),
131  _friction_types(getParam<std::vector<std::vector<std::string>>>("friction_types")),
132  _friction_coeffs(getParam<std::vector<std::vector<std::string>>>("friction_coeffs")),
133  _inlet_boundaries(getParam<std::vector<BoundaryName>>("inlet_boundaries")),
134  _outlet_boundaries(getParam<std::vector<BoundaryName>>("outlet_boundaries")),
135  _wall_boundaries(getParam<std::vector<BoundaryName>>("wall_boundaries")),
136  _hydraulic_separators(getParam<std::vector<BoundaryName>>("hydraulic_separator_sidesets")),
137  _flux_inlet_pps(getParam<std::vector<PostprocessorName>>("flux_inlet_pps")),
138  _flux_inlet_directions(getParam<std::vector<Point>>("flux_inlet_directions"))
139 {
140  // Inlet boundary parameter checking
141  checkSecondParamSetOnlyIfFirstOneSet("flux_inlet_pps", "flux_inlet_directions");
142  if (_flux_inlet_directions.size())
143  checkVectorParamsSameLengthIfSet<PostprocessorName, Point>("flux_inlet_pps",
144  "flux_inlet_directions");
145 
146  // Boussinesq parameters checks
147  checkSecondParamSetOnlyIfFirstOneTrue("boussinesq_approximation", "ref_temperature");
148  checkSecondParamSetOnlyIfFirstOneSet("gravity", "boussinesq_approximation");
149 
150  // Dynamic pressure parameter checks
151  if (_compressibility != "incompressible" && _solve_for_dynamic_pressure)
152  paramError("compressibility",
153  "Solving for dynamic pressure is only implemented for incompressible flow");
154 
155  // Boundary parameters checking
156  checkVectorParamAndMultiMooseEnumLength<BoundaryName>("inlet_boundaries", "momentum_inlet_types");
157  checkVectorParamAndMultiMooseEnumLength<BoundaryName>("outlet_boundaries",
158  "momentum_outlet_types");
159  checkVectorParamAndMultiMooseEnumLength<BoundaryName>("wall_boundaries", "momentum_wall_types");
161  std::vector<MooseFunctorName>,
162  PostprocessorName>(
163  "inlet_boundaries", "momentum_inlet_functors", "flux_inlet_pps");
164  checkVectorParamsNoOverlap<BoundaryName>(
165  {"inlet_boundaries", "outlet_boundaries", "wall_boundaries"});
166 
167  // Porous media parameters
168  checkSecondParamSetOnlyIfFirstOneTrue("porous_medium_treatment", "porosity");
169 
171  for (const auto & name : NS::velocity_vector)
172  {
173  const auto & it = std::find(_velocity_names.begin(), _velocity_names.end(), name);
174  if (it != _velocity_names.end())
175  paramError("velocity_variable",
176  "For porous medium simulations, functor name " + *it +
177  " is already reserved for the automatically-computed interstitial velocity. "
178  "Please choose another name for your external velocity variable!");
179  }
180 
181  // Friction parameter checks
182  if (_friction_blocks.size())
183  checkVectorParamsSameLength<std::vector<SubdomainName>, std::vector<std::string>>(
184  "friction_blocks", "friction_types");
185  checkTwoDVectorParamsSameLength<std::string, std::string>("friction_types", "friction_coeffs");
186 
187  // Create maps for boundary-restricted parameters
188  _momentum_inlet_types = Moose::createMapFromVectorAndMultiMooseEnum<BoundaryName>(
189  _inlet_boundaries, getParam<MultiMooseEnum>("momentum_inlet_types"));
190  _momentum_outlet_types = Moose::createMapFromVectorAndMultiMooseEnum<BoundaryName>(
191  _outlet_boundaries, getParam<MultiMooseEnum>("momentum_outlet_types"));
192  _momentum_wall_types = Moose::createMapFromVectorAndMultiMooseEnum<BoundaryName>(
193  _wall_boundaries, getParam<MultiMooseEnum>("momentum_wall_types"));
194  if (isParamSetByUser("momentum_inlet_functors"))
195  {
196  // Not all inlet boundary types require the specification of an inlet functor
197  std::vector<BoundaryName> inlet_boundaries_with_functors;
198  for (const auto & boundary : _inlet_boundaries)
199  if (libmesh_map_find(_momentum_inlet_types, boundary) == "fixed-velocity" ||
200  libmesh_map_find(_momentum_inlet_types, boundary) == "fixed-pressure")
201  inlet_boundaries_with_functors.push_back(boundary);
203  Moose::createMapFromVectors<BoundaryName, std::vector<MooseFunctorName>>(
204  inlet_boundaries_with_functors,
205  getParam<std::vector<std::vector<MooseFunctorName>>>("momentum_inlet_functors"));
206  }
207  if (isParamSetByUser("pressure_functors"))
208  {
209  // Not all outlet boundary types require the specification of an inlet functor
210  std::vector<BoundaryName> outlet_boundaries_with_functors;
211  for (const auto & boundary : _outlet_boundaries)
212  if (libmesh_map_find(_momentum_outlet_types, boundary) == "fixed-pressure-zero-gradient" ||
213  libmesh_map_find(_momentum_outlet_types, boundary) == "fixed-pressure")
214  outlet_boundaries_with_functors.push_back(boundary);
215  const auto & pressure_functors = getParam<std::vector<MooseFunctorName>>("pressure_functors");
216  if (outlet_boundaries_with_functors.size() != pressure_functors.size())
217  paramError("pressure_functors",
218  "Size (" + std::to_string(pressure_functors.size()) +
219  ") is not the same as the number of pressure outlet boundaries in "
220  "'fixed-pressure/fixed-pressure-zero-gradient' (size " +
221  std::to_string(outlet_boundaries_with_functors.size()) + ")");
222  _pressure_functors = Moose::createMapFromVectors<BoundaryName, MooseFunctorName>(
223  outlet_boundaries_with_functors, pressure_functors);
224  }
225 
226  if (isParamSetByUser("momentum_wall_functors"))
227  {
228  // Not all wall boundary types require the specification of an inlet functor
229  std::vector<BoundaryName> wall_boundaries_with_functors;
230  for (const auto & boundary : _wall_boundaries)
231  if (libmesh_map_find(_momentum_wall_types, boundary) == "noslip")
232  wall_boundaries_with_functors.push_back(boundary);
233  const auto & momentum_wall_functors =
234  getParam<std::vector<std::vector<MooseFunctorName>>>("momentum_wall_functors");
235  if (wall_boundaries_with_functors.size() != momentum_wall_functors.size())
236  paramError("momentum_wall_functors",
237  "Size (" + std::to_string(momentum_wall_functors.size()) +
238  ") is not the same as the number of momentum_wall wall boundaries with "
239  "no-slip boundary conditions ' (size " +
240  std::to_string(wall_boundaries_with_functors.size()) + ")");
241 
243  Moose::createMapFromVectors<BoundaryName, std::vector<MooseFunctorName>>(
244  wall_boundaries_with_functors, momentum_wall_functors);
245  }
246 }
247 
248 void
250 {
251  getProblem().needFV();
252 }
253 
254 void
256 {
257  // Turbulence physics would not be initialized before this task
258  if (_current_task == "get_turbulence_physics")
260 }
261 
262 void
264 {
265  addInletBC();
266  addOutletBC();
267  addWallsBC();
268  addSeparatorBC();
269 }
270 
271 void
273 {
276  else
278 
279  if (isParamValid(NS::fluid))
281 }
282 
283 void
285 {
286  InputParameters params = getFactory().getValidParams("PINSFVSpeedFunctorMaterial");
287  assignBlocks(params, _blocks);
288 
289  for (unsigned int dim_i = 0; dim_i < dimension(); ++dim_i)
290  params.set<MooseFunctorName>(NS::superficial_velocity_vector[dim_i]) = _velocity_names[dim_i];
292  params.set<MooseFunctorName>(NS::porosity) = _flow_porosity_functor_name;
293  else
294  params.set<MooseFunctorName>(NS::porosity) = "1";
295  params.set<bool>("define_interstitial_velocity_components") = _porous_medium_treatment;
296 
298  "PINSFVSpeedFunctorMaterial", prefix() + "pins_speed_material", params);
299 }
300 
301 void
303 {
304  const std::string class_name = "ADVectorMagnitudeFunctorMaterial";
305  InputParameters params = getFactory().getValidParams(class_name);
306  assignBlocks(params, _blocks);
307 
308  const std::vector<std::string> param_names{"x_functor", "y_functor", "z_functor"};
309  for (unsigned int dim_i = 0; dim_i < dimension(); ++dim_i)
310  params.set<MooseFunctorName>(param_names[dim_i]) = _velocity_names[dim_i];
311  params.set<MooseFunctorName>("vector_magnitude_name") = NS::speed;
312 
313  getProblem().addFunctorMaterial(class_name, prefix() + "ins_speed_material", params);
314 }
315 
316 void
318 {
319  // Not very future-proof but it works
320  const bool use_ad = !dynamic_cast<WCNSLinearFVFlowPhysics *>(this);
321  const std::string class_name =
322  use_ad ? "GeneralFunctorFluidProps" : "NonADGeneralFunctorFluidProps";
323  InputParameters params = getFactory().getValidParams(class_name);
324  assignBlocks(params, _blocks);
325 
326  params.set<MooseFunctorName>(NS::pressure) = _pressure_name;
327  params.set<MooseFunctorName>(NS::T_fluid) = _fluid_temperature_name;
328  params.set<MooseFunctorName>(NS::speed) = NS::speed;
329  params.applySpecificParameters(parameters(), {NS::fluid, NS::density, "mu_rampdown"});
331  params.set<bool>("force_define_density") = true;
333  {
334  params.set<MooseFunctorName>(NS::porosity) = "1";
335  params.set<MooseFunctorName>("characteristic_length") = "1";
336  }
337  else
338  // not implemented yet
339  paramWarning(
340  NS::fluid,
341  "Specifying the fluid properties user object does not define the GeneralFunctorFluidProps "
342  "when using the porous medium treatment. You have to define this object in the input");
343 
344  // Dynamic pressure
345  params.set<bool>("solving_for_dynamic_pressure") = _solve_for_dynamic_pressure;
347  {
348  params.set<Point>("reference_pressure_point") = getParam<Point>("reference_pressure_point");
349  if (!isParamSetByUser("reference_pressure_point"))
350  paramWarning("reference_pressure_point",
351  "Default value of (0,0,0) used. If this point is outside the flow domain, the "
352  "simulation will error");
353  params.set<Real>("reference_pressure") = getParam<Real>("reference_pressure");
354  }
355  params.set<Point>("gravity") = getParam<RealVectorValue>("gravity");
356 
358  getProblem().addFunctorMaterial(class_name, prefix() + "functor_fluidprops", params);
359 }
360 
361 void
363 {
364  if (!_define_variables && parameters().isParamSetByUser("initial_velocity") &&
365  parameters().isParamSetByUser("velocity_variable") &&
366  getParam<std::vector<FunctionName>>("initial_velocity").size() != 0)
367  // TODO: Rework and remove this last statement once the NSFV action is removed
368  paramError("initial_velocity",
369  "Velocity is defined externally of WCNSFVFlowPhysicsBase, so should the inital "
370  "conditions");
371  if (!_define_variables && parameters().isParamSetByUser("initial_pressure") &&
372  parameters().isParamSetByUser("pressure_variable"))
373  paramError("initial_pressure",
374  "Pressure is defined externally of WCNSFVFlowPhysicsBase, so should the inital "
375  "condition");
376 
377  // Check dimension
378  if (getParam<std::vector<FunctionName>>("initial_velocity").size() != dimension() &&
379  getParam<std::vector<FunctionName>>("initial_velocity").size() != 3 &&
380  getParam<std::vector<FunctionName>>("initial_velocity").size() != 0)
381  // TODO: Rework and remove this last statement once the NSFV action is removed
382  paramError("initial_velocity",
383  "The number of velocity components in the " + type() + " initial condition is not " +
384  std::to_string(dimension()) + " or 3!");
385 
386  InputParameters params = getFactory().getValidParams("FunctionIC");
387  assignBlocks(params, _blocks);
388  auto vvalue = getParam<std::vector<FunctionName>>("initial_velocity");
389 
390  for (const auto d : make_range(dimension()))
391  {
392  params.set<VariableName>("variable") = _velocity_names[d];
393  params.set<FunctionName>("function") = vvalue[d];
394 
396  _blocks,
397  /*whether IC is a default*/ !isParamSetByUser("initial_velocity"),
398  /*error if already an IC*/ isParamSetByUser("initial_velocity")))
399  getProblem().addInitialCondition("FunctionIC", prefix() + _velocity_names[d] + "_ic", params);
400  }
401 
403  _blocks,
404  /*whether IC is a default*/ !isParamSetByUser("initial_pressure"),
405  /*error if already an IC*/ isParamSetByUser("initial_pressure")))
406  {
407  params.set<VariableName>("variable") = _pressure_name;
408  params.set<FunctionName>("function") = getParam<FunctionName>("initial_pressure");
409 
410  getProblem().addInitialCondition("FunctionIC", prefix() + _pressure_name + "_ic", params);
411  }
412 }
413 
414 unsigned short
416 {
417  unsigned short ghost_layers = 2;
418  return ghost_layers;
419 }
420 
421 void
423 {
424  const auto momentum_inlet_types = getParam<MultiMooseEnum>("momentum_inlet_types");
425 
426  for (unsigned int bc_ind = 0; bc_ind < momentum_inlet_types.size(); ++bc_ind)
427  if (momentum_inlet_types[bc_ind] == "flux-mass" ||
428  momentum_inlet_types[bc_ind] == "flux-velocity")
429  {
430  const std::string pp_type = "AreaPostprocessor";
431  InputParameters params = getFactory().getValidParams(pp_type);
432  params.set<std::vector<BoundaryName>>("boundary") = {_inlet_boundaries[bc_ind]};
433  params.set<ExecFlagEnum>("execute_on") = EXEC_INITIAL;
434 
435  const auto name_pp = "area_pp_" + _inlet_boundaries[bc_ind];
436  if (!getProblem().hasUserObject(name_pp))
437  getProblem().addPostprocessor(pp_type, name_pp, params);
438  }
439 }
440 
441 VariableName
442 WCNSFVFlowPhysicsBase::getFlowVariableName(const std::string & short_name) const
443 {
444  if (short_name == NS::pressure)
445  return getPressureName();
446  else if (short_name == NS::velocity_x && dimension() > 0)
447  return getVelocityNames()[0];
448  else if (short_name == NS::velocity_y && dimension() > 1)
449  return getVelocityNames()[1];
450  else if (short_name == NS::velocity_z && dimension() > 2)
451  return getVelocityNames()[2];
452  else if (short_name == NS::temperature)
453  return getFluidTemperatureName();
454  else
455  mooseError("Short Variable name '", short_name, "' not recognized.");
456 }
457 
458 MooseFunctorName
460 {
461  if (smoothed)
463  else
464  return _porosity_name;
465 }
466 
469 {
470  // User passed it, just use that
471  if (isParamValid("coupled_turbulence_physics"))
472  return getCoupledPhysics<WCNSFVTurbulencePhysics>(
473  getParam<PhysicsName>("coupled_flow_physics"));
474  // Look for any physics of the right type, and check the block restriction
475  else
476  {
477  const auto all_turbulence_physics = getCoupledPhysics<const WCNSFVTurbulencePhysics>(true);
478  for (const auto physics : all_turbulence_physics)
480  physics->name(), physics->blocks(), /*error_if_not_identical=*/false))
481  return physics;
482  }
483  // Did not find one
484  return nullptr;
485 }
std::string prefix() const
Creates all the objects needed to solve the Navier-Stokes equations with the SIMPLE algorithm using t...
static InputParameters validParams()
Definition: NSFVBase.C:371
unsigned short getNumberAlgebraicGhostingLayersNeeded() const override
Return the number of algebraic ghosting layers needed.
const std::vector< std::string > & getVelocityNames() const
To interface with other Physics.
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
Creates all the objects needed to add a turbulence model to an incompressible / weakly-compressible N...
Factory & getFactory()
std::map< BoundaryName, MooseEnum > _momentum_inlet_types
Momentum inlet boundary types.
const std::vector< BoundaryName > _outlet_boundaries
Boundaries with a flow outlet specified on them.
void paramError(const std::string &param, Args... args) const
virtual void addSeparatorBC()=0
const T & getParam(const std::string &name) const
static const std::string speed
Definition: NS.h:143
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void applySpecificParameters(const InputParameters &common, const std::vector< std::string > &include, bool allow_private=false)
virtual void initializePhysicsAdditional() override
const MooseFunctorName _density_name
Name of the density material property.
virtual void needFV() override
virtual void addMaterials() override
const InputParameters & parameters() const
T & set(const std::string &name, bool quiet_mode=false)
static const std::string velocity_z
Definition: NS.h:48
virtual void actOnAdditionalTasks() override
static const std::string density
Definition: NS.h:33
InputParameters getValidParams(const std::string &name) const
const WCNSFVTurbulencePhysics * _turbulence_physics
Can be set to a coupled turbulence physics.
static const std::string fluid
Definition: NS.h:87
std::map< BoundaryName, std::vector< MooseFunctorName > > _momentum_inlet_functors
Functors describing the momentum inlet for each boundary.
virtual void addOutletBC()=0
virtual void addFunctorMaterial(const std::string &functor_material_name, const std::string &name, InputParameters &parameters)
std::map< BoundaryName, std::vector< MooseFunctorName > > _momentum_wall_functors
Functors describing the momentum for each wall boundary.
static const std::string velocity_x
Definition: NS.h:46
const NonlinearVariableName _pressure_name
Pressure name.
static const std::string temperature
Definition: NS.h:59
const MooseFunctorName _porosity_name
Name of the porosity functor.
virtual void addWallsBC()=0
bool hasUserObject(const std::string &name) const
bool shouldCreateIC(const VariableName &var_name, const std::vector< SubdomainName > &blocks, const bool ic_is_default_ic, const bool error_if_already_defined) const
static InputParameters validParams()
const bool _porous_medium_treatment
Whether to use the porous medium treatment.
std::vector< SubdomainName > _blocks
const std::vector< BoundaryName > _wall_boundaries
Boundaries which define a wall (slip/noslip/etc.)
virtual void addPostprocessors() override
unsigned int dimension() const
virtual void addInitialCondition(const std::string &ic_name, const std::string &name, InputParameters &parameters)
void checkSecondParamSetOnlyIfFirstOneSet(const std::string &param1, const std::string &param2) const
virtual FEProblemBase & getProblem()
virtual void addPostprocessor(const std::string &pp_name, const std::string &name, InputParameters &parameters)
static const std::string porosity
Definition: NS.h:104
static InputParameters validParams()
void checkVectorParamsSameLength(const std::string &param1, const std::string &param2) const
void checkVectorParamLengthSameAsCombinedOthers(const std::string &param1, const std::string &param2, const std::string &param3) const
const std::string & name() const
static InputParameters commonNavierStokesFlowParams()
Definition: NSFVBase.C:17
static const std::string T_fluid
Definition: NS.h:106
std::vector< std::vector< SubdomainName > > _friction_blocks
Subdomains where we want to have volumetric friction.
const NonlinearVariableName & getFluidTemperatureName() const
std::map< BoundaryName, MooseEnum > _momentum_outlet_types
Momentum outlet boundary types.
static const std::string superficial_velocity_vector[3]
Definition: NS.h:54
const std::vector< std::string > _velocity_names
Velocity names.
virtual void addInletBC()=0
Functions adding boundary conditions for the flow simulation.
MooseFunctorName getPorosityFunctorName(const bool smoothed) const
static InputParameters commonMomentumBoundaryFluxesParams()
Definition: NSFVBase.C:168
const std::string & type() const
const std::string & _current_task
static const std::string velocity_y
Definition: NS.h:47
const WCNSFVTurbulencePhysics * getCoupledTurbulencePhysics() const
Find the turbulence physics.
const bool _solve_for_dynamic_pressure
Whether we are solving for the total or dynamic pressure.
const MooseEnum _compressibility
Compressibility type, can be compressible, incompressible or weakly-compressible. ...
bool checkBlockRestrictionIdentical(const std::string &object_name, const std::vector< SubdomainName > &blocks, const bool error_if_not_identical=true) const
MooseFunctorName _flow_porosity_functor_name
Name of the porosity functor for the flow equations (if smoothed)
static InputParameters commonMomentumEquationParams()
Definition: NSFVBase.C:55
bool _define_variables
Whether to define variables if they do not exist.
void addPorousMediumSpeedMaterial()
Add material to define the local speed in porous medium flows.
std::map< BoundaryName, MooseEnum > _momentum_wall_types
Momentum wall boundary types.
const NonlinearVariableName _fluid_temperature_name
Fluid temperature name.
VariableName getFlowVariableName(const std::string &default_name) const
Convenience routine to be able to retrieve the actual variable names from their default names...
void addNonPorousMediumSpeedMaterial()
Add material to define the local speed with no porous medium treatment.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::map< BoundaryName, MooseFunctorName > _pressure_functors
Functors describing the outlet pressure on each boundary.
void addFluidPropertiesFunctorMaterial()
Function which adds the general functor fluid properties functor material to define fluid functor mat...
virtual bool hasForchheimerFriction() const =0
Return whether a Forchheimer friction model is in use.
static const std::string pressure
Definition: NS.h:56
IntRange< T > make_range(T beg, T end)
void mooseError(Args &&... args) const
virtual void addFVBCs() override
void addClassDescription(const std::string &doc_string)
virtual void addInitialConditions() override
WCNSFVFlowPhysicsBase(const InputParameters &parameters)
bool isParamValid(const std::string &name) const
Base class to hold common parameters and utilities between all the weakly compressible Navier Stokes-...
const std::vector< BoundaryName > _inlet_boundaries
Boundaries with a flow inlet specified on them.
void paramWarning(const std::string &param, Args... args) const
const std::string velocity_vector[3]
Definition: NS.h:49
std::vector< Point > _flux_inlet_directions
Direction of each flux inlet. Indexing based on the number of flux boundaries.
void checkSecondParamSetOnlyIfFirstOneTrue(const std::string &param1, const std::string &param2) const
bool parsesToReal(const std::string &input, Real *parsed_real)
bool isParamSetByUser(const std::string &name) const
static InputParameters commonMomentumBoundaryTypesParams()
Definition: NSFVBase.C:144
const ExecFlagType EXEC_INITIAL
const NonlinearVariableName & getPressureName() const