https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
WCNSLinearFVFlowPhysics Class Referencefinal

Creates all the objects needed to solve the Navier-Stokes equations with the SIMPLE algorithm using the linear finite volume discretization Currently does not implement: More...

#include <WCNSLinearFVFlowPhysics.h>

Inheritance diagram for WCNSLinearFVFlowPhysics:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 WCNSLinearFVFlowPhysics (const InputParameters &parameters)
 
bool hasFlowEquations () const
 Whether the physics is actually creating the flow equations. More...
 
bool addAxisymmetricViscousSourceEnabled () const
 Whether the cylindrical viscous source helper is enabled. More...
 
bool includeSymmetrizedViscousStress () const
 Whether to include the symmetrized contribution in the viscous stress. More...
 
bool includeIsotropicStress () const
 Whether to include the isotropic viscous stress contribution. More...
 
const std::vector< std::string > & getVelocityNames () const
 To interface with other Physics. More...
 
const NonlinearVariableName & getPressureName () const
 
const NonlinearVariableName & getFluidTemperatureName () const
 
MooseFunctorName getPorosityFunctorName (const bool smoothed) const
 
const MooseEnumcompressibility () const
 Return the compressibility of the flow equations selected. More...
 
bool porousMediumTreatment () const
 Return whether a porous medium treatment is applied. More...
 
RealVectorValue gravityVector () const
 Return the gravity vector. More...
 
const MooseFunctorName & densityName () const
 Return the name of the density functor. More...
 
const MooseFunctorName & dynamicViscosityName () const
 Return the name of the dynamic viscosity functor. More...
 
const MooseEnumgetVelocityFaceInterpolationMethod () const
 Get the face interpolation method for velocity. More...
 
const MooseEnumgetMomentumAdvectionFaceInterpolationMethod () const
 Get the face interpolation method for momentum in the advection term. More...
 
const MooseEnumgetMomentumFaceInterpolationMethod () const
 Get the face interpolation method for momentum (mostly used in the stress terms) More...
 
const std::vector< BoundaryName > & getInletBoundaries () const
 Get the inlet boundaries. More...
 
const std::vector< BoundaryName > & getOutletBoundaries () const
 Get the outlet boundaries. More...
 
const std::vector< BoundaryName > & getWallBoundaries () const
 Get the wall boundaries. More...
 
const std::vector< BoundaryName > & getHydraulicSeparators () const
 Get the hydraulic separator boundaries. More...
 
NS::MomentumInletTypes inletBoundaryType (const BoundaryName &boundary_name) const
 Get the type of the inlet BC. More...
 
const std::vector< Point > & getFluxInletDirections () const
 Get the inlet direction if using a flux inlet. More...
 
const std::vector< PostprocessorName > & getFluxInletPPs () const
 Get the inlet flux postprocessor if using a flux inlet. More...
 
const UserObjectName & rhieChowUOName () const
 Return the name of the Rhie Chow user object. More...
 
virtual void act () override final
 
void addBlocks (const std::vector< SubdomainName > &blocks)
 
void addBlocksById (const std::vector< SubdomainID > &block_ids)
 
const std::vector< SubdomainName > & blocks () const
 
bool checkBlockRestrictionIdentical (const std::string &object_name, const std::vector< SubdomainName > &blocks, const bool error_if_not_identical=true) const
 
bool hasBlocks (const std::vector< SubdomainName > &blocks) const
 
const TgetCoupledPhysics (const PhysicsName &phys_name, const bool allow_fail=false) const
 
const std::vector< T *> getCoupledPhysics (const bool allow_fail=false) const
 
unsigned int dimension () const
 
const ActionComponentgetActionComponent (const ComponentName &comp_name) const
 
void checkComponentType (const ActionComponent &component) const
 
virtual void addComponent (const ActionComponent &component)
 
const std::vector< VariableName > & solverVariableNames () const
 
const std::vector< VariableName > & auxVariableNames () const
 
void timedAct ()
 
MooseObjectName uniqueActionName () const
 
const std::string & specificTaskName () const
 
const std::set< std::string > & getAllTasks () const
 
void appendTask (const std::string &task)
 
MooseAppgetMooseApp () const
 
const std::string & type () const
 
const std::string & name () const
 
std::string typeAndName () const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
MooseObjectName uniqueName () const
 
const InputParametersparameters () const
 
const hit::Node * getHitNode () const
 
bool hasBase () const
 
const std::string & getBase () const
 
const TgetParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const TqueryParam (const std::string &name) const
 
const TgetRenamedParam (const std::string &old_name, const std::string &new_name) const
 
T getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool haveParameter (const std::string &name) const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &name) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramInfo (const std::string &param, Args... args) const
 
std::string messagePrefix (const bool hit_prefix=true) const
 
std::string errorPrefix (const std::string &) const
 
void mooseError (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecatedNoTrace (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
void callMooseError (std::string msg, const bool with_prefix, const hit::Node *node=nullptr, const bool show_trace=true) const
 
std::string getDataFileName (const std::string &param) const
 
std::string getDataFileNameByName (const std::string &relative_path) const
 
std::string getDataFilePath (const std::string &relative_path) const
 
PerfGraphperfGraph ()
 
void assertParamDefined (const std::string &libmesh_dbg_var(param)) const
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Static Public Member Functions

static InputParameters validParams ()
 
static void callMooseError (MooseApp *const app, const InputParameters &params, std::string msg, const bool with_prefix, const hit::Node *node, const bool show_trace=true)
 

Public Attributes

 usingCombinedWarningSolutionWarnings
 
const ConsoleStream _console
 

Static Public Attributes

static const std::string unique_action_name_param
 
static const std::string type_param
 
static const std::string name_param
 
static const std::string unique_name_param
 
static const std::string app_param
 
static const std::string moose_base_param
 
static const std::string kokkos_object_param
 
static constexpr auto SYSTEM
 
static constexpr auto NAME
 

Protected Member Functions

virtual void initializePhysicsAdditional () override
 
virtual void actOnAdditionalTasks () override
 
virtual void addInitialConditions () override
 
virtual void addFVBCs () override
 
virtual void addMaterials () override
 
virtual void addPostprocessors () override
 
void addAxisymmetricViscousSource ()
 Adds the cylindrical source kernel for the radial momentum equation when requested and valid. More...
 
virtual void addAxisymmetricViscousSourceKernel (const std::vector< SubdomainName > &, unsigned int)
 Derived classes must override this hook to add the actual object that implements the axisymmetric viscous source term for their formulation once the helper has determined the relevant blocks and radial component. More...
 
void addPorousMediumSpeedMaterial ()
 Add material to define the local speed in porous medium flows. More...
 
void addNonPorousMediumSpeedMaterial ()
 Add material to define the local speed with no porous medium treatment. More...
 
void addFluidPropertiesFunctorMaterial ()
 Function which adds the general functor fluid properties functor material to define fluid functor material property. More...
 
VariableName getFlowVariableName (const std::string &default_name) const
 Convenience routine to be able to retrieve the actual variable names from their default names. More...
 
bool hasTurbulencePhysics () const
 Whether a turbulence Physics has been coupled in, to know which viscosity to pick on symmetry boundary conditions. More...
 
const WCNSFVTurbulencePhysicsBasegetCoupledTurbulencePhysics () const
 Find the turbulence physics. More...
 
std::vector< SubdomainName > getAxisymmetricRZBlocks () const
 Return the set of blocks restricted to an RZ coordinate system. More...
 
bool usingNavierStokesFVSyntax () const
 Detects if we are using the new Physics syntax or the old NavierStokesFV action. More...
 
InputParameters getAdditionalRMParams () const override
 Parameters to change or add relationship managers. More...
 
void assertParamDefined (const std::string &param) const
 
bool isTransient () const
 
FactorygetFactory ()
 
FactorygetFactory () const
 
virtual FEProblemBasegetProblem ()
 
virtual const FEProblemBasegetProblem () const
 
void prepareCopyVariablesFromMesh () const
 
void copyVariablesFromMesh (const std::vector< VariableName > &variables_to_copy, bool are_nonlinear=true)
 
std::string prefix () const
 
void saveSolverVariableName (const VariableName &var_name)
 
void saveAuxVariableName (const VariableName &var_name)
 
bool variableExists (const VariableName &var_name, bool error_if_aux) const
 
bool solverVariableExists (const VariableName &var_name) const
 
const SolverSystemName & getSolverSystem (unsigned int variable_index) const
 
const SolverSystemName & getSolverSystem (const VariableName &variable_name) const
 
void addRequiredPhysicsTask (const std::string &task)
 
void assignBlocks (InputParameters &params, const std::vector< SubdomainName > &blocks) const
 
bool allMeshBlocks (const std::vector< SubdomainName > &blocks) const
 
bool allMeshBlocks (const std::set< SubdomainName > &blocks) const
 
std::set< SubdomainIDgetSubdomainIDs (const std::set< SubdomainName > &blocks) const
 
std::vector< std::string > getSubdomainNamesAndIDs (const std::set< SubdomainID > &blocks) const
 
void addPetscPairsToPetscOptions (const std::vector< std::pair< MooseEnumItem, std::string >> &petsc_pair_options)
 
bool isVariableFV (const VariableName &var_name) const
 
bool isVariableScalar (const VariableName &var_name) const
 
bool shouldCreateVariable (const VariableName &var_name, const std::vector< SubdomainName > &blocks, const bool error_if_aux)
 
bool shouldCreateIC (const VariableName &var_name, const std::vector< SubdomainName > &blocks, const bool ic_is_default_ic, const bool error_if_already_defined) const
 
bool shouldCreateTimeDerivative (const VariableName &var_name, const std::vector< SubdomainName > &blocks, const bool error_if_already_defined) const
 
void reportPotentiallyMissedParameters (const std::vector< std::string > &param_names, const std::string &object_type, const std::string &object_name="") const
 
virtual void checkIntegrity () const
 
bool addRelationshipManagers (Moose::RelationshipManagerType when_type, const InputParameters &moose_object_pars)
 
void associateWithParameter (const std::string &param_name, InputParameters &params) const
 
void associateWithParameter (const InputParameters &from_params, const std::string &param_name, InputParameters &params) const
 
const TgetMeshProperty (const std::string &data_name, const std::string &prefix)
 
const TgetMeshProperty (const std::string &data_name)
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name) const
 
bool hasMeshProperty (const std::string &data_name) const
 
std::string meshPropertyName (const std::string &data_name) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level, const std::string &live_message, const bool print_dots=true) const
 
std::string timedSectionName (const std::string &section_name) const
 
void flagInvalidSolutionInternal (const InvalidSolutionID invalid_solution_id) const
 
InvalidSolutionID registerInvalidSolutionInternal (const std::string &message, const bool warning) const
 
void checkParamsBothSetOrNotSet (const std::string &param1, const std::string &param2) const
 
void checkSecondParamSetOnlyIfFirstOneTrue (const std::string &param1, const std::string &param2) const
 
void checkSecondParamSetOnlyIfFirstOneSet (const std::string &param1, const std::string &param2) const
 
void checkSecondParamNotSetIfFirstOneSet (const std::string &param1, const std::string &param2) const
 
void checkVectorParamsSameLength (const std::string &param1, const std::string &param2) const
 
void checkVectorParamAndMultiMooseEnumLength (const std::string &param1, const std::string &param2) const
 
void checkTwoDVectorParamsSameLength (const std::string &param1, const std::string &param2) const
 
void checkVectorParamsNoOverlap (const std::vector< std::string > &param_vecs) const
 
void checkTwoDVectorParamsNoRespectiveOverlap (const std::vector< std::string > &param_vecs) const
 
void checkTwoDVectorParamInnerSameLengthAsOneDVector (const std::string &param1, const std::string &param2) const
 
void checkTwoDVectorParamMultiMooseEnumSameLength (const std::string &param1, const std::string &param2, const bool error_for_param2) const
 
void checkVectorParamNotEmpty (const std::string &param1) const
 
void checkVectorParamsSameLengthIfSet (const std::string &param1, const std::string &param2, const bool ignore_empty_default_param2=false) const
 
void checkVectorParamLengthSameAsCombinedOthers (const std::string &param1, const std::string &param2, const std::string &param3) const
 
void checkBlockwiseConsistency (const std::string &block_param_name, const std::vector< std::string > &parameter_names) const
 
bool parameterConsistent (const InputParameters &other_param, const std::string &param_name) const
 
void warnInconsistent (const InputParameters &parameters, const std::string &param_name) const
 
void errorDependentParameter (const std::string &param1, const std::string &value_not_set, const std::vector< std::string > &dependent_params) const
 
void errorInconsistentDependentParameter (const std::string &param1, const std::string &value_set, const std::vector< std::string > &dependent_params) const
 

Static Protected Member Functions

static std::string meshPropertyName (const std::string &data_name, const std::string &prefix)
 

Protected Attributes

const TagName _pressure_tag = "p_tag"
 Name of the vector to hold pressure momentum equation contributions. More...
 
const bool _has_flow_equations
 Boolean to keep track of whether the flow equations should be created. More...
 
const bool _add_rz_viscous_source
 Whether to automatically add the cylindrical viscous source term. More...
 
const MooseEnum _compressibility
 Compressibility type, can be compressible, incompressible or weakly-compressible. More...
 
const bool _solve_for_dynamic_pressure
 Whether we are solving for the total or dynamic pressure. More...
 
const bool _porous_medium_treatment
 Whether to use the porous medium treatment. More...
 
const MooseFunctorName _porosity_name
 Name of the porosity functor. More...
 
MooseFunctorName _flow_porosity_functor_name
 Name of the porosity functor for the flow equations (if smoothed) More...
 
const std::vector< std::string > _velocity_names
 Velocity names. More...
 
const NonlinearVariableName _pressure_name
 Pressure name. More...
 
const NonlinearVariableName _fluid_temperature_name
 Fluid temperature name. More...
 
const MooseFunctorName _density_name
 Name of the density material property. More...
 
const MooseFunctorName _density_gravity_name
 Name of the density material property used for gravity and Boussinesq terms. More...
 
const MooseFunctorName _dynamic_viscosity_name
 Name of the dynamic viscosity material property. More...
 
const bool _include_symmetrized_viscous_stress
 Whether to include the symmetrized viscous stress contribution. More...
 
const bool _include_isotropic_viscous_stress
 Whether to include the isotropic viscous stress contribution. More...
 
UserObjectName _rc_uo_name
 name of the Rhie Chow user object More...
 
const MooseEnum _velocity_interpolation
 The velocity face interpolation method for advecting other quantities. More...
 
const MooseEnum _momentum_advection_interpolation
 The momentum face interpolation method for being advected. More...
 
const MooseEnum _momentum_face_interpolation
 The momentum face interpolation method for stress terms. More...
 
const WCNSFVTurbulencePhysicsBase_turbulence_physics
 Can be set to a coupled turbulence physics. More...
 
std::vector< std::vector< SubdomainName > > _friction_blocks
 Subdomains where we want to have volumetric friction. More...
 
std::vector< std::vector< std::string > > _friction_types
 The friction correlation types used for each block. More...
 
std::vector< std::vector< std::string > > _friction_coeffs
 The coefficients used for each item if friction type. More...
 
const std::vector< BoundaryName > _inlet_boundaries
 Boundaries with a flow inlet specified on them. More...
 
const std::vector< BoundaryName > _outlet_boundaries
 Boundaries with a flow outlet specified on them. More...
 
const std::vector< BoundaryName > _wall_boundaries
 Boundaries which define a wall (slip/noslip/etc.) More...
 
const std::vector< BoundaryName > _hydraulic_separators
 Hydraulic separator boundaries. More...
 
std::map< BoundaryName, MooseEnum_momentum_inlet_types
 Momentum inlet boundary types. More...
 
std::map< BoundaryName, MooseEnum_momentum_outlet_types
 Momentum outlet boundary types. More...
 
std::map< BoundaryName, MooseEnum_momentum_wall_types
 Momentum wall boundary types. More...
 
std::vector< PostprocessorName > _flux_inlet_pps
 Postprocessors describing the momentum inlet for each boundary. Indexing based on the number of flux boundaries. More...
 
std::vector< Point > _flux_inlet_directions
 Direction of each flux inlet. Indexing based on the number of flux boundaries. More...
 
std::map< BoundaryName, std::vector< MooseFunctorName > > _momentum_inlet_functors
 Functors describing the momentum inlet for each boundary. More...
 
std::map< BoundaryName, MooseFunctorName > _pressure_functors
 Functors describing the outlet pressure on each boundary. More...
 
std::map< BoundaryName, std::vector< MooseFunctorName > > _momentum_wall_functors
 Functors describing the momentum for each wall boundary. More...
 
bool _define_variables
 Whether to define variables if they do not exist. More...
 
std::vector< SolverSystemName > _system_names
 
std::vector< unsigned int_system_numbers
 
const bool _verbose
 
const MooseEnum_preconditioning
 
std::vector< SubdomainName > _blocks
 
std::string _registered_identifier
 
std::string _specific_task_name
 
std::set< std::string > _all_tasks
 
ActionWarehouse_awh
 
const std::string & _current_task
 
std::shared_ptr< MooseMesh > & _mesh
 
std::shared_ptr< MooseMesh > & _displaced_mesh
 
std::shared_ptr< FEProblemBase > & _problem
 
PerfID _act_timer
 
MooseApp_app
 
Factory_factory
 
ActionFactory_action_factory
 
const std::string & _type
 
const std::string & _name
 
const InputParameters_pars
 
MooseApp_pg_moose_app
 
const std::string _prefix
 
const Parallel::Communicator & _communicator
 

Private Member Functions

virtual void addSolverVariables () override
 
virtual void addFVKernels () override
 
virtual void addUserObjects () override
 
void addPressureCorrectionKernels ()
 Function adding kernels for the incompressible pressure correction equation. More...
 
void addMomentumTimeKernels () override
 Functions adding kernels for the incompressible momentum equation If the material properties are not constant, these can be used for weakly-compressible simulations (except the Boussinesq kernel) as well. More...
 
void addMomentumFluxKernels ()
 
virtual void addMomentumPressureKernels () override
 
virtual void addMomentumGravityKernels () override
 
virtual void addMomentumFrictionKernels () override
 
virtual void addMomentumBoussinesqKernels () override
 
virtual void addInletBC () override
 Functions adding boundary conditions for the flow simulation. More...
 
virtual void addOutletBC () override
 
virtual void addWallsBC () override
 
virtual void addSeparatorBC () override
 
virtual bool hasForchheimerFriction () const override
 Return whether a Forchheimer friction model is in use. More...
 
virtual void addRhieChowUserObjects () override
 Function which adds the RhieChow interpolator user objects for weakly and incompressible formulations. More...
 
virtual void addFunctorMaterials () override
 
virtual MooseFunctorName getLinearFrictionCoefName () const override
 Get the name of the linear friction coefficient. Returns an empty string if no friction. More...
 
unsigned short getNumberAlgebraicGhostingLayersNeeded () const override
 Return the number of algebraic ghosting layers needed. More...
 

Private Attributes

const bool _non_orthogonal_correction
 Whether to use the correction term for non-orthogonality. More...
 

Detailed Description

Creates all the objects needed to solve the Navier-Stokes equations with the SIMPLE algorithm using the linear finite volume discretization Currently does not implement:

Definition at line 24 of file WCNSLinearFVFlowPhysics.h.

Constructor & Destructor Documentation

◆ WCNSLinearFVFlowPhysics()

WCNSLinearFVFlowPhysics::WCNSLinearFVFlowPhysics ( const InputParameters parameters)

Definition at line 67 of file WCNSLinearFVFlowPhysics.C.

69  _non_orthogonal_correction(getParam<bool>("orthogonality_correction"))
70 {
72  paramError("porous_medium_treatment", "Porous media unsupported");
74  mooseError("Not supported");
75 
76  if (_hydraulic_separators.size())
77  paramError("hydraulic_separator_sidesets",
78  "Flow separators are not supported yet for linearFV!");
79  if (getParam<bool>("pin_pressure"))
80  paramError("pin_pressure",
81  "Pressure pinning is implemented in the executioner for the linear finite volume "
82  "segregated solves");
83 }
const bool _has_flow_equations
Boolean to keep track of whether the flow equations should be created.
void paramError(const std::string &param, Args... args) const
const InputParameters & parameters() const
const bool _porous_medium_treatment
Whether to use the porous medium treatment.
const bool _non_orthogonal_correction
Whether to use the correction term for non-orthogonality.
void mooseError(Args &&... args) const
const std::vector< BoundaryName > _hydraulic_separators
Hydraulic separator boundaries.
WCNSFVFlowPhysicsBase(const InputParameters &parameters)

Member Function Documentation

◆ actOnAdditionalTasks()

void WCNSFVFlowPhysicsBase::actOnAdditionalTasks ( )
overrideprotectedvirtualinherited

Reimplemented from PhysicsBase.

Definition at line 289 of file WCNSFVFlowPhysicsBase.C.

290 {
291  // Turbulence physics would not be initialized before this task
292  if (_current_task == "get_turbulence_physics")
294 }
const std::string & _current_task
const WCNSFVTurbulencePhysicsBase * getCoupledTurbulencePhysics() const
Find the turbulence physics.
const WCNSFVTurbulencePhysicsBase * _turbulence_physics
Can be set to a coupled turbulence physics.

◆ addAxisymmetricViscousSource()

void WCNSFVFlowPhysicsBase::addAxisymmetricViscousSource ( )
protectedinherited

Adds the cylindrical source kernel for the radial momentum equation when requested and valid.

Definition at line 567 of file WCNSFVFlowPhysicsBase.C.

Referenced by WCNSFVFlowPhysics::addFVKernels().

568 {
570  return;
571 
572  const auto rz_blocks = getAxisymmetricRZBlocks();
573  if (rz_blocks.empty())
574  return;
575 
576  const auto radial_index = getProblem().mesh().getAxisymmetricRadialCoord();
577  addAxisymmetricViscousSourceKernel(rz_blocks, radial_index);
578 }
const bool _has_flow_equations
Boolean to keep track of whether the flow equations should be created.
virtual void addAxisymmetricViscousSourceKernel(const std::vector< SubdomainName > &, unsigned int)
Derived classes must override this hook to add the actual object that implements the axisymmetric vis...
virtual FEProblemBase & getProblem()
unsigned int getAxisymmetricRadialCoord() const
std::vector< SubdomainName > getAxisymmetricRZBlocks() const
Return the set of blocks restricted to an RZ coordinate system.
const bool _add_rz_viscous_source
Whether to automatically add the cylindrical viscous source term.
virtual MooseMesh & mesh() override

◆ addAxisymmetricViscousSourceEnabled()

bool WCNSFVFlowPhysicsBase::addAxisymmetricViscousSourceEnabled ( ) const
inlineinherited

Whether the cylindrical viscous source helper is enabled.

Definition at line 39 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSFVTurbulencePhysics::addAxisymmetricTurbulentViscousSource().

39 { return _add_rz_viscous_source; }
const bool _add_rz_viscous_source
Whether to automatically add the cylindrical viscous source term.

◆ addAxisymmetricViscousSourceKernel()

virtual void WCNSFVFlowPhysicsBase::addAxisymmetricViscousSourceKernel ( const std::vector< SubdomainName > &  ,
unsigned int   
)
inlineprotectedvirtualinherited

Derived classes must override this hook to add the actual object that implements the axisymmetric viscous source term for their formulation once the helper has determined the relevant blocks and radial component.

Reimplemented in WCNSFVFlowPhysics.

Definition at line 127 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSFVFlowPhysicsBase::addAxisymmetricViscousSource().

129  {
130  }

◆ addFluidPropertiesFunctorMaterial()

void WCNSFVFlowPhysicsBase::addFluidPropertiesFunctorMaterial ( )
protectedinherited

Function which adds the general functor fluid properties functor material to define fluid functor material property.

Definition at line 351 of file WCNSFVFlowPhysicsBase.C.

Referenced by WCNSFVFlowPhysicsBase::addMaterials().

352 {
353  // Not very future-proof but it works
354  const bool use_ad = !dynamic_cast<WCNSLinearFVFlowPhysics *>(this);
355  const std::string class_name =
356  use_ad ? "GeneralFunctorFluidProps" : "NonADGeneralFunctorFluidProps";
357  InputParameters params = getFactory().getValidParams(class_name);
358  assignBlocks(params, _blocks);
359 
360  params.set<MooseFunctorName>(NS::pressure) = _pressure_name;
361  params.set<MooseFunctorName>(NS::T_fluid) = _fluid_temperature_name;
362  params.set<MooseFunctorName>(NS::speed) = NS::speed;
363  params.applySpecificParameters(parameters(), {NS::fluid, NS::density, "mu_rampdown"});
365  params.set<bool>("force_define_density") = true;
367  {
368  params.set<MooseFunctorName>(NS::porosity) = "1";
369  params.set<MooseFunctorName>("characteristic_length") = "1";
370  }
371  else
372  // not implemented yet
373  paramInfo(
374  NS::fluid,
375  "Specifying the fluid properties user object does not define the GeneralFunctorFluidProps "
376  "when using the porous medium treatment. You have to define this object in the input");
377 
378  // Dynamic pressure
379  params.set<bool>("solving_for_dynamic_pressure") = _solve_for_dynamic_pressure;
381  {
382  params.set<Point>("reference_pressure_point") = getParam<Point>("reference_pressure_point");
383  if (!isParamSetByUser("reference_pressure_point"))
384  paramWarning("reference_pressure_point",
385  "Default value of (0,0,0) used. If this point is outside the flow domain, the "
386  "simulation will error");
387  params.set<Real>("reference_pressure") = getParam<Real>("reference_pressure");
388  }
389  params.set<Point>("gravity") = getParam<RealVectorValue>("gravity");
390 
392  getProblem().addFunctorMaterial(class_name, prefix() + "functor_fluidprops", params);
393 }
std::string prefix() const
Creates all the objects needed to solve the Navier-Stokes equations with the SIMPLE algorithm using t...
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
Factory & getFactory()
static const std::string speed
Definition: NS.h:147
void applySpecificParameters(const InputParameters &common, const std::vector< std::string > &include, bool allow_private=false)
const MooseFunctorName _density_name
Name of the density material property.
const InputParameters & parameters() const
T & set(const std::string &name, bool quiet_mode=false)
static const std::string density
Definition: NS.h:34
InputParameters getValidParams(const std::string &name) const
static const std::string fluid
Definition: NS.h:88
virtual void addFunctorMaterial(const std::string &functor_material_name, const std::string &name, InputParameters &parameters)
const NonlinearVariableName _pressure_name
Pressure name.
const bool _porous_medium_treatment
Whether to use the porous medium treatment.
std::vector< SubdomainName > _blocks
virtual FEProblemBase & getProblem()
static const std::string porosity
Definition: NS.h:108
static const std::string T_fluid
Definition: NS.h:110
const bool _solve_for_dynamic_pressure
Whether we are solving for the total or dynamic pressure.
const NonlinearVariableName _fluid_temperature_name
Fluid temperature name.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::string pressure
Definition: NS.h:57
void paramWarning(const std::string &param, Args... args) const
bool parsesToReal(const std::string &input, Real *parsed_real)
bool isParamSetByUser(const std::string &name) const
void paramInfo(const std::string &param, Args... args) const

◆ addFunctorMaterials()

void WCNSLinearFVFlowPhysics::addFunctorMaterials ( )
overrideprivatevirtual

Reimplemented from PhysicsBase.

Definition at line 669 of file WCNSLinearFVFlowPhysics.C.

670 {
671  if (parameters().isParamValid("gravity"))
672  {
673  const auto gravity_vector = getParam<RealVectorValue>("gravity");
674  const std::vector<std::string> comp_axis({"x", "y", "z"});
675  for (const auto d : make_range(dimension()))
676  if (gravity_vector(d) != 0)
677  {
678  // Add rho * g functor for each relevant direction
679  // TODO: we could avoid using an AD functor material for non-AD density functor
680  auto params = getFactory().getValidParams("ADParsedFunctorMaterial");
681  assignBlocks(params, _blocks);
682  params.set<std::string>("expression") =
683  _density_gravity_name + " * " + std::to_string(gravity_vector(d));
685  params.set<std::vector<std::string>>("functor_names") = {_density_gravity_name};
686  params.set<std::string>("property_name") = "rho_g_" + comp_axis[d];
687  // We don't output this helper material
689  "ADParsedFunctorMaterial", prefix() + "gravity_helper_" + comp_axis[d], params);
690  }
691  }
692 }
std::string prefix() const
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
Factory & getFactory()
const MooseFunctorName _density_gravity_name
Name of the density material property used for gravity and Boussinesq terms.
virtual void addMaterial(const std::string &material_name, const std::string &name, InputParameters &parameters)
const InputParameters & parameters() const
InputParameters getValidParams(const std::string &name) const
std::vector< SubdomainName > _blocks
unsigned int dimension() const
virtual FEProblemBase & getProblem()
IntRange< T > make_range(T beg, T end)
bool isParamValid(const std::string &name) const
bool parsesToReal(const std::string &input, Real *parsed_real)

◆ addFVBCs()

void WCNSFVFlowPhysicsBase::addFVBCs ( )
overrideprotectedvirtualinherited

Reimplemented from PhysicsBase.

Definition at line 297 of file WCNSFVFlowPhysicsBase.C.

298 {
299  addInletBC();
300  addOutletBC();
301  addWallsBC();
302  addSeparatorBC();
303 }
virtual void addSeparatorBC()=0
virtual void addOutletBC()=0
virtual void addWallsBC()=0
virtual void addInletBC()=0
Functions adding boundary conditions for the flow simulation.

◆ addFVKernels()

void WCNSLinearFVFlowPhysics::addFVKernels ( )
overrideprivatevirtual

Implements WCNSFVFlowPhysicsBase.

Definition at line 166 of file WCNSLinearFVFlowPhysics.C.

167 {
168  if (!_has_flow_equations)
169  return;
170 
171  // Pressure correction equation: divergence of momentum
173 
174  // Momentum equation: time derivative
175  if (isTransient())
177 
178  // Momentum equation: flux terms
180 
181  // Momentum equation: pressure term
183 
184  // Momentum equation: friction term
185  if (_friction_types.size())
187 
188  // Momentum equation: gravity source term
190 
191  // Momentum equation: boussinesq approximation
192  if (getParam<bool>("boussinesq_approximation"))
194 }
const bool _has_flow_equations
Boolean to keep track of whether the flow equations should be created.
std::vector< std::vector< std::string > > _friction_types
The friction correlation types used for each block.
virtual void addMomentumPressureKernels() override
void addMomentumTimeKernels() override
Functions adding kernels for the incompressible momentum equation If the material properties are not ...
void addPressureCorrectionKernels()
Function adding kernels for the incompressible pressure correction equation.
virtual void addMomentumGravityKernels() override
virtual void addMomentumFrictionKernels() override
virtual void addMomentumBoussinesqKernels() override
bool isTransient() const

◆ addInitialConditions()

void WCNSFVFlowPhysicsBase::addInitialConditions ( )
overrideprotectedvirtualinherited

Reimplemented from PhysicsBase.

Definition at line 396 of file WCNSFVFlowPhysicsBase.C.

397 {
398  if (!_define_variables && parameters().isParamSetByUser("initial_velocity") &&
399  parameters().isParamSetByUser("velocity_variable") &&
400  getParam<std::vector<FunctionName>>("initial_velocity").size() != 0)
401  // TODO: Rework and remove this last statement once the NSFV action is removed
402  paramError("initial_velocity",
403  "Velocity is defined externally of WCNSFVFlowPhysicsBase, so should the inital "
404  "conditions");
405  if (!_define_variables && parameters().isParamSetByUser("initial_pressure") &&
406  parameters().isParamSetByUser("pressure_variable"))
407  paramError("initial_pressure",
408  "Pressure is defined externally of WCNSFVFlowPhysicsBase, so should the inital "
409  "condition");
410 
411  // Check dimension
412  if (getParam<std::vector<FunctionName>>("initial_velocity").size() != dimension() &&
413  getParam<std::vector<FunctionName>>("initial_velocity").size() != 3 &&
414  getParam<std::vector<FunctionName>>("initial_velocity").size() != 0)
415  // TODO: Rework and remove this last statement once the NSFV action is removed
416  paramError("initial_velocity",
417  "The number of velocity components in the " + type() + " initial condition is not " +
418  std::to_string(dimension()) + " or 3!");
419 
420  InputParameters params = getFactory().getValidParams("FVFunctionIC");
421  assignBlocks(params, _blocks);
422  auto vvalue = getParam<std::vector<FunctionName>>("initial_velocity");
423 
424  for (const auto d : make_range(dimension()))
425  {
426  params.set<VariableName>("variable") = _velocity_names[d];
427  params.set<FunctionName>("function") = vvalue[d];
428 
430  _blocks,
431  /*whether IC is a default*/ !isParamSetByUser("initial_velocity"),
432  /*error if already an IC*/ isParamSetByUser("initial_velocity")))
434  "FVFunctionIC", prefix() + _velocity_names[d] + "_ic", params);
435  }
436 
438  _blocks,
439  /*whether IC is a default*/ !isParamSetByUser("initial_pressure"),
440  /*error if already an IC*/ isParamSetByUser("initial_pressure")))
441  {
442  params.set<VariableName>("variable") = _pressure_name;
443  params.set<FunctionName>("function") = getParam<FunctionName>("initial_pressure");
444 
445  getProblem().addFVInitialCondition("FVFunctionIC", prefix() + _pressure_name + "_ic", params);
446  }
447 }
std::string prefix() const
virtual void addFVInitialCondition(const std::string &ic_name, const std::string &name, InputParameters &parameters)
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
Factory & getFactory()
void paramError(const std::string &param, Args... args) const
const T & getParam(const std::string &name) const
const InputParameters & parameters() const
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
const NonlinearVariableName _pressure_name
Pressure name.
bool shouldCreateIC(const VariableName &var_name, const std::vector< SubdomainName > &blocks, const bool ic_is_default_ic, const bool error_if_already_defined) const
std::vector< SubdomainName > _blocks
unsigned int dimension() const
virtual FEProblemBase & getProblem()
const std::vector< std::string > _velocity_names
Velocity names.
const std::string & type() const
bool _define_variables
Whether to define variables if they do not exist.
IntRange< T > make_range(T beg, T end)
bool isParamSetByUser(const std::string &name) const

◆ addInletBC()

void WCNSLinearFVFlowPhysics::addInletBC ( )
overrideprivatevirtual

Functions adding boundary conditions for the flow simulation.

These are used for weakly-compressible simulations as well.

Implements WCNSFVFlowPhysicsBase.

Definition at line 394 of file WCNSLinearFVFlowPhysics.C.

395 {
396  // Check the size of the BC parameters
397  unsigned int num_velocity_functor_inlets = 0;
398  for (const auto & [bdy, momentum_inlet_type] : _momentum_inlet_types)
399  if (momentum_inlet_type == "fixed-velocity" || momentum_inlet_type == "fixed-pressure")
400  num_velocity_functor_inlets++;
401 
402  if (num_velocity_functor_inlets != _momentum_inlet_functors.size())
403  paramError("momentum_inlet_functors",
404  "Size (" + std::to_string(_momentum_inlet_functors.size()) +
405  ") is not the same as the number of entries in the momentum_inlet_types "
406  "subvector for fixed-velocities/pressures functors (size " +
407  std::to_string(num_velocity_functor_inlets) + ")");
408 
409  unsigned int velocity_pressure_counter = 0;
410  for (const auto & [inlet_bdy, momentum_inlet_type] : _momentum_inlet_types)
411  {
412  if (momentum_inlet_type == "fixed-velocity")
413  {
414  const std::string bc_type = "LinearFVAdvectionDiffusionFunctorDirichletBC";
415  InputParameters params = getFactory().getValidParams(bc_type);
416  params.set<std::vector<BoundaryName>>("boundary") = {inlet_bdy};
417  if (_momentum_inlet_functors.size() < velocity_pressure_counter + 1)
418  paramError("momentum_inlet_functors",
419  "More non-flux inlets than inlet functors (" +
420  std::to_string(_momentum_inlet_functors.size()) + ")");
421 
422  // Check that enough functors have been provided for the dimension of the problem
423  const auto momentum_functors = libmesh_map_find(_momentum_inlet_functors, inlet_bdy);
424  if (momentum_functors.size() < dimension())
425  paramError("momentum_inlet_functors",
426  "Subvector for boundary '" + inlet_bdy + "' (size " +
427  std::to_string(momentum_functors.size()) +
428  ") is not the same size as the number of dimensions of the physics (" +
429  std::to_string(dimension()) + ")");
430 
431  for (const auto d : make_range(dimension()))
432  {
433  params.set<LinearVariableName>("variable") = _velocity_names[d];
434  params.set<MooseFunctorName>("functor") = momentum_functors[d];
435 
436  getProblem().addLinearFVBC(bc_type, _velocity_names[d] + "_" + inlet_bdy, params);
437  }
438  ++velocity_pressure_counter;
439 
440  // Add the two term BC expansion for pressure if requested
441  if (getParam<bool>("pressure_two_term_bc_expansion"))
442  {
443  const std::string bc_type = "LinearFVExtrapolatedPressureBC";
444  InputParameters params = getFactory().getValidParams(bc_type);
445  params.set<std::vector<BoundaryName>>("boundary") = {inlet_bdy};
446  params.set<LinearVariableName>("variable") = _pressure_name;
447  params.set<bool>("use_two_term_expansion") = true;
448  getProblem().addLinearFVBC(bc_type,
449  _pressure_name + "_extrapolation_inlet_" +
450  Moose::stringify(inlet_bdy),
451  params);
452  }
453  }
454  else if (momentum_inlet_type == "fixed-pressure")
455  {
456  const std::string bc_type = "LinearFVAdvectionDiffusionFunctorDirichletBC";
457  InputParameters params = getFactory().getValidParams(bc_type);
458  params.set<LinearVariableName>("variable") = _pressure_name;
459  if (_momentum_inlet_functors.size() < velocity_pressure_counter + 1)
460  paramError("momentum_inlet_functors",
461  "More non-flux inlets than inlet functors (" +
462  std::to_string(_momentum_inlet_functors.size()) + ")");
463 
464  params.set<MooseFunctorName>("functor") =
465  libmesh_map_find(_momentum_inlet_functors, inlet_bdy)[0];
466  params.set<std::vector<BoundaryName>>("boundary") = {inlet_bdy};
467 
468  getProblem().addLinearFVBC(bc_type, _pressure_name + "_" + inlet_bdy, params);
469  ++velocity_pressure_counter;
470  }
471  else
472  mooseError("Unsupported inlet boundary condition type: ", momentum_inlet_type);
473  }
474 }
Factory & getFactory()
std::map< BoundaryName, MooseEnum > _momentum_inlet_types
Momentum inlet boundary types.
void paramError(const std::string &param, Args... args) const
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
std::map< BoundaryName, std::vector< MooseFunctorName > > _momentum_inlet_functors
Functors describing the momentum inlet for each boundary.
const NonlinearVariableName _pressure_name
Pressure name.
unsigned int dimension() const
virtual FEProblemBase & getProblem()
const std::vector< std::string > _velocity_names
Velocity names.
std::string stringify(const T &t)
virtual void addLinearFVBC(const std::string &fv_bc_name, const std::string &name, InputParameters &parameters)
IntRange< T > make_range(T beg, T end)
void mooseError(Args &&... args) const

◆ addMaterials()

void WCNSFVFlowPhysicsBase::addMaterials ( )
overrideprotectedvirtualinherited

Reimplemented from PhysicsBase.

Definition at line 306 of file WCNSFVFlowPhysicsBase.C.

307 {
310  else
312 
313  if (isParamValid(NS::fluid))
315 }
static const std::string fluid
Definition: NS.h:88
const bool _porous_medium_treatment
Whether to use the porous medium treatment.
void addPorousMediumSpeedMaterial()
Add material to define the local speed in porous medium flows.
void addNonPorousMediumSpeedMaterial()
Add material to define the local speed with no porous medium treatment.
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.
bool isParamValid(const std::string &name) const

◆ addMomentumBoussinesqKernels()

void WCNSLinearFVFlowPhysics::addMomentumBoussinesqKernels ( )
overrideprivatevirtual

Implements WCNSFVFlowPhysicsBase.

Definition at line 367 of file WCNSLinearFVFlowPhysics.C.

Referenced by addFVKernels().

368 {
369  if (_compressibility == "weakly-compressible")
370  paramError("boussinesq_approximation",
371  "We cannot use boussinesq approximation while running in weakly-compressible mode!");
372 
373  std::string kernel_type = "LinearFVMomentumBoussinesq";
374  std::string kernel_name = prefix() + "ins_momentum_boussinesq_";
375 
376  InputParameters params = getFactory().getValidParams(kernel_type);
377  assignBlocks(params, _blocks);
378  params.set<VariableName>(NS::T_fluid) = _fluid_temperature_name;
379  params.set<MooseFunctorName>(NS::density) = _density_gravity_name;
380  params.set<RealVectorValue>("gravity") = getParam<RealVectorValue>("gravity");
381  params.set<Real>("ref_temperature") = getParam<Real>("ref_temperature");
382  params.set<MooseFunctorName>("alpha_name") = getParam<MooseFunctorName>("thermal_expansion");
383 
384  for (const auto d : make_range(dimension()))
385  {
386  params.set<MooseEnum>("momentum_component") = NS::directions[d];
387  params.set<LinearVariableName>("variable") = _velocity_names[d];
388 
389  getProblem().addLinearFVKernel(kernel_type, kernel_name + NS::directions[d], params);
390  }
391 }
std::string prefix() const
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
Factory & getFactory()
void paramError(const std::string &param, Args... args) const
const MooseFunctorName _density_gravity_name
Name of the density material property used for gravity and Boussinesq terms.
T & set(const std::string &name, bool quiet_mode=false)
static const std::string density
Definition: NS.h:34
InputParameters getValidParams(const std::string &name) const
std::vector< SubdomainName > _blocks
unsigned int dimension() const
static const std::string directions[3]
Definition: NS.h:23
virtual FEProblemBase & getProblem()
static const std::string T_fluid
Definition: NS.h:110
const std::vector< std::string > _velocity_names
Velocity names.
const MooseEnum _compressibility
Compressibility type, can be compressible, incompressible or weakly-compressible. ...
virtual void addLinearFVKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
const NonlinearVariableName _fluid_temperature_name
Fluid temperature name.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
IntRange< T > make_range(T beg, T end)

◆ addMomentumFluxKernels()

void WCNSLinearFVFlowPhysics::addMomentumFluxKernels ( )
private

Definition at line 244 of file WCNSLinearFVFlowPhysics.C.

Referenced by addFVKernels().

245 {
246  const std::string u_names[3] = {"u", "v", "w"};
247  std::string kernel_type = "LinearWCNSFVMomentumFlux";
248  std::string kernel_name = prefix() + "ins_momentum_flux_";
249 
250  InputParameters params = getFactory().getValidParams(kernel_type);
251  assignBlocks(params, _blocks);
252  if (!_turbulence_physics)
253  params.set<MooseFunctorName>(NS::mu) = _dynamic_viscosity_name;
254  else
255  params.set<MooseFunctorName>(NS::mu) = NS::mu_eff;
256 
257  params.set<UserObjectName>("rhie_chow_user_object") = rhieChowUOName();
258  params.set<MooseEnum>("advected_interp_method") = _momentum_advection_interpolation;
259  params.set<bool>("use_nonorthogonal_correction") = _non_orthogonal_correction;
260  params.set<bool>("use_deviatoric_terms") = includeSymmetrizedViscousStress();
261 
262  for (unsigned int i = 0; i < dimension(); ++i)
263  params.set<SolverVariableName>(u_names[i]) = _velocity_names[i];
264 
265  for (const auto d : make_range(dimension()))
266  {
267  params.set<LinearVariableName>("variable") = _velocity_names[d];
268  params.set<MooseEnum>("momentum_component") = NS::directions[d];
269 
270  getProblem().addLinearFVKernel(kernel_type, kernel_name + NS::directions[d], params);
271  }
272 }
std::string prefix() const
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
Factory & getFactory()
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
const MooseEnum _momentum_advection_interpolation
The momentum face interpolation method for being advected.
std::vector< SubdomainName > _blocks
unsigned int dimension() const
bool includeSymmetrizedViscousStress() const
Whether to include the symmetrized contribution in the viscous stress.
static const std::string directions[3]
Definition: NS.h:23
virtual FEProblemBase & getProblem()
static const std::string mu
Definition: NS.h:127
const std::vector< std::string > _velocity_names
Velocity names.
const MooseFunctorName _dynamic_viscosity_name
Name of the dynamic viscosity material property.
static const std::string mu_eff
Definition: NS.h:133
const bool _non_orthogonal_correction
Whether to use the correction term for non-orthogonality.
virtual void addLinearFVKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
const UserObjectName & rhieChowUOName() const
Return the name of the Rhie Chow user object.
IntRange< T > make_range(T beg, T end)
const WCNSFVTurbulencePhysicsBase * _turbulence_physics
Can be set to a coupled turbulence physics.

◆ addMomentumFrictionKernels()

void WCNSLinearFVFlowPhysics::addMomentumFrictionKernels ( )
overrideprivatevirtual

Implements WCNSFVFlowPhysicsBase.

Definition at line 293 of file WCNSLinearFVFlowPhysics.C.

Referenced by addFVKernels().

294 {
295  unsigned int num_friction_blocks = _friction_blocks.size();
296  unsigned int num_used_blocks = num_friction_blocks ? num_friction_blocks : 1;
297 
298  const std::string kernel_type = "LinearFVMomentumFriction";
299  InputParameters params = getFactory().getValidParams(kernel_type);
300 
301  for (const auto block_i : make_range(num_used_blocks))
302  {
303  std::string block_name = "";
304  if (num_friction_blocks)
305  {
306  params.set<std::vector<SubdomainName>>("block") = _friction_blocks[block_i];
307  block_name = Moose::stringify(_friction_blocks[block_i]);
308  }
309  else
310  {
311  assignBlocks(params, _blocks);
312  block_name = std::to_string(block_i);
313  }
314 
315  for (const auto d : make_range(dimension()))
316  {
317  params.set<LinearVariableName>("variable") = _velocity_names[d];
318  params.set<MooseEnum>("momentum_component") = NS::directions[d];
319  for (unsigned int type_i = 0; type_i < _friction_types[block_i].size(); ++type_i)
320  {
321  const auto upper_name = MooseUtils::toUpper(_friction_types[block_i][type_i]);
322  if (upper_name == "DARCY")
323  {
324  params.set<MooseFunctorName>(NS::mu) = _dynamic_viscosity_name;
325  params.set<MooseFunctorName>("Darcy_name") = _friction_coeffs[block_i][type_i];
326  }
327  else
328  paramError("friction_types",
329  "Friction type '",
330  _friction_types[block_i][type_i],
331  "' is not implemented");
332  }
333 
334  getProblem().addLinearFVKernel(kernel_type,
335  prefix() + "momentum_friction_" + block_name + "_" +
336  NS::directions[d],
337  params);
338  }
339  }
340 }
std::string prefix() const
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
Factory & getFactory()
std::vector< std::vector< std::string > > _friction_types
The friction correlation types used for each block.
void paramError(const std::string &param, Args... args) const
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
std::vector< SubdomainName > _blocks
unsigned int dimension() const
static const std::string directions[3]
Definition: NS.h:23
std::string toUpper(std::string name)
virtual FEProblemBase & getProblem()
std::vector< std::vector< SubdomainName > > _friction_blocks
Subdomains where we want to have volumetric friction.
static const std::string mu
Definition: NS.h:127
const std::vector< std::string > _velocity_names
Velocity names.
const MooseFunctorName _dynamic_viscosity_name
Name of the dynamic viscosity material property.
std::string stringify(const T &t)
virtual void addLinearFVKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
IntRange< T > make_range(T beg, T end)
std::vector< std::vector< std::string > > _friction_coeffs
The coefficients used for each item if friction type.

◆ addMomentumGravityKernels()

void WCNSLinearFVFlowPhysics::addMomentumGravityKernels ( )
overrideprivatevirtual

Implements WCNSFVFlowPhysicsBase.

Definition at line 343 of file WCNSLinearFVFlowPhysics.C.

Referenced by addFVKernels().

344 {
346  {
347  std::string kernel_type = "LinearFVSource";
348  std::string kernel_name = prefix() + "ins_momentum_gravity_";
349 
350  InputParameters params = getFactory().getValidParams(kernel_type);
351  assignBlocks(params, _blocks);
352  const auto gravity_vector = getParam<RealVectorValue>("gravity");
353  const std::vector<std::string> comp_axis({"x", "y", "z"});
354 
355  for (const auto d : make_range(dimension()))
356  if (gravity_vector(d) != 0)
357  {
358  params.set<MooseFunctorName>("source_density") = "rho_g_" + comp_axis[d];
359  params.set<LinearVariableName>("variable") = _velocity_names[d];
360 
361  getProblem().addLinearFVKernel(kernel_type, kernel_name + NS::directions[d], params);
362  }
363  }
364 }
std::string prefix() const
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
Factory & getFactory()
const InputParameters & parameters() const
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
std::vector< SubdomainName > _blocks
unsigned int dimension() const
static const std::string directions[3]
Definition: NS.h:23
virtual FEProblemBase & getProblem()
const std::vector< std::string > _velocity_names
Velocity names.
const bool _solve_for_dynamic_pressure
Whether we are solving for the total or dynamic pressure.
virtual void addLinearFVKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
IntRange< T > make_range(T beg, T end)
bool isParamValid(const std::string &name) const

◆ addMomentumPressureKernels()

void WCNSLinearFVFlowPhysics::addMomentumPressureKernels ( )
overrideprivatevirtual

Implements WCNSFVFlowPhysicsBase.

Definition at line 275 of file WCNSLinearFVFlowPhysics.C.

Referenced by addFVKernels().

276 {
277  std::string kernel_type = "LinearFVMomentumPressure";
278  std::string kernel_name = prefix() + "ins_momentum_pressure_";
279 
280  InputParameters params = getFactory().getValidParams(kernel_type);
281  assignBlocks(params, _blocks);
282  params.set<VariableName>("pressure") = _pressure_name;
283 
284  for (const auto d : make_range(dimension()))
285  {
286  params.set<MooseEnum>("momentum_component") = NS::directions[d];
287  params.set<LinearVariableName>("variable") = _velocity_names[d];
288  getProblem().addLinearFVKernel(kernel_type, kernel_name + NS::directions[d], params);
289  }
290 }
std::string prefix() const
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
Factory & getFactory()
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
const NonlinearVariableName _pressure_name
Pressure name.
std::vector< SubdomainName > _blocks
unsigned int dimension() const
static const std::string directions[3]
Definition: NS.h:23
virtual FEProblemBase & getProblem()
const std::vector< std::string > _velocity_names
Velocity names.
virtual void addLinearFVKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
IntRange< T > make_range(T beg, T end)

◆ addMomentumTimeKernels()

void WCNSLinearFVFlowPhysics::addMomentumTimeKernels ( )
overrideprivatevirtual

Functions adding kernels for the incompressible momentum equation If the material properties are not constant, these can be used for weakly-compressible simulations (except the Boussinesq kernel) as well.

Implements WCNSFVFlowPhysicsBase.

Definition at line 226 of file WCNSLinearFVFlowPhysics.C.

Referenced by addFVKernels().

227 {
228  std::string kernel_type = "LinearFVTimeDerivative";
229  std::string kernel_name = prefix() + "ins_momentum_time";
230 
231  InputParameters params = getFactory().getValidParams(kernel_type);
232  assignBlocks(params, _blocks);
233  params.set<MooseFunctorName>("factor") = _density_name;
234 
235  for (const auto d : make_range(dimension()))
236  {
237  params.set<LinearVariableName>("variable") = _velocity_names[d];
238  if (shouldCreateTimeDerivative(_velocity_names[d], _blocks, /*error if already defined*/ false))
239  getProblem().addLinearFVKernel(kernel_type, kernel_name + "_" + NS::directions[d], params);
240  }
241 }
std::string prefix() const
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
Factory & getFactory()
const MooseFunctorName _density_name
Name of the density material property.
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
bool shouldCreateTimeDerivative(const VariableName &var_name, const std::vector< SubdomainName > &blocks, const bool error_if_already_defined) const
std::vector< SubdomainName > _blocks
unsigned int dimension() const
static const std::string directions[3]
Definition: NS.h:23
virtual FEProblemBase & getProblem()
const std::vector< std::string > _velocity_names
Velocity names.
virtual void addLinearFVKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
IntRange< T > make_range(T beg, T end)

◆ addNonPorousMediumSpeedMaterial()

void WCNSFVFlowPhysicsBase::addNonPorousMediumSpeedMaterial ( )
protectedinherited

Add material to define the local speed with no porous medium treatment.

Definition at line 336 of file WCNSFVFlowPhysicsBase.C.

Referenced by WCNSFVFlowPhysicsBase::addMaterials().

337 {
338  const std::string class_name = "ADVectorMagnitudeFunctorMaterial";
339  InputParameters params = getFactory().getValidParams(class_name);
340  assignBlocks(params, _blocks);
341 
342  const std::vector<std::string> param_names{"x_functor", "y_functor", "z_functor"};
343  for (unsigned int dim_i = 0; dim_i < dimension(); ++dim_i)
344  params.set<MooseFunctorName>(param_names[dim_i]) = _velocity_names[dim_i];
345  params.set<MooseFunctorName>("vector_magnitude_name") = NS::speed;
346 
347  getProblem().addFunctorMaterial(class_name, prefix() + "ins_speed_material", params);
348 }
std::string prefix() const
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
Factory & getFactory()
static const std::string speed
Definition: NS.h:147
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
virtual void addFunctorMaterial(const std::string &functor_material_name, const std::string &name, InputParameters &parameters)
std::vector< SubdomainName > _blocks
unsigned int dimension() const
virtual FEProblemBase & getProblem()
const std::vector< std::string > _velocity_names
Velocity names.

◆ addOutletBC()

void WCNSLinearFVFlowPhysics::addOutletBC ( )
overrideprivatevirtual

Implements WCNSFVFlowPhysicsBase.

Definition at line 477 of file WCNSLinearFVFlowPhysics.C.

478 {
479  // Check the BCs size
480  unsigned int num_pressure_outlets = 0;
481  for (const auto & [bdy, momentum_outlet_type] : _momentum_outlet_types)
482  if (momentum_outlet_type == "fixed-pressure" ||
483  momentum_outlet_type == "fixed-pressure-zero-gradient")
484  num_pressure_outlets++;
485 
486  if (num_pressure_outlets != _pressure_functors.size())
487  paramError("pressure_functors",
488  "Size (" + std::to_string(_pressure_functors.size()) +
489  ") is not the same as the number of pressure outlet boundaries in "
490  "'fixed-pressure/fixed-pressure-zero-gradient' (size " +
491  std::to_string(num_pressure_outlets) + ")");
492 
493  const std::string u_names[3] = {"u", "v", "w"};
494  for (const auto & [outlet_bdy, momentum_outlet_type] : _momentum_outlet_types)
495  {
496  // Zero tangeantial gradient condition on velocity
497  if (momentum_outlet_type == "zero-gradient" || momentum_outlet_type == "fixed-pressure" ||
498  momentum_outlet_type == "fixed-pressure-zero-gradient")
499  {
500  const std::string bc_type = "LinearFVAdvectionDiffusionOutflowBC";
501  InputParameters params = getFactory().getValidParams(bc_type);
502  params.set<std::vector<BoundaryName>>("boundary") = {outlet_bdy};
503  params.set<bool>("use_two_term_expansion") = getParam<bool>("momentum_two_term_bc_expansion");
504 
505  for (const auto d : make_range(dimension()))
506  {
507  params.set<LinearVariableName>("variable") = _velocity_names[d];
508  getProblem().addLinearFVBC(bc_type, _velocity_names[d] + "_" + outlet_bdy, params);
509  }
510  }
511 
512  // Fixed pressure condition, coming in the pressure correction equation
513  if (momentum_outlet_type == "fixed-pressure" ||
514  momentum_outlet_type == "fixed-pressure-zero-gradient")
515  {
516  const std::string bc_type = "LinearFVAdvectionDiffusionFunctorDirichletBC";
517  InputParameters params = getFactory().getValidParams(bc_type);
518  params.set<LinearVariableName>("variable") = _pressure_name;
519  params.set<MooseFunctorName>("functor") = libmesh_map_find(_pressure_functors, outlet_bdy);
520  params.set<std::vector<BoundaryName>>("boundary") = {outlet_bdy};
521 
522  getProblem().addLinearFVBC(bc_type, _pressure_name + "_" + outlet_bdy, params);
523  }
524  }
525 }
Factory & getFactory()
void paramError(const std::string &param, Args... args) const
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
const NonlinearVariableName _pressure_name
Pressure name.
unsigned int dimension() const
virtual FEProblemBase & getProblem()
std::map< BoundaryName, MooseEnum > _momentum_outlet_types
Momentum outlet boundary types.
const std::vector< std::string > _velocity_names
Velocity names.
std::map< BoundaryName, MooseFunctorName > _pressure_functors
Functors describing the outlet pressure on each boundary.
virtual void addLinearFVBC(const std::string &fv_bc_name, const std::string &name, InputParameters &parameters)
IntRange< T > make_range(T beg, T end)

◆ addPorousMediumSpeedMaterial()

void WCNSFVFlowPhysicsBase::addPorousMediumSpeedMaterial ( )
protectedinherited

Add material to define the local speed in porous medium flows.

Definition at line 318 of file WCNSFVFlowPhysicsBase.C.

Referenced by WCNSFVFlowPhysicsBase::addMaterials().

319 {
320  InputParameters params = getFactory().getValidParams("PINSFVSpeedFunctorMaterial");
321  assignBlocks(params, _blocks);
322 
323  for (unsigned int dim_i = 0; dim_i < dimension(); ++dim_i)
324  params.set<MooseFunctorName>(NS::superficial_velocity_vector[dim_i]) = _velocity_names[dim_i];
326  params.set<MooseFunctorName>(NS::porosity) = _flow_porosity_functor_name;
327  else
328  params.set<MooseFunctorName>(NS::porosity) = "1";
329  params.set<bool>("define_interstitial_velocity_components") = _porous_medium_treatment;
330 
332  "PINSFVSpeedFunctorMaterial", prefix() + "pins_speed_material", params);
333 }
std::string prefix() const
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
Factory & getFactory()
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
virtual void addFunctorMaterial(const std::string &functor_material_name, const std::string &name, InputParameters &parameters)
const bool _porous_medium_treatment
Whether to use the porous medium treatment.
std::vector< SubdomainName > _blocks
unsigned int dimension() const
virtual FEProblemBase & getProblem()
static const std::string porosity
Definition: NS.h:108
static const std::string superficial_velocity_vector[3]
Definition: NS.h:55
const std::vector< std::string > _velocity_names
Velocity names.
MooseFunctorName _flow_porosity_functor_name
Name of the porosity functor for the flow equations (if smoothed)

◆ addPostprocessors()

void WCNSFVFlowPhysicsBase::addPostprocessors ( )
overrideprotectedvirtualinherited

Reimplemented from PhysicsBase.

Definition at line 457 of file WCNSFVFlowPhysicsBase.C.

458 {
459  const auto momentum_inlet_types = getParam<MultiMooseEnum>("momentum_inlet_types");
460 
461  for (unsigned int bc_ind = 0; bc_ind < momentum_inlet_types.size(); ++bc_ind)
462  if (momentum_inlet_types[bc_ind] == "flux-mass" ||
463  momentum_inlet_types[bc_ind] == "flux-velocity")
464  {
465  const std::string pp_type = "AreaPostprocessor";
466  InputParameters params = getFactory().getValidParams(pp_type);
467  params.set<std::vector<BoundaryName>>("boundary") = {_inlet_boundaries[bc_ind]};
468  params.set<ExecFlagEnum>("execute_on") = EXEC_INITIAL;
469 
470  const auto name_pp = "area_pp_" + _inlet_boundaries[bc_ind];
471  if (!getProblem().hasUserObject(name_pp))
472  getProblem().addPostprocessor(pp_type, name_pp, params);
473  }
474 }
Factory & getFactory()
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
bool hasUserObject(const std::string &name) const
virtual FEProblemBase & getProblem()
virtual void addPostprocessor(const std::string &pp_name, const std::string &name, InputParameters &parameters)
const std::vector< BoundaryName > _inlet_boundaries
Boundaries with a flow inlet specified on them.

◆ addPressureCorrectionKernels()

void WCNSLinearFVFlowPhysics::addPressureCorrectionKernels ( )
private

Function adding kernels for the incompressible pressure correction equation.

Definition at line 197 of file WCNSLinearFVFlowPhysics.C.

Referenced by addFVKernels().

198 {
199  {
200  std::string kernel_type = "LinearFVAnisotropicDiffusion";
201  std::string kernel_name = prefix() + "p_diffusion";
202 
203  InputParameters params = getFactory().getValidParams(kernel_type);
204  assignBlocks(params, _blocks);
205  params.set<LinearVariableName>("variable") = _pressure_name;
206  params.set<MooseFunctorName>("diffusion_tensor") = "Ainv";
207  params.set<bool>("use_nonorthogonal_correction") = _non_orthogonal_correction;
208 
209  getProblem().addLinearFVKernel(kernel_type, kernel_name, params);
210  }
211  {
212  std::string kernel_type = "LinearFVDivergence";
213  std::string kernel_name = prefix() + "HbyA_divergence";
214 
215  InputParameters params = getFactory().getValidParams(kernel_type);
216  assignBlocks(params, _blocks);
217  params.set<LinearVariableName>("variable") = _pressure_name;
218  params.set<MooseFunctorName>("face_flux") = "HbyA";
219  params.set<bool>("force_boundary_execution") = true;
220 
221  getProblem().addLinearFVKernel(kernel_type, kernel_name, params);
222  }
223 }
std::string prefix() const
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
Factory & getFactory()
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
const NonlinearVariableName _pressure_name
Pressure name.
std::vector< SubdomainName > _blocks
virtual FEProblemBase & getProblem()
const bool _non_orthogonal_correction
Whether to use the correction term for non-orthogonality.
virtual void addLinearFVKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)

◆ addRhieChowUserObjects()

void WCNSLinearFVFlowPhysics::addRhieChowUserObjects ( )
overrideprivatevirtual

Function which adds the RhieChow interpolator user objects for weakly and incompressible formulations.

Implements WCNSFVFlowPhysicsBase.

Definition at line 619 of file WCNSLinearFVFlowPhysics.C.

Referenced by addUserObjects().

620 {
621  mooseAssert(dimension(), "0-dimension not supported");
622 
623  // First make sure that we only add this object once
624  // Potential cases:
625  // - there is a flow physics, and an advection one (UO should be added by one)
626  // - there is only an advection physics (UO should be created)
627  // - there are two advection physics on different blocks with set velocities (first one picks)
628  // Counting RC UOs defined on the same blocks seems to be the most fool proof option
629  std::vector<UserObject *> objs;
630  getProblem()
631  .theWarehouse()
632  .query()
633  .condition<AttribSystem>("UserObject")
634  .condition<AttribThread>(0)
635  .queryInto(objs);
636  unsigned int num_rc_uo = 0;
637  for (const auto & obj : objs)
638  if (dynamic_cast<RhieChowMassFlux *>(obj))
639  {
640  const auto rc_obj = dynamic_cast<RhieChowMassFlux *>(obj);
641  if (rc_obj->blocks() == _blocks)
642  num_rc_uo++;
643  // one of the RC user object is defined everywhere
644  else if (rc_obj->blocks().size() == 0 || _blocks.size() == 0)
645  num_rc_uo++;
646  }
647 
648  if (num_rc_uo)
649  return;
650 
651  const std::string u_names[3] = {"u", "v", "w"};
652  const auto object_type = "RhieChowMassFlux";
653 
654  auto params = getFactory().getValidParams(object_type);
655  assignBlocks(params, _blocks);
656  for (unsigned int d = 0; d < dimension(); ++d)
657  params.set<VariableName>(u_names[d]) = _velocity_names[d];
658 
659  params.set<VariableName>("pressure") = _pressure_name;
660  params.set<std::string>("p_diffusion_kernel") = prefix() + "p_diffusion";
661  params.set<MooseFunctorName>(NS::density) = _density_name;
662  params.set<MooseEnum>("pressure_projection_method") =
663  getParam<MooseEnum>("pressure_projection_method");
664 
665  getProblem().addUserObject(object_type, rhieChowUOName(), params);
666 }
std::string prefix() const
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
User object responsible for determining the face fluxes using the Rhie-Chow interpolation in a segreg...
Factory & getFactory()
const MooseFunctorName _density_name
Name of the density material property.
static const std::string density
Definition: NS.h:34
InputParameters getValidParams(const std::string &name) const
const NonlinearVariableName _pressure_name
Pressure name.
std::vector< SubdomainName > _blocks
unsigned int dimension() const
virtual FEProblemBase & getProblem()
TheWarehouse & theWarehouse() const
const std::vector< std::string > _velocity_names
Velocity names.
virtual std::vector< std::shared_ptr< UserObject > > addUserObject(const std::string &user_object_name, const std::string &name, InputParameters &parameters)
Query query()
const UserObjectName & rhieChowUOName() const
Return the name of the Rhie Chow user object.

◆ addSeparatorBC()

virtual void WCNSLinearFVFlowPhysics::addSeparatorBC ( )
inlineoverrideprivatevirtual

Implements WCNSFVFlowPhysicsBase.

Definition at line 57 of file WCNSLinearFVFlowPhysics.h.

57 {}

◆ addSolverVariables()

void WCNSLinearFVFlowPhysics::addSolverVariables ( )
overrideprivatevirtual

Implements WCNSFVFlowPhysicsBase.

Definition at line 106 of file WCNSLinearFVFlowPhysics.C.

107 {
108  if (!_has_flow_equations)
109  return;
110 
111  for (const auto d : make_range(dimension()))
114 
115  const std::vector<std::string> v_short = {"u", "v", "w"};
116 
117  // Check number of variables
118  if (_velocity_names.size() != dimension() && _velocity_names.size() != 3)
119  paramError("velocity_variable",
120  "The number of velocity variable names supplied to the NSFVAction is not " +
121  Moose::stringify(dimension()) + " (mesh dimension)" +
122  ((dimension() == 3) ? "" : " or 3!") + "\nVelocity variables " +
124 
125  // Velocities
126  for (const auto d : make_range(dimension()))
127  {
128  if (!shouldCreateVariable(_velocity_names[d], _blocks, /*error if aux*/ true))
129  reportPotentiallyMissedParameters({"system_names"}, "MooseLinearVariableFVReal");
130  else if (_define_variables)
131  {
132  std::string variable_type = "MooseLinearVariableFVReal";
133 
134  auto params = getFactory().getValidParams(variable_type);
135  assignBlocks(params, _blocks);
136  params.set<SolverSystemName>("solver_sys") = getSolverSystem(_velocity_names[d]);
137 
138  getProblem().addVariable(variable_type, _velocity_names[d], params);
139  }
140  else
141  paramError("velocity_variable",
142  "Variable (" + _velocity_names[d] +
143  ") supplied to the WCNSLinearFVFlowPhysics does not exist!");
144  }
145 
146  // Pressure
147  if (!shouldCreateVariable(_pressure_name, _blocks, /*error if aux*/ true))
148  reportPotentiallyMissedParameters({"system_names"}, "MooseLinearVariableFVReal");
149  else if (_define_variables)
150  {
151  const auto pressure_type = "MooseLinearVariableFVReal";
152 
153  auto params = getFactory().getValidParams(pressure_type);
154  assignBlocks(params, _blocks);
155  params.set<SolverSystemName>("solver_sys") = getSolverSystem(_pressure_name);
156 
157  getProblem().addVariable(pressure_type, _pressure_name, params);
158  }
159  else
160  paramError("pressure_variable",
161  "Variable (" + _pressure_name +
162  ") supplied to the WCNSLinearFVFlowPhysics does not exist!");
163 }
const bool _has_flow_equations
Boolean to keep track of whether the flow equations should be created.
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
bool shouldCreateVariable(const VariableName &var_name, const std::vector< SubdomainName > &blocks, const bool error_if_aux)
Factory & getFactory()
void paramError(const std::string &param, Args... args) const
InputParameters getValidParams(const std::string &name) const
void reportPotentiallyMissedParameters(const std::vector< std::string > &param_names, const std::string &object_type, const std::string &object_name="") const
const NonlinearVariableName _pressure_name
Pressure name.
std::vector< SubdomainName > _blocks
unsigned int dimension() const
virtual FEProblemBase & getProblem()
const SolverSystemName & getSolverSystem(unsigned int variable_index) const
const std::vector< std::string > _velocity_names
Velocity names.
std::string stringify(const T &t)
virtual void addVariable(const std::string &var_type, const std::string &var_name, InputParameters &params)
bool _define_variables
Whether to define variables if they do not exist.
IntRange< T > make_range(T beg, T end)
void saveSolverVariableName(const VariableName &var_name)

◆ addUserObjects()

void WCNSLinearFVFlowPhysics::addUserObjects ( )
overrideprivatevirtual

Implements WCNSFVFlowPhysicsBase.

Definition at line 611 of file WCNSLinearFVFlowPhysics.C.

612 {
613  mooseAssert(!_porous_medium_treatment, "Not implemented");
614  // Rhie Chow user object for interpolation velocities
616 }
virtual void addRhieChowUserObjects() override
Function which adds the RhieChow interpolator user objects for weakly and incompressible formulations...
const bool _porous_medium_treatment
Whether to use the porous medium treatment.

◆ addWallsBC()

void WCNSLinearFVFlowPhysics::addWallsBC ( )
overrideprivatevirtual

Implements WCNSFVFlowPhysicsBase.

Definition at line 528 of file WCNSLinearFVFlowPhysics.C.

529 {
530  const std::string u_names[3] = {"u", "v", "w"};
531  bool has_symmetry_bc = false;
532 
533  for (const auto & [boundary_name, momentum_wall_type] : _momentum_wall_types)
534  {
535  if (momentum_wall_type == "noslip")
536  {
537  const std::string bc_type = "LinearFVAdvectionDiffusionFunctorDirichletBC";
538  InputParameters params = getFactory().getValidParams(bc_type);
539  params.set<std::vector<BoundaryName>>("boundary") = {boundary_name};
540 
541  for (const auto d : make_range(dimension()))
542  {
543  params.set<LinearVariableName>("variable") = _velocity_names[d];
544  if (_momentum_wall_functors.count(boundary_name) == 0)
545  params.set<MooseFunctorName>("functor") = "0";
546  else
547  params.set<MooseFunctorName>("functor") = _momentum_wall_functors[boundary_name][d];
548 
549  getProblem().addLinearFVBC(bc_type, _velocity_names[d] + "_" + boundary_name, params);
550  }
551  }
552  else if (momentum_wall_type == "symmetry")
553  {
554  has_symmetry_bc = true;
555  {
556  const std::string bc_type = "LinearFVVelocitySymmetryBC";
557  InputParameters params = getFactory().getValidParams(bc_type);
558  params.set<std::vector<BoundaryName>>("boundary") = {boundary_name};
559  for (unsigned int d = 0; d < dimension(); ++d)
560  params.set<SolverVariableName>(u_names[d]) = _velocity_names[d];
561 
562  for (const auto d : make_range(dimension()))
563  {
564  params.set<LinearVariableName>("variable") = _velocity_names[d];
565  params.set<MooseEnum>("momentum_component") = NS::directions[d];
566 
567  getProblem().addLinearFVBC(bc_type, _velocity_names[d] + "_" + boundary_name, params);
568  }
569  }
570  {
571  const std::string bc_type = "LinearFVPressureSymmetryBC";
572  InputParameters params = getFactory().getValidParams(bc_type);
573  params.set<std::vector<BoundaryName>>("boundary") = {boundary_name};
574  params.set<LinearVariableName>("variable") = _pressure_name;
575  params.set<MooseFunctorName>("HbyA_flux") = "HbyA";
576  getProblem().addLinearFVBC(bc_type, _pressure_name + "_" + boundary_name, params);
577  }
578  }
579  else
580  mooseError("Unsupported wall boundary condition type: " + std::string(momentum_wall_type));
581  }
582 
583  if (getParam<bool>("pressure_two_term_bc_expansion"))
584  {
585  if (!has_symmetry_bc)
586  {
587  const std::string bc_type = "LinearFVExtrapolatedPressureBC";
588  InputParameters params = getFactory().getValidParams(bc_type);
589  params.set<std::vector<BoundaryName>>("boundary") = _wall_boundaries;
590  params.set<LinearVariableName>("variable") = _pressure_name;
591  params.set<bool>("use_two_term_expansion") = true;
593  bc_type, _pressure_name + "_extrapolation_" + Moose::stringify(_wall_boundaries), params);
594  }
595  else
596  for (const auto & [boundary_name, momentum_wall_type] : _momentum_wall_types)
597  if (momentum_wall_type != "symmetry")
598  {
599  const std::string bc_type = "LinearFVExtrapolatedPressureBC";
600  InputParameters params = getFactory().getValidParams(bc_type);
601  params.set<std::vector<BoundaryName>>("boundary") = {boundary_name};
602  params.set<LinearVariableName>("variable") = _pressure_name;
603  params.set<bool>("use_two_term_expansion") = true;
605  bc_type, _pressure_name + "_extrapolation_" + boundary_name, params);
606  }
607  }
608 }
Factory & getFactory()
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
std::map< BoundaryName, std::vector< MooseFunctorName > > _momentum_wall_functors
Functors describing the momentum for each wall boundary.
const NonlinearVariableName _pressure_name
Pressure name.
const std::vector< BoundaryName > _wall_boundaries
Boundaries which define a wall (slip/noslip/etc.)
unsigned int dimension() const
static const std::string directions[3]
Definition: NS.h:23
virtual FEProblemBase & getProblem()
const std::vector< std::string > _velocity_names
Velocity names.
std::string stringify(const T &t)
std::map< BoundaryName, MooseEnum > _momentum_wall_types
Momentum wall boundary types.
virtual void addLinearFVBC(const std::string &fv_bc_name, const std::string &name, InputParameters &parameters)
IntRange< T > make_range(T beg, T end)
void mooseError(Args &&... args) const

◆ compressibility()

const MooseEnum& WCNSFVFlowPhysicsBase::compressibility ( ) const
inlineinherited

Return the compressibility of the flow equations selected.

Definition at line 53 of file WCNSFVFlowPhysicsBase.h.

53 { return _compressibility; }
const MooseEnum _compressibility
Compressibility type, can be compressible, incompressible or weakly-compressible. ...

◆ densityName()

const MooseFunctorName& WCNSFVFlowPhysicsBase::densityName ( ) const
inlineinherited

◆ dynamicViscosityName()

const MooseFunctorName& WCNSFVFlowPhysicsBase::dynamicViscosityName ( ) const
inlineinherited

◆ getAdditionalRMParams()

InputParameters NavierStokesPhysicsBase::getAdditionalRMParams ( ) const
overrideprotectedvirtualinherited

Parameters to change or add relationship managers.

Reimplemented from PhysicsBase.

Definition at line 42 of file NavierStokesPhysicsBase.C.

43 {
44  unsigned short necessary_layers = getParam<unsigned short>("ghost_layers");
45  necessary_layers = std::max(necessary_layers, getNumberAlgebraicGhostingLayersNeeded());
46 
47  // Just an object that has a ghost_layers parameter
48  const std::string kernel_type = "INSFVMixingLengthReynoldsStress";
49  InputParameters params = getFactory().getValidParams(kernel_type);
50  params.template set<unsigned short>("ghost_layers") = necessary_layers;
51 
52  return params;
53 }
Factory & getFactory()
InputParameters getValidParams(const std::string &name) const
virtual unsigned short getNumberAlgebraicGhostingLayersNeeded() const =0
Return the number of ghosting layers needed.

◆ getAxisymmetricRZBlocks()

std::vector< SubdomainName > WCNSFVFlowPhysicsBase::getAxisymmetricRZBlocks ( ) const
protectedinherited

Return the set of blocks restricted to an RZ coordinate system.

Definition at line 536 of file WCNSFVFlowPhysicsBase.C.

Referenced by WCNSFVTurbulencePhysics::addAxisymmetricTurbulentViscousSource(), and WCNSFVFlowPhysicsBase::addAxisymmetricViscousSource().

537 {
538  std::vector<SubdomainName> rz_blocks;
539  const auto & mesh = getProblem().mesh();
540 
541  const bool use_all_blocks =
542  _blocks.empty() || allMeshBlocks(_blocks) ||
543  std::find(_blocks.begin(), _blocks.end(), "ANY_BLOCK_ID") != _blocks.end();
544 
545  std::vector<SubdomainID> block_ids;
546  if (use_all_blocks)
547  {
548  const auto & mesh_blocks = mesh.meshSubdomains();
549  block_ids.insert(block_ids.end(), mesh_blocks.begin(), mesh_blocks.end());
550  }
551  else
552  block_ids = mesh.getSubdomainIDs(_blocks);
553 
554  for (const auto subdomain_id : block_ids)
555  if (mesh.getCoordSystem(subdomain_id) == Moose::COORD_RZ)
556  {
557  auto name = mesh.getSubdomainName(subdomain_id);
558  if (name.empty())
559  name = Moose::stringify(subdomain_id);
560  rz_blocks.push_back(name);
561  }
562 
563  return rz_blocks;
564 }
MeshBase & mesh
bool allMeshBlocks(const std::vector< SubdomainName > &blocks) const
std::vector< SubdomainName > _blocks
virtual FEProblemBase & getProblem()
const std::string & name() const
std::string stringify(const T &t)
virtual MooseMesh & mesh() override

◆ getCoupledTurbulencePhysics()

const WCNSFVTurbulencePhysicsBase * WCNSFVFlowPhysicsBase::getCoupledTurbulencePhysics ( ) const
protectedinherited

Find the turbulence physics.

Definition at line 503 of file WCNSFVFlowPhysicsBase.C.

Referenced by WCNSFVFlowPhysicsBase::actOnAdditionalTasks().

504 {
505  // User passed it, just use that
506  if (isParamValid("coupled_turbulence_physics"))
507  return getCoupledPhysics<WCNSFVTurbulencePhysicsBase>(
508  getParam<PhysicsName>("coupled_turbulence_physics"));
509  // Look for any physics of the right type, and check the block restriction
510  else
511  {
512  const auto all_turbulence_physics = getCoupledPhysics<const WCNSFVTurbulencePhysicsBase>(true);
513  for (const auto physics : all_turbulence_physics)
514  {
516  physics->name(), physics->blocks(), /*error_if_not_identical=*/false))
517  return physics;
518  else if (_verbose)
519  mooseInfoRepeated("Detected Turbulence Physics '" + physics->name() +
520  "' with an incompatible block restriction. It will thus not be coupled "
521  "to this flow equations physics");
522  }
523  }
524  // Did not find one
525  return nullptr;
526 }
void mooseInfoRepeated(Args &&... args)
const bool _verbose
bool checkBlockRestrictionIdentical(const std::string &object_name, const std::vector< SubdomainName > &blocks, const bool error_if_not_identical=true) const
bool isParamValid(const std::string &name) const

◆ getFlowVariableName()

VariableName WCNSFVFlowPhysicsBase::getFlowVariableName ( const std::string &  default_name) const
protectedinherited

Convenience routine to be able to retrieve the actual variable names from their default names.

Definition at line 477 of file WCNSFVFlowPhysicsBase.C.

478 {
479  if (short_name == NS::pressure)
480  return getPressureName();
481  else if (short_name == NS::velocity_x && dimension() > 0)
482  return getVelocityNames()[0];
483  else if (short_name == NS::velocity_y && dimension() > 1)
484  return getVelocityNames()[1];
485  else if (short_name == NS::velocity_z && dimension() > 2)
486  return getVelocityNames()[2];
487  else if (short_name == NS::temperature)
488  return getFluidTemperatureName();
489  else
490  mooseError("Short Variable name '", short_name, "' not recognized.");
491 }
const std::vector< std::string > & getVelocityNames() const
To interface with other Physics.
static const std::string velocity_z
Definition: NS.h:49
static const std::string velocity_x
Definition: NS.h:47
static const std::string temperature
Definition: NS.h:60
unsigned int dimension() const
const NonlinearVariableName & getFluidTemperatureName() const
static const std::string velocity_y
Definition: NS.h:48
static const std::string pressure
Definition: NS.h:57
void mooseError(Args &&... args) const
const NonlinearVariableName & getPressureName() const

◆ getFluidTemperatureName()

const NonlinearVariableName& WCNSFVFlowPhysicsBase::getFluidTemperatureName ( ) const
inlineinherited

Definition at line 48 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSFVTurbulencePhysics::addFluidEnergyTurbulenceKernels(), and WCNSFVFlowPhysicsBase::getFlowVariableName().

48 { return _fluid_temperature_name; }
const NonlinearVariableName _fluid_temperature_name
Fluid temperature name.

◆ getFluxInletDirections()

const std::vector<Point>& WCNSFVFlowPhysicsBase::getFluxInletDirections ( ) const
inlineinherited

Get the inlet direction if using a flux inlet.

Definition at line 89 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSFVFluidHeatTransferPhysics::addEnergyInletBC(), and WCNSFVScalarTransportPhysics::addScalarInletBC().

89 { return _flux_inlet_directions; }
std::vector< Point > _flux_inlet_directions
Direction of each flux inlet. Indexing based on the number of flux boundaries.

◆ getFluxInletPPs()

const std::vector<PostprocessorName>& WCNSFVFlowPhysicsBase::getFluxInletPPs ( ) const
inlineinherited

Get the inlet flux postprocessor if using a flux inlet.

Definition at line 91 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSFVFluidHeatTransferPhysics::addEnergyInletBC(), and WCNSFVScalarTransportPhysics::addScalarInletBC().

91 { return _flux_inlet_pps; }
std::vector< PostprocessorName > _flux_inlet_pps
Postprocessors describing the momentum inlet for each boundary. Indexing based on the number of flux ...

◆ getHydraulicSeparators()

const std::vector<BoundaryName>& WCNSFVFlowPhysicsBase::getHydraulicSeparators ( ) const
inlineinherited

Get the hydraulic separator boundaries.

Definition at line 81 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSFVFluidHeatTransferPhysics::addEnergySeparatorBC().

81 { return _hydraulic_separators; }
const std::vector< BoundaryName > _hydraulic_separators
Hydraulic separator boundaries.

◆ getInletBoundaries()

const std::vector<BoundaryName>& WCNSFVFlowPhysicsBase::getInletBoundaries ( ) const
inlineinherited

◆ getLinearFrictionCoefName()

virtual MooseFunctorName WCNSLinearFVFlowPhysics::getLinearFrictionCoefName ( ) const
inlineoverrideprivatevirtual

Get the name of the linear friction coefficient. Returns an empty string if no friction.

Implements WCNSFVFlowPhysicsBase.

Definition at line 64 of file WCNSLinearFVFlowPhysics.h.

65  {
66  mooseError("Not implemented");
67  }
void mooseError(Args &&... args) const

◆ getMomentumAdvectionFaceInterpolationMethod()

const MooseEnum& WCNSFVFlowPhysicsBase::getMomentumAdvectionFaceInterpolationMethod ( ) const
inlineinherited

Get the face interpolation method for momentum in the advection term.

Definition at line 65 of file WCNSFVFlowPhysicsBase.h.

66  {
68  }
const MooseEnum _momentum_advection_interpolation
The momentum face interpolation method for being advected.

◆ getMomentumFaceInterpolationMethod()

const MooseEnum& WCNSFVFlowPhysicsBase::getMomentumFaceInterpolationMethod ( ) const
inlineinherited

Get the face interpolation method for momentum (mostly used in the stress terms)

Definition at line 70 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSFVTwoPhaseMixturePhysics::addAdvectionSlipTerm(), and WCNSFVTurbulencePhysics::addFlowTurbulenceKernels().

71  {
73  }
const MooseEnum _momentum_face_interpolation
The momentum face interpolation method for stress terms.

◆ getNumberAlgebraicGhostingLayersNeeded()

unsigned short WCNSLinearFVFlowPhysics::getNumberAlgebraicGhostingLayersNeeded ( ) const
overrideprivatevirtual

Return the number of algebraic ghosting layers needed.

Reimplemented from WCNSFVFlowPhysicsBase.

Definition at line 695 of file WCNSLinearFVFlowPhysics.C.

696 {
697  return 1;
698 }

◆ getOutletBoundaries()

const std::vector<BoundaryName>& WCNSFVFlowPhysicsBase::getOutletBoundaries ( ) const
inlineinherited

Get the outlet boundaries.

Definition at line 77 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSLinearFVFluidHeatTransferPhysics::addEnergyOutletBC(), and WCNSLinearFVScalarTransportPhysics::addScalarOutletBC().

77 { return _outlet_boundaries; }
const std::vector< BoundaryName > _outlet_boundaries
Boundaries with a flow outlet specified on them.

◆ getPorosityFunctorName()

MooseFunctorName WCNSFVFlowPhysicsBase::getPorosityFunctorName ( const bool  smoothed) const
inherited

Definition at line 494 of file WCNSFVFlowPhysicsBase.C.

Referenced by WCNSFVFluidHeatTransferPhysics::addEnergyHeatConductionKernels(), WCNSFVFluidHeatTransferPhysics::addEnergyTimeKernels(), WCNSFVScalarTransportPhysics::addScalarAdvectionKernels(), and WCNSFVCoupledAdvectionPhysicsHelper::getPorosityFunctorName().

495 {
496  if (smoothed)
498  else
499  return _porosity_name;
500 }
const MooseFunctorName _porosity_name
Name of the porosity functor.
MooseFunctorName _flow_porosity_functor_name
Name of the porosity functor for the flow equations (if smoothed)

◆ getPressureName()

const NonlinearVariableName& WCNSFVFlowPhysicsBase::getPressureName ( ) const
inlineinherited

◆ getVelocityFaceInterpolationMethod()

const MooseEnum& WCNSFVFlowPhysicsBase::getVelocityFaceInterpolationMethod ( ) const
inlineinherited

Get the face interpolation method for velocity.

Definition at line 63 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSFVTwoPhaseMixturePhysics::addAdvectionSlipTerm().

63 { return _velocity_interpolation; }
const MooseEnum _velocity_interpolation
The velocity face interpolation method for advecting other quantities.

◆ getVelocityNames()

const std::vector<std::string>& WCNSFVFlowPhysicsBase::getVelocityNames ( ) const
inlineinherited

◆ getWallBoundaries()

const std::vector<BoundaryName>& WCNSFVFlowPhysicsBase::getWallBoundaries ( ) const
inlineinherited

Get the wall boundaries.

Definition at line 79 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSLinearFVFluidHeatTransferPhysics::addEnergyWallBC(), and WCNSFVFluidHeatTransferPhysics::addEnergyWallBC().

79 { return _wall_boundaries; }
const std::vector< BoundaryName > _wall_boundaries
Boundaries which define a wall (slip/noslip/etc.)

◆ gravityVector()

RealVectorValue WCNSFVFlowPhysicsBase::gravityVector ( ) const
inlineinherited

Return the gravity vector.

Definition at line 57 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSFVTwoPhaseMixturePhysics::addFunctorMaterials(), WCNSLinearFVTwoPhaseMixturePhysics::addMaterials(), and WCNSLinearFVTwoPhaseMixturePhysics::checkIntegrity().

57 { return getParam<RealVectorValue>("gravity"); }

◆ hasFlowEquations()

bool WCNSFVFlowPhysicsBase::hasFlowEquations ( ) const
inlineinherited

Whether the physics is actually creating the flow equations.

Definition at line 37 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSFVTurbulencePhysics::addFlowTurbulenceKernels(), WCNSLinearFVTwoPhaseMixturePhysics::addFVKernels(), WCNSFVTwoPhaseMixturePhysics::addFVKernels(), and WCNSFVTurbulencePhysicsBase::retrieveCoupledPhysics().

37 { return _has_flow_equations; }
const bool _has_flow_equations
Boolean to keep track of whether the flow equations should be created.

◆ hasForchheimerFriction()

virtual bool WCNSLinearFVFlowPhysics::hasForchheimerFriction ( ) const
inlineoverrideprivatevirtual

Return whether a Forchheimer friction model is in use.

Implements WCNSFVFlowPhysicsBase.

Definition at line 59 of file WCNSLinearFVFlowPhysics.h.

59 { return false; };

◆ hasTurbulencePhysics()

bool WCNSFVFlowPhysicsBase::hasTurbulencePhysics ( ) const
inlineprotectedinherited

Whether a turbulence Physics has been coupled in, to know which viscosity to pick on symmetry boundary conditions.

Definition at line 156 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSFVFlowPhysics::addWallsBC().

157  {
160  else
161  return false;
162  }
bool hasTurbulenceModel() const
Whether a turbulence model is in use.
const WCNSFVTurbulencePhysicsBase * _turbulence_physics
Can be set to a coupled turbulence physics.

◆ includeIsotropicStress()

bool WCNSFVFlowPhysicsBase::includeIsotropicStress ( ) const
inlineinherited

Whether to include the isotropic viscous stress contribution.

Definition at line 43 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSFVTurbulencePhysics::addFlowTurbulenceKernels(), and WCNSFVFlowPhysics::addMomentumViscousDissipationKernels().

const bool _include_isotropic_viscous_stress
Whether to include the isotropic viscous stress contribution.

◆ includeSymmetrizedViscousStress()

bool WCNSFVFlowPhysicsBase::includeSymmetrizedViscousStress ( ) const
inlineinherited

Whether to include the symmetrized contribution in the viscous stress.

Definition at line 41 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSFVTurbulencePhysics::addAxisymmetricTurbulentViscousSource(), WCNSFVFlowPhysics::addAxisymmetricViscousSourceKernel(), addMomentumFluxKernels(), and WCNSFVFlowPhysics::addMomentumViscousDissipationKernels().

const bool _include_symmetrized_viscous_stress
Whether to include the symmetrized viscous stress contribution.

◆ initializePhysicsAdditional()

void WCNSLinearFVFlowPhysics::initializePhysicsAdditional ( )
overrideprotectedvirtual

Reimplemented from WCNSFVFlowPhysicsBase.

Definition at line 86 of file WCNSLinearFVFlowPhysics.C.

87 {
89  // TODO Add support for multi-system by either:
90  // - creating the problem in the Physics or,
91  // - checking that the right systems are being created
93  // TODO Ban all other nonlinear Physics for now
94 
95  // Fix the default system names if using a different dimension
96  if (!isParamSetByUser("system_name"))
97  {
98  if (dimension() == 1)
99  _system_names = {"u_system", "pressure_system"};
100  else if (dimension() == 2)
101  _system_names = {"u_system", "v_system", "pressure_system"};
102  }
103 }
virtual void initializePhysicsAdditional() override
unsigned int dimension() const
virtual FEProblemBase & getProblem()
void needSolutionState(unsigned int oldest_needed, Moose::SolutionIterationType iteration_type)
bool isParamSetByUser(const std::string &name) const
std::vector< SolverSystemName > _system_names

◆ inletBoundaryType()

NS::MomentumInletTypes WCNSFVFlowPhysicsBase::inletBoundaryType ( const BoundaryName &  boundary_name) const
inlineinherited

Get the type of the inlet BC.

Definition at line 83 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSFVFluidHeatTransferPhysics::addEnergyInletBC().

84  {
86  static_cast<int>(libmesh_map_find(_momentum_inlet_types, boundary_name)));
87  }
MomentumInletTypes
Definition: NS.h:215
std::map< BoundaryName, MooseEnum > _momentum_inlet_types
Momentum inlet boundary types.

◆ porousMediumTreatment()

bool WCNSFVFlowPhysicsBase::porousMediumTreatment ( ) const
inlineinherited

Return whether a porous medium treatment is applied.

Definition at line 55 of file WCNSFVFlowPhysicsBase.h.

55 { return _porous_medium_treatment; }
const bool _porous_medium_treatment
Whether to use the porous medium treatment.

◆ rhieChowUOName()

const UserObjectName & WCNSFVFlowPhysicsBase::rhieChowUOName ( ) const
inherited

Return the name of the Rhie Chow user object.

Definition at line 529 of file WCNSFVFlowPhysicsBase.C.

Referenced by WCNSFVTwoPhaseMixturePhysics::addAdvectionSlipTerm(), WCNSFVTurbulencePhysics::addAxisymmetricTurbulentViscousSource(), WCNSFVFlowPhysics::addAxisymmetricViscousSourceKernel(), WCNSLinearFVFluidHeatTransferPhysics::addEnergyAdvectionKernels(), WCNSFVFluidHeatTransferPhysics::addEnergyAdvectionKernels(), WCNSFVTurbulencePhysics::addFlowTurbulenceKernels(), WCNSFVFlowPhysics::addInletBC(), WCNSLinearFVTurbulencePhysics::addKEpsilonAdvection(), WCNSFVTurbulencePhysics::addKEpsilonAdvection(), WCNSFVFlowPhysics::addMassKernels(), WCNSFVFlowPhysics::addMomentumAdvectionKernels(), WCNSFVFlowPhysics::addMomentumBoussinesqKernels(), addMomentumFluxKernels(), WCNSFVFlowPhysics::addMomentumFrictionKernels(), WCNSFVFlowPhysics::addMomentumGravityKernels(), WCNSFVFlowPhysics::addMomentumPressureKernels(), WCNSFVFlowPhysics::addMomentumTimeKernels(), WCNSFVFlowPhysics::addMomentumViscousDissipationKernels(), WCNSFVFlowPhysics::addOutletBC(), WCNSLinearFVTwoPhaseMixturePhysics::addPhaseDriftFluxTerm(), WCNSFVTwoPhaseMixturePhysics::addPhaseDriftFluxTerm(), addRhieChowUserObjects(), WCNSLinearFVScalarTransportPhysics::addScalarAdvectionKernels(), WCNSFVScalarTransportPhysics::addScalarAdvectionKernels(), WCNSFVFlowPhysics::addSeparatorBC(), and WCNSFVFlowPhysics::addWallsBC().

530 {
531  mooseAssert(!_rc_uo_name.empty(), "The Rhie-Chow user-object name should be set!");
532  return _rc_uo_name;
533 }
UserObjectName _rc_uo_name
name of the Rhie Chow user object

◆ usingNavierStokesFVSyntax()

bool NavierStokesPhysicsBase::usingNavierStokesFVSyntax ( ) const
inlineprotectedinherited

Detects if we are using the new Physics syntax or the old NavierStokesFV action.

Definition at line 32 of file NavierStokesPhysicsBase.h.

33  {
34  return (parameters().get<std::string>("registered_identifier") == "Modules/NavierStokesFV");
35  }
const InputParameters & parameters() const

◆ validParams()

InputParameters WCNSLinearFVFlowPhysics::validParams ( )
static

Definition at line 25 of file WCNSLinearFVFlowPhysics.C.

26 {
28  params.addClassDescription(
29  "Define the Navier Stokes weakly-compressible equations with the linear "
30  "solver implementation of the SIMPLE scheme");
31 
32  params.addParam<bool>(
33  "orthogonality_correction", false, "Whether to use orthogonality correction");
34  params.renameParam("orthogonality_correction", "use_nonorthogonal_correction", "");
35  params.set<unsigned short>("ghost_layers") = 1;
36 
37  // This will be adapted based on the dimension
38  params.set<std::vector<SolverSystemName>>("system_names") = {
39  "u_system", "v_system", "w_system", "pressure_system"};
40 
41  // Implemented in the executioner
42  params.suppressParameter<MooseEnum>("pinned_pressure_type");
43  params.suppressParameter<Point>("pinned_pressure_point");
44  params.suppressParameter<PostprocessorName>("pinned_pressure_value");
45 
46  // Not supported
47  params.suppressParameter<bool>("add_flow_equations");
48  params.set<bool>("porous_medium_treatment") = false;
49  params.suppressParameter<bool>("porous_medium_treatment");
50  params.set<MooseFunctorName>("porosity") = "1";
51  params.suppressParameter<MooseFunctorName>("porosity");
52  params.suppressParameter<MooseEnum>("mu_interp_method");
53  // Not needed
54  params.suppressParameter<bool>("add_flow_equations");
55  params.suppressParameter<MooseEnum>("preconditioning");
56 
57  // No other options so far
58  params.set<MooseEnum>("velocity_interpolation") = "rc";
59  params.suppressParameter<MooseEnum>("velocity_interpolation");
60 
61  // Rhie-Chow
62  params.transferParam<MooseEnum>(RhieChowMassFlux::validParams(), "pressure_projection_method");
63 
64  return params;
65 }
void renameParam(const std::string &old_name, const std::string &new_name, const std::string &new_docstring)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
T & set(const std::string &name, bool quiet_mode=false)
static InputParameters validParams()
void suppressParameter(const std::string &name)
static InputParameters validParams()
void transferParam(const InputParameters &source_param, const std::string &name, const std::string &new_name="", const std::string &new_description="")
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _add_rz_viscous_source

const bool WCNSFVFlowPhysicsBase::_add_rz_viscous_source
protectedinherited

Whether to automatically add the cylindrical viscous source term.

Definition at line 176 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSFVFlowPhysicsBase::addAxisymmetricViscousSource(), and WCNSFVFlowPhysicsBase::addAxisymmetricViscousSourceEnabled().

◆ _compressibility

const MooseEnum WCNSFVFlowPhysicsBase::_compressibility
protectedinherited

◆ _define_variables

bool NavierStokesPhysicsBase::_define_variables
protectedinherited

◆ _density_gravity_name

const MooseFunctorName WCNSFVFlowPhysicsBase::_density_gravity_name
protectedinherited

Name of the density material property used for gravity and Boussinesq terms.

Definition at line 200 of file WCNSFVFlowPhysicsBase.h.

Referenced by addFunctorMaterials(), addMomentumBoussinesqKernels(), WCNSFVFlowPhysics::addMomentumBoussinesqKernels(), and WCNSFVFlowPhysics::addMomentumGravityKernels().

◆ _density_name

const MooseFunctorName WCNSFVFlowPhysicsBase::_density_name
protectedinherited

◆ _dynamic_viscosity_name

const MooseFunctorName WCNSFVFlowPhysicsBase::_dynamic_viscosity_name
protectedinherited

◆ _flow_porosity_functor_name

MooseFunctorName WCNSFVFlowPhysicsBase::_flow_porosity_functor_name
protectedinherited

◆ _fluid_temperature_name

const NonlinearVariableName WCNSFVFlowPhysicsBase::_fluid_temperature_name
protectedinherited

◆ _flux_inlet_directions

std::vector<Point> WCNSFVFlowPhysicsBase::_flux_inlet_directions
protectedinherited

Direction of each flux inlet. Indexing based on the number of flux boundaries.

Definition at line 246 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSFVFlowPhysics::addInletBC(), WCNSFVFlowPhysicsBase::getFluxInletDirections(), and WCNSFVFlowPhysicsBase::WCNSFVFlowPhysicsBase().

◆ _flux_inlet_pps

std::vector<PostprocessorName> WCNSFVFlowPhysicsBase::_flux_inlet_pps
protectedinherited

Postprocessors describing the momentum inlet for each boundary. Indexing based on the number of flux boundaries.

Definition at line 244 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSFVFlowPhysics::addInletBC(), and WCNSFVFlowPhysicsBase::getFluxInletPPs().

◆ _friction_blocks

std::vector<std::vector<SubdomainName> > WCNSFVFlowPhysicsBase::_friction_blocks
protectedinherited

Subdomains where we want to have volumetric friction.

Definition at line 221 of file WCNSFVFlowPhysicsBase.h.

Referenced by addMomentumFrictionKernels(), WCNSFVFlowPhysics::addMomentumFrictionKernels(), and WCNSFVFlowPhysicsBase::WCNSFVFlowPhysicsBase().

◆ _friction_coeffs

std::vector<std::vector<std::string> > WCNSFVFlowPhysicsBase::_friction_coeffs
protectedinherited

The coefficients used for each item if friction type.

Definition at line 225 of file WCNSFVFlowPhysicsBase.h.

Referenced by addMomentumFrictionKernels(), WCNSFVFlowPhysics::addMomentumFrictionKernels(), and WCNSFVFlowPhysics::getLinearFrictionCoefName().

◆ _friction_types

std::vector<std::vector<std::string> > WCNSFVFlowPhysicsBase::_friction_types
protectedinherited

◆ _has_flow_equations

const bool WCNSFVFlowPhysicsBase::_has_flow_equations
protectedinherited

◆ _hydraulic_separators

const std::vector<BoundaryName> WCNSFVFlowPhysicsBase::_hydraulic_separators
protectedinherited

◆ _include_isotropic_viscous_stress

const bool WCNSFVFlowPhysicsBase::_include_isotropic_viscous_stress
protectedinherited

Whether to include the isotropic viscous stress contribution.

Definition at line 206 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSFVFlowPhysicsBase::includeIsotropicStress().

◆ _include_symmetrized_viscous_stress

const bool WCNSFVFlowPhysicsBase::_include_symmetrized_viscous_stress
protectedinherited

Whether to include the symmetrized viscous stress contribution.

Definition at line 204 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSFVFlowPhysicsBase::includeSymmetrizedViscousStress().

◆ _inlet_boundaries

const std::vector<BoundaryName> WCNSFVFlowPhysicsBase::_inlet_boundaries
protectedinherited

◆ _momentum_advection_interpolation

const MooseEnum WCNSFVFlowPhysicsBase::_momentum_advection_interpolation
protectedinherited

The momentum face interpolation method for being advected.

Definition at line 213 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSFVFlowPhysics::addMomentumAdvectionKernels(), addMomentumFluxKernels(), and WCNSFVFlowPhysicsBase::getMomentumAdvectionFaceInterpolationMethod().

◆ _momentum_face_interpolation

const MooseEnum WCNSFVFlowPhysicsBase::_momentum_face_interpolation
protectedinherited

The momentum face interpolation method for stress terms.

Definition at line 215 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSFVFlowPhysicsBase::getMomentumFaceInterpolationMethod().

◆ _momentum_inlet_functors

std::map<BoundaryName, std::vector<MooseFunctorName> > WCNSFVFlowPhysicsBase::_momentum_inlet_functors
protectedinherited

Functors describing the momentum inlet for each boundary.

Definition at line 249 of file WCNSFVFlowPhysicsBase.h.

Referenced by addInletBC(), WCNSFVFlowPhysics::addInletBC(), and WCNSFVFlowPhysicsBase::WCNSFVFlowPhysicsBase().

◆ _momentum_inlet_types

std::map<BoundaryName, MooseEnum> WCNSFVFlowPhysicsBase::_momentum_inlet_types
protectedinherited

◆ _momentum_outlet_types

std::map<BoundaryName, MooseEnum> WCNSFVFlowPhysicsBase::_momentum_outlet_types
protectedinherited

Momentum outlet boundary types.

Definition at line 239 of file WCNSFVFlowPhysicsBase.h.

Referenced by addOutletBC(), WCNSFVFlowPhysics::addOutletBC(), and WCNSFVFlowPhysicsBase::WCNSFVFlowPhysicsBase().

◆ _momentum_wall_functors

std::map<BoundaryName, std::vector<MooseFunctorName> > WCNSFVFlowPhysicsBase::_momentum_wall_functors
protectedinherited

Functors describing the momentum for each wall boundary.

Definition at line 253 of file WCNSFVFlowPhysicsBase.h.

Referenced by addWallsBC(), WCNSFVFlowPhysics::addWallsBC(), and WCNSFVFlowPhysicsBase::WCNSFVFlowPhysicsBase().

◆ _momentum_wall_types

std::map<BoundaryName, MooseEnum> WCNSFVFlowPhysicsBase::_momentum_wall_types
protectedinherited

Momentum wall boundary types.

Definition at line 241 of file WCNSFVFlowPhysicsBase.h.

Referenced by addWallsBC(), WCNSFVFlowPhysics::addWallsBC(), and WCNSFVFlowPhysicsBase::WCNSFVFlowPhysicsBase().

◆ _non_orthogonal_correction

const bool WCNSLinearFVFlowPhysics::_non_orthogonal_correction
private

Whether to use the correction term for non-orthogonality.

Definition at line 72 of file WCNSLinearFVFlowPhysics.h.

Referenced by addMomentumFluxKernels(), and addPressureCorrectionKernels().

◆ _outlet_boundaries

const std::vector<BoundaryName> WCNSFVFlowPhysicsBase::_outlet_boundaries
protectedinherited

Boundaries with a flow outlet specified on them.

Definition at line 230 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSFVFlowPhysicsBase::getOutletBoundaries(), and WCNSFVFlowPhysicsBase::WCNSFVFlowPhysicsBase().

◆ _porosity_name

const MooseFunctorName WCNSFVFlowPhysicsBase::_porosity_name
protectedinherited

◆ _porous_medium_treatment

const bool WCNSFVFlowPhysicsBase::_porous_medium_treatment
protectedinherited

◆ _pressure_functors

std::map<BoundaryName, MooseFunctorName> WCNSFVFlowPhysicsBase::_pressure_functors
protectedinherited

Functors describing the outlet pressure on each boundary.

Definition at line 251 of file WCNSFVFlowPhysicsBase.h.

Referenced by addOutletBC(), WCNSFVFlowPhysics::addOutletBC(), and WCNSFVFlowPhysicsBase::WCNSFVFlowPhysicsBase().

◆ _pressure_name

const NonlinearVariableName WCNSFVFlowPhysicsBase::_pressure_name
protectedinherited

◆ _pressure_tag

const TagName WCNSFVFlowPhysicsBase::_pressure_tag = "p_tag"
protectedinherited

Name of the vector to hold pressure momentum equation contributions.

Definition at line 171 of file WCNSFVFlowPhysicsBase.h.

◆ _rc_uo_name

UserObjectName WCNSFVFlowPhysicsBase::_rc_uo_name
protectedinherited

name of the Rhie Chow user object

Definition at line 209 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSFVFlowPhysicsBase::rhieChowUOName().

◆ _solve_for_dynamic_pressure

const bool WCNSFVFlowPhysicsBase::_solve_for_dynamic_pressure
protectedinherited

◆ _turbulence_physics

const WCNSFVTurbulencePhysicsBase* WCNSFVFlowPhysicsBase::_turbulence_physics
protectedinherited

Can be set to a coupled turbulence physics.

Definition at line 218 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSFVFlowPhysicsBase::actOnAdditionalTasks(), addMomentumFluxKernels(), and WCNSFVFlowPhysicsBase::hasTurbulencePhysics().

◆ _velocity_interpolation

const MooseEnum WCNSFVFlowPhysicsBase::_velocity_interpolation
protectedinherited

The velocity face interpolation method for advecting other quantities.

Definition at line 211 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSFVFlowPhysics::addMassKernels(), WCNSFVFlowPhysics::addMomentumAdvectionKernels(), and WCNSFVFlowPhysicsBase::getVelocityFaceInterpolationMethod().

◆ _velocity_names

const std::vector<std::string> WCNSFVFlowPhysicsBase::_velocity_names
protectedinherited

◆ _wall_boundaries

const std::vector<BoundaryName> WCNSFVFlowPhysicsBase::_wall_boundaries
protectedinherited

Boundaries which define a wall (slip/noslip/etc.)

Definition at line 232 of file WCNSFVFlowPhysicsBase.h.

Referenced by addWallsBC(), WCNSFVFlowPhysicsBase::getWallBoundaries(), and WCNSFVFlowPhysicsBase::WCNSFVFlowPhysicsBase().


The documentation for this class was generated from the following files: