https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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 | Static 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 Porous media use superficial velocity variables, the PorousRhieChowMassFlux user object and, optionally, Bernoulli pressure-jump baffles on user-selected sidesets. More...

#include <WCNSLinearFVFlowPhysics.h>

Inheritance diagram for WCNSLinearFVFlowPhysics:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 WCNSLinearFVFlowPhysics (const InputParameters &parameters)
 
virtual std::vector< UserObjectName > getSuppliedUserObjects () const override
 
bool hasFlowEquations () const
 Whether the physics is actually creating the flow equations.
 
bool addAxisymmetricViscousSourceEnabled () const
 Whether the cylindrical viscous source helper is enabled.
 
bool includeSymmetrizedViscousStress () const
 Whether to include the symmetrized contribution in the viscous stress.
 
bool includeIsotropicStress () const
 Whether to include the isotropic viscous stress contribution.
 
const std::vector< std::string > & getVelocityNames () const
 To interface with other Physics.
 
const NonlinearVariableName & getPressureName () const
 
const NonlinearVariableName & getFluidTemperatureName () const
 
MooseFunctorName getPorosityFunctorName (const bool smoothed) const
 
const MooseEnum & compressibility () const
 Return the compressibility of the flow equations selected.
 
bool porousMediumTreatment () const
 Return whether a porous medium treatment is applied.
 
RealVectorValue gravityVector () const
 Return the gravity vector.
 
const MooseFunctorName & densityName () const
 Return the name of the density functor.
 
const MooseFunctorName & dynamicViscosityName () const
 Return the name of the dynamic viscosity functor.
 
const MooseEnum & getVelocityFaceInterpolationMethod () const
 Get the face interpolation method for velocity.
 
const MooseEnum & getMomentumAdvectionFaceInterpolationMethod () const
 Get the face interpolation method for momentum in the advection term.
 
const MooseEnum & getMomentumFaceInterpolationMethod () const
 Get the face interpolation method for momentum (mostly used in the stress terms)
 
const std::vector< BoundaryName > & getInletBoundaries () const
 Get the inlet boundaries.
 
const std::vector< BoundaryName > & getOutletBoundaries () const
 Get the outlet boundaries.
 
const std::vector< BoundaryName > & getWallBoundaries () const
 Get the wall boundaries.
 
const std::vector< BoundaryName > & getHydraulicSeparators () const
 Get the hydraulic separator boundaries.
 
NS::MomentumInletTypes inletBoundaryType (const BoundaryName &boundary_name) const
 Get the type of the inlet BC.
 
const std::vector< Point > & getFluxInletDirections () const
 Get the inlet direction if using a flux inlet.
 
const std::vector< PostprocessorName > & getFluxInletPPs () const
 Get the inlet flux postprocessor if using a flux inlet.
 
const UserObjectName & rhieChowUOName () const
 Return the name of the Rhie Chow user object.
 
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 T * getCoupledPhysics (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 ActionComponent & getActionComponent (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)
 
MooseApp & getMooseApp () 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 InputParameters & parameters () const
 
const hit::Node * getHitNode () const
 
bool hasBase () const
 
const std::string & getBase () const
 
const T & getParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const T * queryParam (const std::string &name) const
 
const T & getRenamedParam (const std::string &old_name, const std::string &new_name) const
 
T getCheckedPointerParam (const std::string &name, const std::string &error_string="") 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
 
PerfGraph & perfGraph ()
 
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 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.
 
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.
 
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 material property.
 
VariableName getFlowVariableName (const std::string &default_name) const
 Convenience routine to be able to retrieve the actual variable names from their default names.
 
bool hasTurbulencePhysics () const
 Whether a turbulence Physics has been coupled in, to know which viscosity to pick on symmetry boundary conditions.
 
const WCNSFVTurbulencePhysicsBase * getCoupledTurbulencePhysics () const
 Find the turbulence physics.
 
std::vector< SubdomainName > getAxisymmetricRZBlocks () const
 Return the set of blocks restricted to an RZ coordinate system.
 
bool usingNavierStokesFVSyntax () const
 Detects if we are using the new Physics syntax or the old NavierStokesFV action.
 
InputParameters getAdditionalRMParams () const override
 Parameters to change or add relationship managers.
 
void addFVAdvectedInterpolationMethod (const MooseEnum &interpolation_method)
 Add the FVInterpolationMethod object for an advected interpolation method if absent.
 
MooseFunctorName addPorosityScaledFunctor (const MooseFunctorName &porosity, const MooseFunctorName &functor)
 Add, if absent, a non-AD functor material defining the product of a porosity and another functor on the blocks of this Physics.
 
void assertParamDefined (const std::string &param) const
 
bool isTransient () const
 
Factory & getFactory ()
 
Factory & getFactory () const
 
virtual FEProblemBase & getProblem ()
 
virtual const FEProblemBase & getProblem () const
 
void prepareCopyVariablesFromMesh () const
 
void copyVariablesFromMesh (const std::vector< VariableName > &variables_to_copy, bool are_nonlinear=true)
 
std::string prefix () const
 
void addUserObject (const std::string &uo_type, const std::string &uo_name, InputParameters &params)
 
void saveSolverVariableName (const VariableName &var_name)
 
void saveAuxVariableName (const VariableName &var_name)
 
void addSharedSolverVariable (const std::string &var_type, const VariableName &var_name, InputParameters params)
 
void addSharedSolverVariable (const VariableName &var_name, const std::string &family, const std::string &order, Real scaling=1.0)
 
void addSharedAuxVariable (const std::string &var_type, const VariableName &var_name, const InputParameters &params)
 
void addSharedAuxVariable (const VariableName &var_name, const std::string &family, const std::string &order)
 
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< SubdomainID > getSubdomainIDs (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
 
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 T & getMeshProperty (const std::string &data_name, const std::string &prefix)
 
const T & getMeshProperty (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 checkAtMostOneParamSetByUser (const std::vector< std::string > &params) 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.
 
const bool _has_flow_equations
 Boolean to keep track of whether the flow equations should be created.
 
const bool _add_rz_viscous_source
 Whether to automatically add the cylindrical viscous source term.
 
const MooseEnum _compressibility
 Compressibility type, can be compressible, incompressible or weakly-compressible.
 
const bool _solve_for_dynamic_pressure
 Whether we are solving for the total or dynamic pressure.
 
const bool _porous_medium_treatment
 Whether to use the porous medium treatment.
 
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)
 
const std::vector< std::string > _velocity_names
 Velocity names.
 
const NonlinearVariableName _pressure_name
 Pressure name.
 
const NonlinearVariableName _fluid_temperature_name
 Fluid temperature name.
 
const MooseFunctorName _density_name
 Name of the density material property.
 
const MooseFunctorName _density_gravity_name
 Name of the density material property used for gravity and Boussinesq terms.
 
const MooseFunctorName _dynamic_viscosity_name
 Name of the dynamic viscosity material property.
 
const bool _include_symmetrized_viscous_stress
 Whether to include the symmetrized viscous stress contribution.
 
const bool _include_isotropic_viscous_stress
 Whether to include the isotropic viscous stress contribution.
 
UserObjectName _rc_uo_name
 name of the Rhie Chow user object
 
const MooseEnum _velocity_interpolation
 The velocity face interpolation method for advecting other quantities.
 
const MooseEnum _momentum_advection_interpolation
 The momentum face interpolation method for being advected.
 
const MooseEnum _momentum_face_interpolation
 The momentum face interpolation method for stress terms.
 
const WCNSFVTurbulencePhysicsBase * _turbulence_physics
 Can be set to a coupled turbulence physics.
 
std::vector< std::vector< SubdomainName > > _friction_blocks
 Subdomains where we want to have volumetric friction.
 
std::vector< std::vector< std::string > > _friction_types
 The friction correlation types used for each block.
 
std::vector< std::vector< std::string > > _friction_coeffs
 The coefficients used for each item if friction type.
 
const std::vector< BoundaryName > _inlet_boundaries
 Boundaries with a flow inlet specified on them.
 
const std::vector< BoundaryName > _outlet_boundaries
 Boundaries with a flow outlet specified on them.
 
const std::vector< BoundaryName > _wall_boundaries
 Boundaries which define a wall (slip/noslip/etc.)
 
const std::vector< BoundaryName > _hydraulic_separators
 Hydraulic separator boundaries.
 
std::map< BoundaryName, MooseEnum > _momentum_inlet_types
 Momentum inlet boundary types.
 
std::map< BoundaryName, MooseEnum > _momentum_outlet_types
 Momentum outlet boundary types.
 
std::map< BoundaryName, MooseEnum > _momentum_wall_types
 Momentum wall boundary types.
 
std::vector< PostprocessorName > _flux_inlet_pps
 Postprocessors describing the momentum inlet for each boundary. Indexing based on the number of flux boundaries.
 
std::vector< Point > _flux_inlet_directions
 Direction of each flux inlet. Indexing based on the number of flux boundaries.
 
std::map< BoundaryName, std::vector< MooseFunctorName > > _momentum_inlet_functors
 Functors describing the momentum inlet for each boundary.
 
std::map< BoundaryName, MooseFunctorName > _pressure_functors
 Functors describing the outlet pressure on each boundary.
 
std::map< BoundaryName, std::vector< MooseFunctorName > > _momentum_wall_functors
 Functors describing the momentum for each wall boundary.
 
bool _define_variables
 Whether to define variables if they do not exist.
 
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 actOnAdditionalTasks () override
 
virtual void addSolverVariables () override
 
virtual void addFVInterpolationMethods () override
 
void addFVGradientMethods ()
 Add the jump-aware and reconstructed gradient methods required by pressure baffles.
 
void addPressureJumpModel ()
 Add the pressure-jump model acting on the baffle sidesets.
 
virtual void addFVKernels () override
 
virtual void addUserObjects () override
 
void addPressureCorrectionKernels ()
 Function adding kernels for the incompressible pressure correction equation.
 
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.
 
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.
 
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.
 
virtual void addRhieChowUserObjects () override
 Function which adds the RhieChow interpolator user objects for weakly and incompressible formulations.
 
virtual void addFunctorMaterials () override
 
virtual MooseFunctorName getLinearFrictionCoefName () const override
 Get the name of the linear friction coefficient. Returns an empty string if no friction.
 
unsigned short getNumberAlgebraicGhostingLayersNeeded () const override
 Return the number of algebraic ghosting layers needed.
 
virtual void addRelationshipManagers (Moose::RelationshipManagerType input_rm_type) override
 
bool addRelationshipManagers (Moose::RelationshipManagerType when_type, const InputParameters &moose_object_pars)
 
virtual void addRelationshipManagers (Moose::RelationshipManagerType when_type)
 
void initializePhysics ()
 
virtual void checkIntegrityEarly () const
 
virtual void addAuxiliaryVariables ()
 
virtual void addFEKernels ()
 
virtual void addNodalKernels ()
 
virtual void addDiracKernels ()
 
virtual void addDGKernels ()
 
virtual void addScalarKernels ()
 
virtual void addInterfaceKernels ()
 
virtual void addFVInterfaceKernels ()
 
virtual void addFEBCs ()
 
virtual void addNodalBCs ()
 
virtual void addPeriodicBCs ()
 
virtual void addFunctions ()
 
virtual void addAuxiliaryKernels ()
 
virtual void addCorrectors ()
 
virtual void addMultiApps ()
 
virtual void addTransfers ()
 
virtual void addVectorPostprocessors ()
 
virtual void addReporters ()
 
virtual void addOutputs ()
 
virtual void addPreconditioning ()
 
virtual void addExecutioner ()
 
virtual void addExecutors ()
 
void checkRequiredTasks () const
 
bool addRelationshipManager (Moose::RelationshipManagerType input_rm_type, const InputParameters &moose_object_pars, std::string rm_name, Moose::RelationshipManagerType rm_type, Moose::RelationshipManagerInputParameterCallback rm_input_parameter_func, Moose::RMSystemType sys_type=Moose::RMSystemType::NONE)
 
bool suppressInfo () const
 
virtual std::string meshPropertyPrefix (const std::string &data_name) const
 
const RestartableDataValue & getMeshPropertyInternal (const std::string &data_name, const std::string &prefix) const
 
void mooseErrorInternal (Args &&... args) const
 
const T & forwardGetParam (const std::string &param_name) const
 
const InputParameters & forwardParameters () const
 
bool forwardIsParamSetByUser (const std::string &param_name) const
 
bool forwardIsParamValid (const std::string &param_name) const
 
void forwardParamError (Args &&... args) const
 
void forwardMooseError (Args &&... args) const
 
void forwardMooseWarning (Args &&... args) const
 
const std::string & forwardType () const
 
virtual const std::string & forwardName () const
 
const std::vector< SubdomainName > & forwardBlocks () const
 

Static Private Member Functions

static const hit::Node * getHitNode (const InputParameters &params)
 
static std::string messagePrefix (const InputParameters &params, const bool hit_prefix)
 

Private Attributes

const bool _non_orthogonal_correction
 Whether to use the correction term for non-orthogonality.
 
const std::vector< BoundaryName > _baffle_sidesets
 Sidesets carrying Bernoulli pressure-jump baffles (porous medium treatment only)
 
const bool _has_baffles
 Whether pressure-jump baffles are present.
 
const bool _use_reconstructed_pressure_gradient
 Whether the momentum pressure kernels use the reconstructed pressure gradient.
 
MooseEnum _is_transient
 
std::vector< VariableName > _solver_var_names
 
std::vector< VariableName > _aux_var_names
 
unsigned int _dim
 
std::set< std::string > _required_tasks
 
const ParallelParamObject & _parent
 
MooseApp & _meta_data_app
 
const MooseObject *const _meta_data_object
 
const MooseBase & _si_moose_base
 
const FEProblemBase * _si_problem
 
const PhysicsBase *const _customer_class
 

Detailed Description

Creates all the objects needed to solve the Navier-Stokes equations with the SIMPLE algorithm using the linear finite volume discretization Porous media use superficial velocity variables, the PorousRhieChowMassFlux user object and, optionally, Bernoulli pressure-jump baffles on user-selected sidesets.

Definition at line 21 of file WCNSLinearFVFlowPhysics.h.

Constructor & Destructor Documentation

◆ WCNSLinearFVFlowPhysics()

WCNSLinearFVFlowPhysics::WCNSLinearFVFlowPhysics ( const InputParameters &  parameters)

Definition at line 109 of file WCNSLinearFVFlowPhysics.C.

111 _non_orthogonal_correction(getParam<bool>("orthogonality_correction")),
112 _baffle_sidesets(getParam<std::vector<BoundaryName>>("pressure_drop_sidesets")),
115 getParam<bool>("use_reconstructed_pressure_gradient"))
116{
117 addRequiredPhysicsTask("add_interpolation_method_physics");
118 addRequiredPhysicsTask("add_gradient_method");
119
120 checkSecondParamSetOnlyIfFirstOneTrue("porous_medium_treatment",
121 "porosity_interface_pressure_treatment");
122 const bool bernoulli =
123 getParam<MooseEnum>("porosity_interface_pressure_treatment") == "bernoulli";
124 if (!bernoulli)
125 errorDependentParameter("porosity_interface_pressure_treatment",
126 "bernoulli",
127 {"pressure_drop_sidesets",
128 "pressure_drop_form_factors",
129 "pressure_drop_reference_velocity_side",
130 "pressure_jump_relaxation",
131 "use_reconstructed_pressure_gradient",
132 "pressure_gradient_relaxation"});
133 if (bernoulli && !_has_baffles)
134 paramError("pressure_drop_sidesets",
135 "The Bernoulli porosity interface treatment requires the sidesets of the pressure "
136 "baffles.");
137 if (!getParam<bool>("use_reconstructed_pressure_gradient"))
139 "use_reconstructed_pressure_gradient", "true", {"pressure_gradient_relaxation"});
141 mooseError("Not supported");
142
143 if (_hydraulic_separators.size())
144 paramError("hydraulic_separator_sidesets",
145 "Flow separators are not supported yet for linearFV!");
146 if (getParam<bool>("pin_pressure"))
147 paramError("pin_pressure",
148 "Pressure pinning is implemented in the executioner for the linear finite volume "
149 "segregated solves");
150}
void errorDependentParameter(const std::string &param1, const std::string &value_not_set, const std::vector< std::string > &dependent_params) const
void checkSecondParamSetOnlyIfFirstOneTrue(const std::string &param1, const std::string &param2) const
const InputParameters & parameters() const
void paramError(const std::string &param, Args... args) const
void mooseError(Args &&... args) const
const T & getParam(const std::string &name) const
void addRequiredPhysicsTask(const std::string &task)
Base class for Physics which create the Navier Stokes flow equations.
const bool _has_flow_equations
Boolean to keep track of whether the flow equations should be created.
const std::vector< BoundaryName > _hydraulic_separators
Hydraulic separator boundaries.
const bool _has_baffles
Whether pressure-jump baffles are present.
const bool _use_reconstructed_pressure_gradient
Whether the momentum pressure kernels use the reconstructed pressure gradient.
const bool _non_orthogonal_correction
Whether to use the correction term for non-orthogonality.
const std::vector< BoundaryName > _baffle_sidesets
Sidesets carrying Bernoulli pressure-jump baffles (porous medium treatment only)

Member Function Documentation

◆ actOnAdditionalTasks()

void WCNSLinearFVFlowPhysics::actOnAdditionalTasks ( )
overrideprivatevirtual

Reimplemented from WCNSFVFlowPhysicsBase.

Definition at line 153 of file WCNSLinearFVFlowPhysics.C.

154{
156 if (_current_task == "add_gradient_method" && !getParam<bool>("dont_create_kernels"))
158}
const std::string & _current_task
virtual void actOnAdditionalTasks() override
void addFVGradientMethods()
Add the jump-aware and reconstructed gradient methods required by pressure baffles.

◆ addAxisymmetricViscousSource()

void WCNSFVFlowPhysicsBase::addAxisymmetricViscousSource ( )
protectedinherited

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

Definition at line 570 of file WCNSFVFlowPhysicsBase.C.

571{
573 return;
574
575 const auto rz_blocks = getAxisymmetricRZBlocks();
576 if (rz_blocks.empty())
577 return;
578
579 const auto radial_index = getProblem().mesh().getAxisymmetricRadialCoord();
580 addAxisymmetricViscousSourceKernel(rz_blocks, radial_index);
581}
virtual MooseMesh & mesh() override
unsigned int getAxisymmetricRadialCoord() const
virtual FEProblemBase & getProblem()
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...
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.

Referenced by WCNSFVFlowPhysics::addFVKernels().

◆ addAxisymmetricViscousSourceEnabled()

bool WCNSFVFlowPhysicsBase::addAxisymmetricViscousSourceEnabled ( ) const
inlineinherited

Whether the cylindrical viscous source helper is enabled.

Definition at line 39 of file WCNSFVFlowPhysicsBase.h.

39{ return _add_rz_viscous_source; }

Referenced by WCNSFVTurbulencePhysics::addAxisymmetricTurbulentViscousSource().

◆ 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.

129 {
130 }

Referenced by WCNSFVFlowPhysicsBase::addAxisymmetricViscousSource().

◆ addFluidPropertiesFunctorMaterial()

void WCNSFVFlowPhysicsBase::addFluidPropertiesFunctorMaterial ( )
protectedinherited

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

Definition at line 354 of file WCNSFVFlowPhysicsBase.C.

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

Referenced by WCNSFVFlowPhysicsBase::addMaterials().

◆ addFunctorMaterials()

void WCNSLinearFVFlowPhysics::addFunctorMaterials ( )
overrideprivatevirtual

Reimplemented from PhysicsBase.

Definition at line 879 of file WCNSLinearFVFlowPhysics.C.

880{
881 if (parameters().isParamValid("gravity"))
882 {
883 const auto gravity_vector = getParam<RealVectorValue>("gravity");
884 const std::vector<std::string> comp_axis({"x", "y", "z"});
885 for (const auto d : make_range(dimension()))
886 if (gravity_vector(d) != 0)
887 {
888 // Add rho * g functor for each relevant direction
889 // TODO: we could avoid using an AD functor material for non-AD density functor
890 auto params = getFactory().getValidParams("ADParsedFunctorMaterial");
891 assignBlocks(params, _blocks);
892 params.set<std::string>("expression") =
893 _density_gravity_name + " * " + std::to_string(gravity_vector(d));
895 params.set<std::vector<std::string>>("functor_names") = {_density_gravity_name};
896 params.set<std::string>("property_name") = "rho_g_" + comp_axis[d];
897 // We don't output this helper material
899 "ADParsedFunctorMaterial", prefix() + "gravity_helper_" + comp_axis[d], params);
900 }
901 }
902}
virtual void addMaterial(const std::string &material_name, const std::string &name, InputParameters &parameters)
bool isParamValid(const std::string &name) const
unsigned int dimension() const
const MooseFunctorName _density_gravity_name
Name of the density material property used for gravity and Boussinesq terms.
if(subdm)
IntRange< T > make_range(T beg, T end)

◆ addFVAdvectedInterpolationMethod()

void NavierStokesPhysicsBase::addFVAdvectedInterpolationMethod ( const MooseEnum &  interpolation_method)
protectedinherited

Add the FVInterpolationMethod object for an advected interpolation method if absent.

Definition at line 43 of file NavierStokesPhysicsBase.C.

44{
45 const std::string method_name = interpolation_method;
46 if (getProblem().hasFVInterpolationMethod(method_name))
47 return;
48
49 const auto method_type = NS::fvAdvectedInterpolationMethodType(interpolation_method);
50
51 InputParameters params = getFactory().getValidParams(method_type);
52 getProblem().addFVInterpolationMethod(method_type, method_name, params);
53}
virtual void addFVInterpolationMethod(const std::string &method_type, const std::string &name, InputParameters &parameters)
std::string fvAdvectedInterpolationMethodType(const MooseEnum &interpolation_method)
Gets the FVInterpolationMethod object type for an advected interpolation method.
Definition NSFVUtils.C:67

Referenced by addFVInterpolationMethods(), WCNSLinearFVScalarTransportPhysics::addFVInterpolationMethods(), and WCNSLinearFVTurbulencePhysics::addFVInterpolationMethods().

◆ addFVBCs()

void WCNSFVFlowPhysicsBase::addFVBCs ( )
overrideprotectedvirtualinherited

Reimplemented from PhysicsBase.

Definition at line 297 of file WCNSFVFlowPhysicsBase.C.

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

◆ addFVGradientMethods()

void WCNSLinearFVFlowPhysics::addFVGradientMethods ( )
private

Add the jump-aware and reconstructed gradient methods required by pressure baffles.

Definition at line 161 of file WCNSLinearFVFlowPhysics.C.

162{
164 return;
165
166 // The pressure and velocity gradients exclude the jumps across the baffles. Their names are
167 // assigned to the variables in addSolverVariables.
168 {
169 InputParameters params = getFactory().getValidParams("FVPressureJumpGreenGaussGradient");
171 "FVPressureJumpGreenGaussGradient", prefix() + "pressure_jump_gradient", params);
172 }
173 {
174 InputParameters params = getFactory().getValidParams("FVVelocityJumpGreenGaussGradient");
176 "FVVelocityJumpGreenGaussGradient", prefix() + "velocity_jump_gradient", params);
177 }
179 {
180 InputParameters params = getFactory().getValidParams("FVReconstructedPressureGradient");
181 params.set<GradientMethodName>("base_gradient_method") = prefix() + "pressure_jump_gradient";
182 params.set<Real>("gradient_relaxation") = getParam<Real>("pressure_gradient_relaxation");
184 "FVReconstructedPressureGradient", prefix() + "reconstructed_pressure_gradient", params);
185 }
186}
virtual void addFVGradientMethod(const std::string &method_type, const std::string &name, InputParameters &parameters)

Referenced by actOnAdditionalTasks().

◆ addFVInterpolationMethods()

void WCNSLinearFVFlowPhysics::addFVInterpolationMethods ( )
overrideprivatevirtual

Reimplemented from PhysicsBase.

Definition at line 189 of file WCNSLinearFVFlowPhysics.C.

190{
191 if (!_has_flow_equations || isParamValid("momentum_advection_interpolation_method_name"))
192 return;
193
194 addFVAdvectedInterpolationMethod(getParam<MooseEnum>("momentum_advection_interpolation"));
195}
void addFVAdvectedInterpolationMethod(const MooseEnum &interpolation_method)
Add the FVInterpolationMethod object for an advected interpolation method if absent.

◆ addFVKernels()

void WCNSLinearFVFlowPhysics::addFVKernels ( )
overrideprivatevirtual

Implements WCNSFVFlowPhysicsBase.

Definition at line 278 of file WCNSLinearFVFlowPhysics.C.

279{
281 return;
282
283 // Pressure correction equation: divergence of momentum
285
286 // Momentum equation: time derivative
287 if (isTransient())
289
290 // Momentum equation: flux terms
292
293 // Momentum equation: pressure term
295
296 // Momentum equation: friction term
297 if (_friction_types.size())
299
300 // Momentum equation: gravity source term
302
303 // Momentum equation: boussinesq approximation
304 if (getParam<bool>("boussinesq_approximation"))
306}
bool isTransient() const
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 ...
virtual void addMomentumBoussinesqKernels() override
virtual void addMomentumFrictionKernels() override
virtual void addMomentumGravityKernels() override
void addPressureCorrectionKernels()
Function adding kernels for the incompressible pressure correction equation.

◆ addInitialConditions()

void WCNSFVFlowPhysicsBase::addInitialConditions ( )
overrideprotectedvirtualinherited

Reimplemented from PhysicsBase.

Definition at line 399 of file WCNSFVFlowPhysicsBase.C.

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

◆ 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 543 of file WCNSLinearFVFlowPhysics.C.

544{
545 // Check the size of the BC parameters
546 unsigned int num_velocity_functor_inlets = 0;
547 for (const auto & [bdy, momentum_inlet_type] : _momentum_inlet_types)
548 if (momentum_inlet_type == "fixed-velocity" || momentum_inlet_type == "fixed-pressure")
549 num_velocity_functor_inlets++;
550
551 if (num_velocity_functor_inlets != _momentum_inlet_functors.size())
552 paramError("momentum_inlet_functors",
553 "Size (" + std::to_string(_momentum_inlet_functors.size()) +
554 ") is not the same as the number of entries in the momentum_inlet_types "
555 "subvector for fixed-velocities/pressures functors (size " +
556 std::to_string(num_velocity_functor_inlets) + ")");
557
558 unsigned int velocity_pressure_counter = 0;
559 for (const auto & [inlet_bdy, momentum_inlet_type] : _momentum_inlet_types)
560 {
561 if (momentum_inlet_type == "fixed-velocity")
562 {
563 const std::string bc_type = "LinearFVAdvectionDiffusionFunctorDirichletBC";
564 InputParameters params = getFactory().getValidParams(bc_type);
565 params.set<std::vector<BoundaryName>>("boundary") = {inlet_bdy};
566 if (_momentum_inlet_functors.size() < velocity_pressure_counter + 1)
567 paramError("momentum_inlet_functors",
568 "More non-flux inlets than inlet functors (" +
569 std::to_string(_momentum_inlet_functors.size()) + ")");
570
571 // Check that enough functors have been provided for the dimension of the problem
572 const auto momentum_functors = libmesh_map_find(_momentum_inlet_functors, inlet_bdy);
573 if (momentum_functors.size() < dimension())
574 paramError("momentum_inlet_functors",
575 "Subvector for boundary '" + inlet_bdy + "' (size " +
576 std::to_string(momentum_functors.size()) +
577 ") is not the same size as the number of dimensions of the physics (" +
578 std::to_string(dimension()) + ")");
579
580 for (const auto d : make_range(dimension()))
581 {
582 params.set<LinearVariableName>("variable") = _velocity_names[d];
583 params.set<MooseFunctorName>("functor") = momentum_functors[d];
584
585 getProblem().addLinearFVBC(bc_type, _velocity_names[d] + "_" + inlet_bdy, params);
586 }
587 ++velocity_pressure_counter;
588
589 // Add the two term BC expansion for pressure if requested
590 if (getParam<bool>("pressure_two_term_bc_expansion"))
591 {
592 const std::string bc_type = "LinearFVExtrapolatedPressureBC";
593 InputParameters params = getFactory().getValidParams(bc_type);
594 params.set<std::vector<BoundaryName>>("boundary") = {inlet_bdy};
595 params.set<LinearVariableName>("variable") = _pressure_name;
596 params.set<bool>("use_two_term_expansion") = true;
597 getProblem().addLinearFVBC(bc_type,
598 _pressure_name + "_extrapolation_inlet_" +
599 Moose::stringify(inlet_bdy),
600 params);
601 }
602 }
603 else if (momentum_inlet_type == "fixed-pressure")
604 {
605 const std::string bc_type = "LinearFVAdvectionDiffusionFunctorDirichletBC";
606 InputParameters params = getFactory().getValidParams(bc_type);
607 params.set<LinearVariableName>("variable") = _pressure_name;
608 if (_momentum_inlet_functors.size() < velocity_pressure_counter + 1)
609 paramError("momentum_inlet_functors",
610 "More non-flux inlets than inlet functors (" +
611 std::to_string(_momentum_inlet_functors.size()) + ")");
612
613 params.set<MooseFunctorName>("functor") =
614 libmesh_map_find(_momentum_inlet_functors, inlet_bdy)[0];
615 params.set<std::vector<BoundaryName>>("boundary") = {inlet_bdy};
616
617 getProblem().addLinearFVBC(bc_type, _pressure_name + "_" + inlet_bdy, params);
618 ++velocity_pressure_counter;
619 }
620 else
621 mooseError("Unsupported inlet boundary condition type: ", momentum_inlet_type);
622 }
623}
virtual void addLinearFVBC(const std::string &fv_bc_name, const std::string &name, InputParameters &parameters)
std::map< BoundaryName, MooseEnum > _momentum_inlet_types
Momentum inlet boundary types.
std::map< BoundaryName, std::vector< MooseFunctorName > > _momentum_inlet_functors
Functors describing the momentum inlet for each boundary.
std::string stringify(const T &t)

◆ addMaterials()

void WCNSFVFlowPhysicsBase::addMaterials ( )
overrideprotectedvirtualinherited

Reimplemented from PhysicsBase.

Definition at line 306 of file WCNSFVFlowPhysicsBase.C.

307{
310 else
312
315}
void addNonPorousMediumSpeedMaterial()
Add material to define the local speed with no porous medium treatment.
virtual bool hasForchheimerFriction() const =0
Return whether a Forchheimer friction model is in use.
void addFluidPropertiesFunctorMaterial()
Function which adds the general functor fluid properties functor material to define fluid functor mat...
void addPorousMediumSpeedMaterial()
Add material to define the local speed in porous medium flows.

◆ addMomentumBoussinesqKernels()

void WCNSLinearFVFlowPhysics::addMomentumBoussinesqKernels ( )
overrideprivatevirtual

Implements WCNSFVFlowPhysicsBase.

Definition at line 514 of file WCNSLinearFVFlowPhysics.C.

515{
516 if (_compressibility == "weakly-compressible")
517 paramError("boussinesq_approximation",
518 "We cannot use boussinesq approximation while running in weakly-compressible mode!");
519
520 std::string kernel_type = "LinearFVMomentumBoussinesq";
521 std::string kernel_name = prefix() + "ins_momentum_boussinesq_";
522
523 InputParameters params = getFactory().getValidParams(kernel_type);
524 assignBlocks(params, _blocks);
525 params.set<VariableName>(NS::T_fluid) = _fluid_temperature_name;
526 params.set<MooseFunctorName>(NS::density) = _density_gravity_name;
527 params.set<RealVectorValue>("gravity") = getParam<RealVectorValue>("gravity");
528 params.set<Real>("ref_temperature") = getParam<Real>("ref_temperature");
529 params.set<MooseFunctorName>("alpha_name") = getParam<MooseFunctorName>("thermal_expansion");
531 params.set<MooseFunctorName>(NS::porosity) = _flow_porosity_functor_name;
532
533 for (const auto d : make_range(dimension()))
534 {
535 params.set<MooseEnum>("momentum_component") = NS::directions[d];
536 params.set<LinearVariableName>("variable") = _velocity_names[d];
537
538 getProblem().addLinearFVKernel(kernel_type, kernel_name + NS::directions[d], params);
539 }
540}
virtual void addLinearFVKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
const MooseEnum _compressibility
Compressibility type, can be compressible, incompressible or weakly-compressible.
MooseFunctorName _flow_porosity_functor_name
Name of the porosity functor for the flow equations (if smoothed)
static const std::string directions[3]
Definition NS.h:23
VectorValue< Real > RealVectorValue

Referenced by addFVKernels().

◆ addMomentumFluxKernels()

void WCNSLinearFVFlowPhysics::addMomentumFluxKernels ( )
private

Definition at line 361 of file WCNSLinearFVFlowPhysics.C.

362{
363 const auto momentum_advection_method_name =
364 isParamValid("momentum_advection_interpolation_method_name")
365 ? getParam<InterpolationMethodName>("momentum_advection_interpolation_method_name")
366 : InterpolationMethodName(
367 std::string(getParam<MooseEnum>("momentum_advection_interpolation")));
368
369 const std::string u_names[3] = {"u", "v", "w"};
370 std::string kernel_type =
371 _porous_medium_treatment ? "LinearPWCNSFVMomentumFlux" : "LinearWCNSFVMomentumFlux";
372 std::string kernel_name =
373 prefix() + (_porous_medium_treatment ? "pins" : "ins") + "_momentum_flux_";
374
375 InputParameters params = getFactory().getValidParams(kernel_type);
376 assignBlocks(params, _blocks);
378 params.set<MooseFunctorName>(NS::mu) = _dynamic_viscosity_name;
379 else
380 params.set<MooseFunctorName>(NS::mu) = NS::mu_eff;
381
382 params.set<UserObjectName>("rhie_chow_user_object") = rhieChowUOName();
383 params.set<InterpolationMethodName>("advected_interp_method_name") =
384 momentum_advection_method_name;
385 params.set<bool>("use_nonorthogonal_correction") = _non_orthogonal_correction;
386 params.set<bool>("use_deviatoric_terms") = includeSymmetrizedViscousStress();
387
388 for (unsigned int i = 0; i < dimension(); ++i)
389 params.set<SolverVariableName>(u_names[i]) = _velocity_names[i];
390
391 for (const auto d : make_range(dimension()))
392 {
393 params.set<LinearVariableName>("variable") = _velocity_names[d];
394 params.set<MooseEnum>("momentum_component") = NS::directions[d];
395
396 getProblem().addLinearFVKernel(kernel_type, kernel_name + NS::directions[d], params);
397 }
398}
const UserObjectName & rhieChowUOName() const
Return the name of the Rhie Chow user object.
const MooseFunctorName _dynamic_viscosity_name
Name of the dynamic viscosity material property.
const WCNSFVTurbulencePhysicsBase * _turbulence_physics
Can be set to a coupled turbulence physics.
bool includeSymmetrizedViscousStress() const
Whether to include the symmetrized contribution in the viscous stress.
static const std::string mu
Definition NS.h:127
static const std::string mu_eff
Definition NS.h:133

Referenced by addFVKernels().

◆ addMomentumFrictionKernels()

void WCNSLinearFVFlowPhysics::addMomentumFrictionKernels ( )
overrideprivatevirtual

Implements WCNSFVFlowPhysicsBase.

Definition at line 426 of file WCNSLinearFVFlowPhysics.C.

427{
428 unsigned int num_friction_blocks = _friction_blocks.size();
429 unsigned int num_used_blocks = num_friction_blocks ? num_friction_blocks : 1;
430
431 const std::string kernel_type = "LinearFVMomentumFriction";
432 const std::string u_names[3] = {"u", "v", "w"};
433
434 for (const auto block_i : make_range(num_used_blocks))
435 {
436 // Fresh parameters so that a friction type of one block does not carry over to the next
437 InputParameters params = getFactory().getValidParams(kernel_type);
439 params.set<MooseFunctorName>(NS::porosity) = _flow_porosity_functor_name;
440 std::string block_name = "";
441 if (num_friction_blocks)
442 {
443 params.set<std::vector<SubdomainName>>("block") = _friction_blocks[block_i];
444 block_name = Moose::stringify(_friction_blocks[block_i]);
445 }
446 else
447 {
448 assignBlocks(params, _blocks);
449 block_name = std::to_string(block_i);
450 }
451
452 for (const auto d : make_range(dimension()))
453 {
454 params.set<LinearVariableName>("variable") = _velocity_names[d];
455 params.set<MooseEnum>("momentum_component") = NS::directions[d];
456 for (unsigned int type_i = 0; type_i < _friction_types[block_i].size(); ++type_i)
457 {
458 const auto upper_name = MooseUtils::toUpper(_friction_types[block_i][type_i]);
459 if (upper_name == "DARCY")
460 {
461 params.set<MooseFunctorName>(NS::mu) = _dynamic_viscosity_name;
462 params.set<MooseFunctorName>("Darcy_name") = _friction_coeffs[block_i][type_i];
463 }
464 else if (upper_name == "FORCHHEIMER")
465 {
466 params.set<MooseFunctorName>(NS::density) = _density_name;
467 params.set<MooseFunctorName>("Forchheimer_name") = _friction_coeffs[block_i][type_i];
468 for (const auto j : make_range(dimension()))
469 params.set<MooseFunctorName>(u_names[j]) = _velocity_names[j];
470 }
471 else
472 paramError("friction_types",
473 "Friction type '",
474 _friction_types[block_i][type_i],
475 "' is not implemented");
476 }
477
478 getProblem().addLinearFVKernel(kernel_type,
479 prefix() + "momentum_friction_" + block_name + "_" +
481 params);
482 }
483 }
484}
std::vector< std::vector< SubdomainName > > _friction_blocks
Subdomains where we want to have volumetric friction.
std::vector< std::vector< std::string > > _friction_coeffs
The coefficients used for each item if friction type.
std::string toUpper(std::string name)

Referenced by addFVKernels().

◆ addMomentumGravityKernels()

void WCNSLinearFVFlowPhysics::addMomentumGravityKernels ( )
overrideprivatevirtual

Implements WCNSFVFlowPhysicsBase.

Definition at line 487 of file WCNSLinearFVFlowPhysics.C.

488{
490 {
491 std::string kernel_type = "LinearFVSource";
492 std::string kernel_name = prefix() + "ins_momentum_gravity_";
493
494 InputParameters params = getFactory().getValidParams(kernel_type);
495 assignBlocks(params, _blocks);
496 const auto gravity_vector = getParam<RealVectorValue>("gravity");
497 const std::vector<std::string> comp_axis({"x", "y", "z"});
498
499 for (const auto d : make_range(dimension()))
500 if (gravity_vector(d) != 0)
501 {
502 params.set<MooseFunctorName>("source_density") = "rho_g_" + comp_axis[d];
503 // The momentum equation of superficial velocity carries eps rho g
505 params.set<MooseFunctorName>("scaling_factor") = _flow_porosity_functor_name;
506 params.set<LinearVariableName>("variable") = _velocity_names[d];
507
508 getProblem().addLinearFVKernel(kernel_type, kernel_name + NS::directions[d], params);
509 }
510 }
511}

Referenced by addFVKernels().

◆ addMomentumPressureKernels()

void WCNSLinearFVFlowPhysics::addMomentumPressureKernels ( )
overrideprivatevirtual

Implements WCNSFVFlowPhysicsBase.

Definition at line 401 of file WCNSLinearFVFlowPhysics.C.

402{
403 std::string kernel_type =
404 _porous_medium_treatment ? "LinearPWCNSFVMomentumPressure" : "LinearFVMomentumPressure";
405 std::string kernel_name =
406 prefix() + (_porous_medium_treatment ? "pins" : "ins") + "_momentum_pressure_";
407
408 InputParameters params = getFactory().getValidParams(kernel_type);
409 assignBlocks(params, _blocks);
410 params.set<VariableName>("pressure") = _pressure_name;
412 params.set<MooseFunctorName>(NS::porosity) = _flow_porosity_functor_name;
414 params.set<GradientMethodName>("gradient_method") =
415 prefix() + "reconstructed_pressure_gradient";
416
417 for (const auto d : make_range(dimension()))
418 {
419 params.set<MooseEnum>("momentum_component") = NS::directions[d];
420 params.set<LinearVariableName>("variable") = _velocity_names[d];
421 getProblem().addLinearFVKernel(kernel_type, kernel_name + NS::directions[d], params);
422 }
423}

Referenced by addFVKernels().

◆ 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 343 of file WCNSLinearFVFlowPhysics.C.

344{
345 std::string kernel_type = "LinearFVTimeDerivative";
346 std::string kernel_name = prefix() + "ins_momentum_time";
347
348 InputParameters params = getFactory().getValidParams(kernel_type);
349 assignBlocks(params, _blocks);
350 params.set<MooseFunctorName>("factor") = _density_name;
351
352 for (const auto d : make_range(dimension()))
353 {
354 params.set<LinearVariableName>("variable") = _velocity_names[d];
355 if (shouldCreateTimeDerivative(_velocity_names[d], _blocks, /*error if already defined*/ false))
356 getProblem().addLinearFVKernel(kernel_type, kernel_name + "_" + NS::directions[d], params);
357 }
358}
bool shouldCreateTimeDerivative(const VariableName &var_name, const std::vector< SubdomainName > &blocks, const bool error_if_already_defined) const

Referenced by addFVKernels().

◆ 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.

337{
338 // Not very future-proof but it works
339 const bool use_ad = !dynamic_cast<WCNSLinearFVFlowPhysics *>(this);
340 const std::string class_name =
341 use_ad ? "ADVectorMagnitudeFunctorMaterial" : "VectorMagnitudeFunctorMaterial";
342 InputParameters params = getFactory().getValidParams(class_name);
343 assignBlocks(params, _blocks);
344
345 const std::vector<std::string> param_names{"x_functor", "y_functor", "z_functor"};
346 for (unsigned int dim_i = 0; dim_i < dimension(); ++dim_i)
347 params.set<MooseFunctorName>(param_names[dim_i]) = _velocity_names[dim_i];
348 params.set<MooseFunctorName>("vector_magnitude_name") = NS::speed;
349
350 getProblem().addFunctorMaterial(class_name, prefix() + "ins_speed_material", params);
351}

Referenced by WCNSFVFlowPhysicsBase::addMaterials().

◆ addOutletBC()

void WCNSLinearFVFlowPhysics::addOutletBC ( )
overrideprivatevirtual

Implements WCNSFVFlowPhysicsBase.

Definition at line 626 of file WCNSLinearFVFlowPhysics.C.

627{
628 // Check the BCs size
629 unsigned int num_pressure_outlets = 0;
630 for (const auto & [bdy, momentum_outlet_type] : _momentum_outlet_types)
631 if (momentum_outlet_type == "fixed-pressure" ||
632 momentum_outlet_type == "fixed-pressure-zero-gradient")
633 num_pressure_outlets++;
634
635 if (num_pressure_outlets != _pressure_functors.size())
636 paramError("pressure_functors",
637 "Size (" + std::to_string(_pressure_functors.size()) +
638 ") is not the same as the number of pressure outlet boundaries in "
639 "'fixed-pressure/fixed-pressure-zero-gradient' (size " +
640 std::to_string(num_pressure_outlets) + ")");
641
642 const std::string u_names[3] = {"u", "v", "w"};
643 for (const auto & [outlet_bdy, momentum_outlet_type] : _momentum_outlet_types)
644 {
645 // Zero tangeantial gradient condition on velocity
646 if (momentum_outlet_type == "zero-gradient" || momentum_outlet_type == "fixed-pressure" ||
647 momentum_outlet_type == "fixed-pressure-zero-gradient")
648 {
649 const std::string bc_type = "LinearFVAdvectionDiffusionOutflowBC";
650 InputParameters params = getFactory().getValidParams(bc_type);
651 params.set<std::vector<BoundaryName>>("boundary") = {outlet_bdy};
652 params.set<bool>("use_two_term_expansion") = getParam<bool>("momentum_two_term_bc_expansion");
653
654 for (const auto d : make_range(dimension()))
655 {
656 params.set<LinearVariableName>("variable") = _velocity_names[d];
657 getProblem().addLinearFVBC(bc_type, _velocity_names[d] + "_" + outlet_bdy, params);
658 }
659 }
660
661 // Fixed pressure condition, coming in the pressure correction equation
662 if (momentum_outlet_type == "fixed-pressure" ||
663 momentum_outlet_type == "fixed-pressure-zero-gradient")
664 {
665 const std::string bc_type = "LinearFVAdvectionDiffusionFunctorDirichletBC";
666 InputParameters params = getFactory().getValidParams(bc_type);
667 params.set<LinearVariableName>("variable") = _pressure_name;
668 params.set<MooseFunctorName>("functor") = libmesh_map_find(_pressure_functors, outlet_bdy);
669 params.set<std::vector<BoundaryName>>("boundary") = {outlet_bdy};
670
671 getProblem().addLinearFVBC(bc_type, _pressure_name + "_" + outlet_bdy, params);
672 }
673 }
674}
std::map< BoundaryName, MooseEnum > _momentum_outlet_types
Momentum outlet boundary types.
std::map< BoundaryName, MooseFunctorName > _pressure_functors
Functors describing the outlet pressure on each boundary.

◆ addPorosityScaledFunctor()

MooseFunctorName NavierStokesPhysicsBase::addPorosityScaledFunctor ( const MooseFunctorName &  porosity,
const MooseFunctorName &  functor 
)
protectedinherited

Add, if absent, a non-AD functor material defining the product of a porosity and another functor on the blocks of this Physics.

Parameters
porositythe porosity functor or number
functorthe functor or number multiplied by the porosity
Returns
the name of the product functor

Definition at line 56 of file NavierStokesPhysicsBase.C.

58{
59 const MooseFunctorName product_name = prefix() + porosity + "_times_" + functor;
60 if (getProblem().hasFunctor(product_name, /*thread_id=*/0))
61 return product_name;
62
63 // Numbers go directly in the expression. Functors get symbols because their names, such as
64 // the turbulent diffusivity 'mu_t/Sc_t', need not be valid parser identifiers.
65 std::vector<std::string> functor_names;
66 std::vector<std::string> functor_symbols;
67 std::vector<std::string> factors;
68 for (const auto & name : {porosity, functor})
70 factors.push_back(name);
71 else
72 {
73 functor_names.push_back(name);
74 functor_symbols.push_back("f" + std::to_string(functor_symbols.size()));
75 factors.push_back(functor_symbols.back());
76 }
77
78 const std::string object_type = "ParsedFunctorMaterial";
79 InputParameters params = getFactory().getValidParams(object_type);
80 assignBlocks(params, _blocks);
81 params.set<std::string>("expression") = factors[0] + " * " + factors[1];
82 params.set<std::vector<std::string>>("functor_names") = functor_names;
83 params.set<std::vector<std::string>>("functor_symbols") = functor_symbols;
84 params.set<std::string>("property_name") = product_name;
85 getProblem().addMaterial(object_type, product_name + "_material", params);
86
87 return product_name;
88}
const std::string & name() const

Referenced by WCNSLinearFVFluidHeatTransferPhysics::addEnergyHeatConductionKernels(), WCNSLinearFVFluidHeatTransferPhysics::addEnergyTimeKernels(), and WCNSLinearFVScalarTransportPhysics::fluidFractionScaled().

◆ addPorousMediumSpeedMaterial()

void WCNSFVFlowPhysicsBase::addPorousMediumSpeedMaterial ( )
protectedinherited

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

Definition at line 318 of file WCNSFVFlowPhysicsBase.C.

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}
static const std::string superficial_velocity_vector[3]
Definition NS.h:55

Referenced by WCNSFVFlowPhysicsBase::addMaterials().

◆ addPostprocessors()

void WCNSFVFlowPhysicsBase::addPostprocessors ( )
overrideprotectedvirtualinherited

Reimplemented from PhysicsBase.

Definition at line 460 of file WCNSFVFlowPhysicsBase.C.

461{
462 const auto momentum_inlet_types = getParam<MultiMooseEnum>("momentum_inlet_types");
463
464 for (unsigned int bc_ind = 0; bc_ind < momentum_inlet_types.size(); ++bc_ind)
465 if (momentum_inlet_types[bc_ind] == "flux-mass" ||
466 momentum_inlet_types[bc_ind] == "flux-velocity")
467 {
468 const std::string pp_type = "AreaPostprocessor";
469 InputParameters params = getFactory().getValidParams(pp_type);
470 params.set<std::vector<BoundaryName>>("boundary") = {_inlet_boundaries[bc_ind]};
471 params.set<ExecFlagEnum>("execute_on") = EXEC_INITIAL;
472
473 const auto name_pp = "area_pp_" + _inlet_boundaries[bc_ind];
474 if (!getProblem().hasUserObject(name_pp))
475 getProblem().addPostprocessor(pp_type, name_pp, params);
476 }
477}
virtual void addPostprocessor(const std::string &pp_name, const std::string &name, InputParameters &parameters)
bool hasUserObject(const std::string &name) const
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 309 of file WCNSLinearFVFlowPhysics.C.

310{
311 {
312 // The baffle faces need the jump contribution to the pressure correction
313 std::string kernel_type = _has_baffles ? "LinearFVPressureCorrectionDiffusionJump"
314 : "LinearFVPressureCorrectionDiffusion";
315 std::string kernel_name = prefix() + "p_diffusion";
316
317 InputParameters params = getFactory().getValidParams(kernel_type);
318 assignBlocks(params, _blocks);
319 params.set<LinearVariableName>("variable") = _pressure_name;
320 if (_has_baffles)
321 params.set<UserObjectName>("rhie_chow_user_object") = rhieChowUOName();
322 else
323 params.set<MooseFunctorName>("diffusion_tensor") = "Ainv";
324 params.set<bool>("use_nonorthogonal_correction") = _non_orthogonal_correction;
325
326 getProblem().addLinearFVKernel(kernel_type, kernel_name, params);
327 }
328 {
329 std::string kernel_type = "LinearFVDivergence";
330 std::string kernel_name = prefix() + "HbyA_divergence";
331
332 InputParameters params = getFactory().getValidParams(kernel_type);
333 assignBlocks(params, _blocks);
334 params.set<LinearVariableName>("variable") = _pressure_name;
335 params.set<MooseFunctorName>("face_flux") = "HbyA";
336 params.set<bool>("force_boundary_execution") = true;
337
338 getProblem().addLinearFVKernel(kernel_type, kernel_name, params);
339 }
340}

Referenced by addFVKernels().

◆ addPressureJumpModel()

void WCNSLinearFVFlowPhysics::addPressureJumpModel ( )
private

Add the pressure-jump model acting on the baffle sidesets.

Definition at line 790 of file WCNSLinearFVFlowPhysics.C.

791{
792 const std::string object_type = "BernoulliFormLossPressureJump";
793 auto params = getFactory().getValidParams(object_type);
794 params.set<std::vector<BoundaryName>>("boundary") = _baffle_sidesets;
795 params.set<MooseFunctorName>("porosity") = _flow_porosity_functor_name;
796 params.set<MooseFunctorName>("density") = _density_name;
797 params.set<std::vector<Real>>("form_loss") =
798 getParam<std::vector<Real>>("pressure_drop_form_factors");
799 // Only forward the reference sides when given so the model applies its default otherwise
800 if (isParamSetByUser("pressure_drop_reference_velocity_side"))
801 params.set<MultiMooseEnum>("reference_velocity_side") =
802 getParam<MultiMooseEnum>("pressure_drop_reference_velocity_side");
803
804 addUserObject(object_type, prefix() + "pressure_jump", params);
805}
void addUserObject(const std::string &uo_type, const std::string &uo_name, InputParameters &params)

Referenced by addUserObjects().

◆ addRhieChowUserObjects()

void WCNSLinearFVFlowPhysics::addRhieChowUserObjects ( )
overrideprivatevirtual

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

Implements WCNSFVFlowPhysicsBase.

Definition at line 808 of file WCNSLinearFVFlowPhysics.C.

809{
810 mooseAssert(dimension(), "0-dimension not supported");
811
812 // First make sure that we only add this object once
813 // Potential cases:
814 // - there is a flow physics, and an advection one (UO should be added by one)
815 // - there is only an advection physics (UO should be created)
816 // - there are two advection physics on different blocks with set velocities (first one picks)
817 // Counting RC UOs defined on the same blocks seems to be the most fool proof option
818 std::vector<UserObject *> objs;
819 getProblem()
820 .theWarehouse()
821 .query()
822 .condition<AttribSystem>("UserObject")
823 .condition<AttribThread>(0)
824 .queryInto(objs);
825 unsigned int num_rc_uo = 0;
826 for (const auto & obj : objs)
827 if (dynamic_cast<RhieChowMassFlux *>(obj))
828 {
829 const auto rc_obj = dynamic_cast<RhieChowMassFlux *>(obj);
830 if (rc_obj->blocks() == _blocks)
831 num_rc_uo++;
832 // one of the RC user object is defined everywhere
833 else if (rc_obj->blocks().size() == 0 || _blocks.size() == 0)
834 num_rc_uo++;
835 }
836
837 if (num_rc_uo)
838 return;
839
840 const std::string u_names[3] = {"u", "v", "w"};
841 const auto object_type = _porous_medium_treatment ? "PorousRhieChowMassFlux" : "RhieChowMassFlux";
842
843 auto params = getFactory().getValidParams(object_type);
845 {
846 params.set<MooseFunctorName>(NS::porosity) = _flow_porosity_functor_name;
847 if (_has_baffles)
848 {
849 params.set<std::vector<UserObjectName>>("pressure_jump_models") = {prefix() +
850 "pressure_jump"};
851 params.set<Real>("pressure_jump_relaxation") = getParam<Real>("pressure_jump_relaxation");
852 }
853 }
854 assignBlocks(params, _blocks);
855 for (unsigned int d = 0; d < dimension(); ++d)
856 params.set<VariableName>(u_names[d]) = _velocity_names[d];
857
858 params.set<VariableName>("pressure") = _pressure_name;
859 params.set<std::string>("p_diffusion_kernel") = prefix() + "p_diffusion";
860 params.set<MooseFunctorName>(NS::density) = _density_name;
861 params.set<MooseEnum>("pressure_projection_method") =
862 getParam<MooseEnum>("pressure_projection_method");
863 params.set<MooseEnum>("pressure_diffusion_interpolation") =
864 getParam<MooseEnum>("pressure_diffusion_interpolation");
865
866 addUserObject(object_type, rhieChowUOName(), params);
867}
TheWarehouse & theWarehouse() const
User object responsible for determining the face fluxes using the Rhie-Chow interpolation in a segreg...
Query query()

Referenced by addUserObjects().

◆ addSeparatorBC()

virtual void WCNSLinearFVFlowPhysics::addSeparatorBC ( )
inlineoverrideprivatevirtual

Implements WCNSFVFlowPhysicsBase.

Definition at line 62 of file WCNSLinearFVFlowPhysics.h.

62{}

◆ addSolverVariables()

void WCNSLinearFVFlowPhysics::addSolverVariables ( )
overrideprivatevirtual

Implements WCNSFVFlowPhysicsBase.

Definition at line 218 of file WCNSLinearFVFlowPhysics.C.

219{
221 return;
222
223 for (const auto d : make_range(dimension()))
226
227 const std::vector<std::string> v_short = {"u", "v", "w"};
228
229 // Check number of variables
230 if (_velocity_names.size() != dimension() && _velocity_names.size() != 3)
231 paramError("velocity_variable",
232 "The number of velocity variable names supplied to the NSFVAction is not " +
233 Moose::stringify(dimension()) + " (mesh dimension)" +
234 ((dimension() == 3) ? "" : " or 3!") + "\nVelocity variables " +
236
237 // Velocities
238 for (const auto d : make_range(dimension()))
239 {
240 if (!shouldCreateVariable(_velocity_names[d], _blocks, /*error if aux*/ true))
241 reportPotentiallyMissedParameters({"system_names"}, "MooseLinearVariableFVReal");
242 else if (_define_variables)
243 {
244 std::string variable_type = "MooseLinearVariableFVReal";
245
246 auto params = getFactory().getValidParams(variable_type);
247 if (_has_baffles)
248 params.set<GradientMethodName>("gradient_method") = prefix() + "velocity_jump_gradient";
249
250 addSharedSolverVariable(variable_type, _velocity_names[d], params);
251 }
252 else
253 paramError("velocity_variable",
254 "Variable (" + _velocity_names[d] +
255 ") supplied to the WCNSLinearFVFlowPhysics does not exist!");
256 }
257
258 // Pressure
259 if (!shouldCreateVariable(_pressure_name, _blocks, /*error if aux*/ true))
260 reportPotentiallyMissedParameters({"system_names"}, "MooseLinearVariableFVReal");
261 else if (_define_variables)
262 {
263 const auto pressure_type = "MooseLinearVariableFVReal";
264
265 auto params = getFactory().getValidParams(pressure_type);
266 if (_has_baffles)
267 params.set<GradientMethodName>("gradient_method") = prefix() + "pressure_jump_gradient";
268
269 addSharedSolverVariable(pressure_type, _pressure_name, params);
270 }
271 else
272 paramError("pressure_variable",
273 "Variable (" + _pressure_name +
274 ") supplied to the WCNSLinearFVFlowPhysics does not exist!");
275}
void reportPotentiallyMissedParameters(const std::vector< std::string > &param_names, const std::string &object_type, const std::string &object_name="") const
void saveSolverVariableName(const VariableName &var_name)
void addSharedSolverVariable(const std::string &var_type, const VariableName &var_name, InputParameters params)
bool shouldCreateVariable(const VariableName &var_name, const std::vector< SubdomainName > &blocks, const bool error_if_aux)

◆ addUserObjects()

void WCNSLinearFVFlowPhysics::addUserObjects ( )
overrideprivatevirtual

Implements WCNSFVFlowPhysicsBase.

Definition at line 780 of file WCNSLinearFVFlowPhysics.C.

781{
782 // The Rhie-Chow object looks up the pressure-jump model at construction
783 if (_has_baffles)
785 // Rhie Chow user object for interpolation velocities
787}
virtual void addRhieChowUserObjects() override
Function which adds the RhieChow interpolator user objects for weakly and incompressible formulations...
void addPressureJumpModel()
Add the pressure-jump model acting on the baffle sidesets.

◆ addWallsBC()

void WCNSLinearFVFlowPhysics::addWallsBC ( )
overrideprivatevirtual

Implements WCNSFVFlowPhysicsBase.

Definition at line 677 of file WCNSLinearFVFlowPhysics.C.

678{
679 const std::string u_names[3] = {"u", "v", "w"};
680 bool has_symmetry_bc = false;
681
682 for (const auto & [boundary_name, momentum_wall_type] : _momentum_wall_types)
683 {
684 if (momentum_wall_type == "noslip")
685 {
686 const std::string bc_type = "LinearFVAdvectionDiffusionFunctorDirichletBC";
687 InputParameters params = getFactory().getValidParams(bc_type);
688 params.set<std::vector<BoundaryName>>("boundary") = {boundary_name};
689
690 for (const auto d : make_range(dimension()))
691 {
692 params.set<LinearVariableName>("variable") = _velocity_names[d];
693 if (_momentum_wall_functors.count(boundary_name) == 0)
694 params.set<MooseFunctorName>("functor") = "0";
695 else
696 params.set<MooseFunctorName>("functor") = _momentum_wall_functors[boundary_name][d];
697
698 getProblem().addLinearFVBC(bc_type, _velocity_names[d] + "_" + boundary_name, params);
699 }
700 }
701 else if (momentum_wall_type == "symmetry")
702 {
703 has_symmetry_bc = true;
704 {
705 const std::string bc_type = "LinearFVVelocitySymmetryBC";
706 InputParameters params = getFactory().getValidParams(bc_type);
707 params.set<std::vector<BoundaryName>>("boundary") = {boundary_name};
708 for (unsigned int d = 0; d < dimension(); ++d)
709 params.set<SolverVariableName>(u_names[d]) = _velocity_names[d];
710
711 for (const auto d : make_range(dimension()))
712 {
713 params.set<LinearVariableName>("variable") = _velocity_names[d];
714 params.set<MooseEnum>("momentum_component") = NS::directions[d];
715
716 getProblem().addLinearFVBC(bc_type, _velocity_names[d] + "_" + boundary_name, params);
717 }
718 }
719 // Porous walls receive a pressure flux boundary condition below
721 {
722 const std::string bc_type = "LinearFVPressureSymmetryBC";
723 InputParameters params = getFactory().getValidParams(bc_type);
724 params.set<std::vector<BoundaryName>>("boundary") = {boundary_name};
725 params.set<LinearVariableName>("variable") = _pressure_name;
726 params.set<MooseFunctorName>("HbyA_flux") = "HbyA";
727 getProblem().addLinearFVBC(bc_type, _pressure_name + "_" + boundary_name, params);
728 }
729 }
730 else
731 mooseError("Unsupported wall boundary condition type: " + std::string(momentum_wall_type));
732 }
733
735 {
736 // The pressure flux is set by the wall velocity and the H/A flux, so the boundary pressure
737 // stays consistent with the momentum balance of the adjacent porous cell
738 if (_wall_boundaries.empty())
739 return;
740 const std::string bc_type = "LinearFVPressureFluxBC";
741 InputParameters params = getFactory().getValidParams(bc_type);
742 params.set<std::vector<BoundaryName>>("boundary") = _wall_boundaries;
743 params.set<LinearVariableName>("variable") = _pressure_name;
744 params.set<MooseFunctorName>("HbyA_flux") = "HbyA";
745 params.set<MooseFunctorName>("Ainv") = "Ainv";
746 params.set<MooseFunctorName>(NS::density) = _density_name;
747 for (const auto d : make_range(dimension()))
748 params.set<MooseFunctorName>(u_names[d]) = _velocity_names[d];
749 params.set<bool>("use_two_term_expansion") = getParam<bool>("pressure_two_term_bc_expansion");
750 getProblem().addLinearFVBC(bc_type, prefix() + _pressure_name + "_walls", params);
751 }
752 else if (getParam<bool>("pressure_two_term_bc_expansion"))
753 {
754 if (!has_symmetry_bc)
755 {
756 const std::string bc_type = "LinearFVExtrapolatedPressureBC";
757 InputParameters params = getFactory().getValidParams(bc_type);
758 params.set<std::vector<BoundaryName>>("boundary") = _wall_boundaries;
759 params.set<LinearVariableName>("variable") = _pressure_name;
760 params.set<bool>("use_two_term_expansion") = true;
762 bc_type, _pressure_name + "_extrapolation_" + Moose::stringify(_wall_boundaries), params);
763 }
764 else
765 for (const auto & [boundary_name, momentum_wall_type] : _momentum_wall_types)
766 if (momentum_wall_type != "symmetry")
767 {
768 const std::string bc_type = "LinearFVExtrapolatedPressureBC";
769 InputParameters params = getFactory().getValidParams(bc_type);
770 params.set<std::vector<BoundaryName>>("boundary") = {boundary_name};
771 params.set<LinearVariableName>("variable") = _pressure_name;
772 params.set<bool>("use_two_term_expansion") = true;
774 bc_type, _pressure_name + "_extrapolation_" + boundary_name, params);
775 }
776 }
777}
std::map< BoundaryName, std::vector< MooseFunctorName > > _momentum_wall_functors
Functors describing the momentum for each wall boundary.
const std::vector< BoundaryName > _wall_boundaries
Boundaries which define a wall (slip/noslip/etc.)
std::map< BoundaryName, MooseEnum > _momentum_wall_types
Momentum wall boundary types.

◆ 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; }

◆ 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 91 of file NavierStokesPhysicsBase.C.

92{
93 unsigned short necessary_layers = getParam<unsigned short>("ghost_layers");
94 necessary_layers = std::max(necessary_layers, getNumberAlgebraicGhostingLayersNeeded());
95
96 // Just an object that has a ghost_layers parameter
97 const std::string kernel_type = "INSFVMixingLengthReynoldsStress";
98 InputParameters params = getFactory().getValidParams(kernel_type);
99 params.template set<unsigned short>("ghost_layers") = necessary_layers;
100
101 return params;
102}
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 539 of file WCNSFVFlowPhysicsBase.C.

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

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

◆ getCoupledTurbulencePhysics()

const WCNSFVTurbulencePhysicsBase * WCNSFVFlowPhysicsBase::getCoupledTurbulencePhysics ( ) const
protectedinherited

Find the turbulence physics.

Definition at line 506 of file WCNSFVFlowPhysicsBase.C.

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

Referenced by WCNSFVFlowPhysicsBase::actOnAdditionalTasks().

◆ 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 480 of file WCNSFVFlowPhysicsBase.C.

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

◆ getFluidTemperatureName()

const NonlinearVariableName & WCNSFVFlowPhysicsBase::getFluidTemperatureName ( ) const
inlineinherited

◆ 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.

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

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

◆ 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.

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 ...

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

◆ getHydraulicSeparators()

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

Get the hydraulic separator boundaries.

Definition at line 81 of file WCNSFVFlowPhysicsBase.h.

81{ return _hydraulic_separators; }

Referenced by WCNSFVFluidHeatTransferPhysics::addEnergySeparatorBC().

◆ 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 69 of file WCNSLinearFVFlowPhysics.h.

70 {
71 mooseError("Not implemented");
72 }

◆ 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.

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

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

◆ getNumberAlgebraicGhostingLayersNeeded()

unsigned short WCNSLinearFVFlowPhysics::getNumberAlgebraicGhostingLayersNeeded ( ) const
overrideprivatevirtual

Return the number of algebraic ghosting layers needed.

Reimplemented from WCNSFVFlowPhysicsBase.

Definition at line 915 of file WCNSLinearFVFlowPhysics.C.

916{
917 return 1;
918}

◆ getOutletBoundaries()

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

Get the outlet boundaries.

Definition at line 77 of file WCNSFVFlowPhysicsBase.h.

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

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

◆ getPorosityFunctorName()

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

◆ getPressureName()

const NonlinearVariableName & WCNSFVFlowPhysicsBase::getPressureName ( ) const
inlineinherited

◆ getSuppliedUserObjects()

std::vector< UserObjectName > WCNSLinearFVFlowPhysics::getSuppliedUserObjects ( ) const
overridevirtual

Reimplemented from PhysicsBase.

Definition at line 870 of file WCNSLinearFVFlowPhysics.C.

871{
872 std::vector<UserObjectName> supplied = {rhieChowUOName()};
873 if (_has_baffles)
874 supplied.push_back(prefix() + "pressure_jump");
875 return supplied;
876}

◆ getVelocityFaceInterpolationMethod()

const MooseEnum & WCNSFVFlowPhysicsBase::getVelocityFaceInterpolationMethod ( ) const
inlineinherited

Get the face interpolation method for velocity.

Definition at line 63 of file WCNSFVFlowPhysicsBase.h.

const MooseEnum _velocity_interpolation
The velocity face interpolation method for advecting other quantities.

Referenced by WCNSFVTwoPhaseMixturePhysics::addAdvectionSlipTerm().

◆ getVelocityNames()

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

◆ getWallBoundaries()

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

◆ gravityVector()

RealVectorValue WCNSFVFlowPhysicsBase::gravityVector ( ) const
inlineinherited

Return the gravity vector.

Definition at line 57 of file WCNSFVFlowPhysicsBase.h.

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

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

◆ hasFlowEquations()

bool WCNSFVFlowPhysicsBase::hasFlowEquations ( ) const
inlineinherited

◆ hasForchheimerFriction()

bool WCNSLinearFVFlowPhysics::hasForchheimerFriction ( ) const
overrideprivatevirtual

Return whether a Forchheimer friction model is in use.

Implements WCNSFVFlowPhysicsBase.

Definition at line 905 of file WCNSLinearFVFlowPhysics.C.

906{
907 for (const auto & block_types : _friction_types)
908 for (const auto & type : block_types)
909 if (MooseUtils::toUpper(type) == "FORCHHEIMER")
910 return true;
911 return false;
912}
for(PetscInt i=0;i< nvars;++i)

◆ 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.

157 {
160 else
161 return false;
162 }
bool hasTurbulenceModel() const
Whether a turbulence model is in use.

Referenced by WCNSFVFlowPhysics::addWallsBC().

◆ includeIsotropicStress()

bool WCNSFVFlowPhysicsBase::includeIsotropicStress ( ) const
inlineinherited

Whether to include the isotropic viscous stress contribution.

Definition at line 43 of file WCNSFVFlowPhysicsBase.h.

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

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

◆ includeSymmetrizedViscousStress()

bool WCNSFVFlowPhysicsBase::includeSymmetrizedViscousStress ( ) const
inlineinherited

Whether to include the symmetrized contribution in the viscous stress.

Definition at line 41 of file WCNSFVFlowPhysicsBase.h.

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

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

◆ initializePhysicsAdditional()

void WCNSLinearFVFlowPhysics::initializePhysicsAdditional ( )
overrideprotectedvirtual

Reimplemented from WCNSFVFlowPhysicsBase.

Definition at line 198 of file WCNSLinearFVFlowPhysics.C.

199{
201 // TODO Add support for multi-system by either:
202 // - creating the problem in the Physics or,
203 // - checking that the right systems are being created
204 getProblem().needSolutionState(2, Moose::SolutionIterationType::Nonlinear);
205 // TODO Ban all other nonlinear Physics for now
206
207 // Fix the default system names if using a different dimension
208 if (!isParamSetByUser("system_name"))
209 {
210 if (dimension() == 1)
211 _system_names = {"u_system", "pressure_system"};
212 else if (dimension() == 2)
213 _system_names = {"u_system", "v_system", "pressure_system"};
214 }
215}
void needSolutionState(unsigned int oldest_needed, Moose::SolutionIterationType iteration_type)
std::vector< SolverSystemName > _system_names
virtual void initializePhysicsAdditional() override

◆ 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.

84 {
86 static_cast<int>(libmesh_map_find(_momentum_inlet_types, boundary_name)));
87 }
MomentumInletTypes
Definition NS.h:217

Referenced by WCNSFVFluidHeatTransferPhysics::addEnergyInletBC().

◆ porousMediumTreatment()

bool WCNSFVFlowPhysicsBase::porousMediumTreatment ( ) const
inlineinherited

Return whether a porous medium treatment is applied.

Definition at line 55 of file WCNSFVFlowPhysicsBase.h.

◆ rhieChowUOName()

const UserObjectName & WCNSFVFlowPhysicsBase::rhieChowUOName ( ) const
inherited

Return the name of the Rhie Chow user object.

Definition at line 532 of file WCNSFVFlowPhysicsBase.C.

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

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

◆ usingNavierStokesFVSyntax()

bool NavierStokesPhysicsBase::usingNavierStokesFVSyntax ( ) const
inlineprotectedinherited

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

Definition at line 33 of file NavierStokesPhysicsBase.h.

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

◆ validParams()

InputParameters WCNSLinearFVFlowPhysics::validParams ( )
static

Definition at line 30 of file WCNSLinearFVFlowPhysics.C.

31{
34 "Define the Navier Stokes weakly-compressible equations with the linear "
35 "solver implementation of the SIMPLE scheme");
36 params.set<MooseEnum>("momentum_advection_interpolation") = NS::fvAdvectedInterpolationMethods();
37 params.addParam<InterpolationMethodName>(
38 "momentum_advection_interpolation_method_name",
39 "Name of an externally defined FVInterpolationMethod to use for momentum advection. When "
40 "provided, this overrides 'momentum_advection_interpolation'.");
41
42 params.addParam<bool>(
43 "orthogonality_correction", false, "Whether to use orthogonality correction");
44 params.renameParam("orthogonality_correction", "use_nonorthogonal_correction", "");
45 params.addParam<MooseEnum>(
46 "pressure_diffusion_interpolation",
48 "The face interpolation method for Ainv in the pressure correction diffusion term.");
49 params.addParamNamesToGroup("pressure_diffusion_interpolation", "Numerical scheme");
50 params.set<unsigned short>("ghost_layers") = 1;
51
52 // This will be adapted based on the dimension
53 params.set<std::vector<SolverSystemName>>("system_names") = {
54 "u_system", "v_system", "w_system", "pressure_system"};
55
56 // Implemented in the executioner
57 params.suppressParameter<MooseEnum>("pinned_pressure_type");
58 params.suppressParameter<Point>("pinned_pressure_point");
59 params.suppressParameter<PostprocessorName>("pinned_pressure_value");
60
61 // Porous medium pressure baffles
62 params.transferParam<MooseEnum>(NSFVBase::validParams(), "porosity_interface_pressure_treatment");
63 params.addParam<std::vector<BoundaryName>>(
64 "pressure_drop_sidesets",
65 {},
66 "Internal sidesets carrying a pressure-jump baffle with the Bernoulli pressure jump and an "
67 "optional irreversible form loss. Used when 'porosity_interface_pressure_treatment' is "
68 "'bernoulli'.");
69 params.transferParam<std::vector<Real>>(NSFVBase::validParams(), "pressure_drop_form_factors");
71 "reference_velocity_side",
72 "pressure_drop_reference_velocity_side");
73 params.transferParam<Real>(PorousRhieChowMassFlux::validParams(), "pressure_jump_relaxation");
74 params.addParam<bool>(
75 "use_reconstructed_pressure_gradient",
76 true,
77 "Whether the momentum pressure kernels use the FVReconstructedPressureGradient built on the "
78 "jump-aware pressure gradient when pressure-jump baffles are present.");
79 // Same default and range as the gradient_relaxation parameter of FVReconstructedPressureGradient
81 "pressure_gradient_relaxation",
82 0.1,
83 "0.0<pressure_gradient_relaxation<=1.0",
84 "Relaxation factor applied when updating the reconstructed pressure-coupling gradient.");
86 "porosity_interface_pressure_treatment pressure_drop_sidesets pressure_drop_form_factors "
87 "pressure_drop_reference_velocity_side pressure_jump_relaxation "
88 "use_reconstructed_pressure_gradient pressure_gradient_relaxation",
89 "Flow medium discontinuity treatment");
90
91 // Not supported
92 params.suppressParameter<bool>("add_flow_equations");
93 params.suppressParameter<MooseEnum>("mu_interp_method");
94 // Not needed
95 params.suppressParameter<bool>("add_flow_equations");
96 params.suppressParameter<MooseEnum>("preconditioning");
97
98 // No other options so far
99 params.set<MooseEnum>("velocity_interpolation") = "rc";
100 params.suppressParameter<MooseEnum>("velocity_interpolation");
101
102 // Rhie-Chow
103 params.transferParam<MooseEnum>(RhieChowMassFlux::validParams(), "pressure_projection_method");
104 params.addParamNamesToGroup("momentum_advection_interpolation_method_name", "Numerical scheme");
105
106 return params;
107}
static InputParameters validParams()
Return the input parameters for this pressure-jump model.
void suppressParameter(const std::string &name)
void addParamNamesToGroup(const std::string &space_delim_names, const std::string group_name)
void renameParam(const std::string &old_name, const std::string &new_name, const std::string &new_docstring)
void transferParam(const InputParameters &source_param, const std::string &name, const std::string &new_name="", const std::string &new_description="")
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
void addRangeCheckedParam(const std::string &name, const T &value, const std::string &parsed_function, const std::string &doc_string)
static InputParameters validParams()
Definition NSFVBase.C:378
static InputParameters validParams()
static InputParameters validParams()
static InputParameters validParams()
MooseEnum fvFaceInterpolationMethods()
Enum of the interpolation methods supported by FVInterpolationMethod objects.
Definition NSFVUtils.C:85
MooseEnum fvAdvectedInterpolationMethods()
Enum of the advected interpolation methods supported by FVInterpolationMethod objects.
Definition NSFVUtils.C:61

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().

◆ _baffle_sidesets

const std::vector<BoundaryName> WCNSLinearFVFlowPhysics::_baffle_sidesets
private

Sidesets carrying Bernoulli pressure-jump baffles (porous medium treatment only)

Definition at line 79 of file WCNSLinearFVFlowPhysics.h.

Referenced by addPressureJumpModel().

◆ _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(), WCNSFVFlowPhysics::addMomentumBoussinesqKernels(), 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 WCNSFVFlowPhysics::addMomentumFrictionKernels(), 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 WCNSFVFlowPhysics::addMomentumFrictionKernels(), addMomentumFrictionKernels(), and WCNSFVFlowPhysics::getLinearFrictionCoefName().

◆ _friction_types

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

◆ _has_baffles

const bool WCNSLinearFVFlowPhysics::_has_baffles
private

◆ _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(), 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 WCNSFVFlowPhysics::addInletBC(), 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 WCNSFVFlowPhysics::addOutletBC(), 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 WCNSFVFlowPhysics::addWallsBC(), 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 WCNSFVFlowPhysics::addWallsBC(), 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 77 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 WCNSFVFlowPhysics::addOutletBC(), 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().

◆ _use_reconstructed_pressure_gradient

const bool WCNSLinearFVFlowPhysics::_use_reconstructed_pressure_gradient
private

Whether the momentum pressure kernels use the reconstructed pressure gradient.

Definition at line 83 of file WCNSLinearFVFlowPhysics.h.

Referenced by addFVGradientMethods(), and addMomentumPressureKernels().

◆ _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: