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 | Static Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
RhieChowMassFlux Class Reference

User object responsible for determining the face fluxes using the Rhie-Chow interpolation in a segregated solver that uses the linear FV formulation. More...

#include <RhieChowMassFlux.h>

Inheritance diagram for RhieChowMassFlux:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 RhieChowMassFlux (const InputParameters &params)
 
Real getMassFlux (const FaceInfo &fi) const
 Get the face velocity times density (used in advection terms)
 
Real getVolumetricFaceFlux (const FaceInfo &fi) const
 Get the volumetric face flux (used in advection terms)
 
const LinearFVGradientReader & pressureGradientField () const
 Get the registered pressure gradient field used by compatible momentum pressure kernels.
 
const LinearFVGradientReader & basePressureGradientField () const
 Get the base pressure gradient field used to seed reconstructed gradient updates.
 
const std::vector< NumericVector< Number > * > & basePressureGradientComponents () const
 Get the base-pressure gradient component vectors used to seed reconstructed updates.
 
const std::vector< std::unique_ptr< NumericVector< Number > > > & HbyAComponents () const
 Get the momentum-layout H/A component vectors.
 
const std::vector< std::unique_ptr< NumericVector< Number > > > & AinvComponents () const
 Get the momentum-layout 1/A component vectors.
 
unsigned int pressureVariableNumber () const
 Variable number of the pressure variable reconstructed by this object.
 
unsigned int dimension () const
 Number of spatial dimensions of the coupled momentum/pressure systems.
 
MooseLinearVariableFVReal & velocityVariable (unsigned int component)
 Velocity variable for one spatial component.
 
const MooseLinearVariableFVReal & velocityVariable (unsigned int component) const
 Velocity variable for one spatial component.
 
LinearSystem & momentumSystem (unsigned int component)
 Momentum linear system for one spatial component.
 
const LinearSystem & momentumSystem (unsigned int component) const
 Momentum linear system for one spatial component.
 
const LinearSystem & pressureSystem () const
 Pressure linear system.
 
dof_id_type faceMassFluxGeneration () const
 Producer counter for the conservative face mass flux: incremented every time computeFaceMassFlux() runs.
 
virtual Real getVolumetricFaceFlux (const Moose::FV::InterpMethod m, const FaceInfo &fi, const Moose::StateArg &time, const THREAD_ID tid, bool subtract_mesh_velocity) const override
 Retrieve the volumetric face flux, will not include derivatives.
 
void initFaceMassFlux ()
 Initialize the container for face velocities.
 
void initCouplingField ()
 Initialize the coupling fields (HbyA and Ainv)
 
void computeFaceMassFlux ()
 Update the values of the face velocities in the containers.
 
bool usingReconstructedPressureGradientMethod () const
 Whether the registered pressure gradient field is produced by the reconstructed method.
 
void prepareMomentumPredictor ()
 Snapshot the fields read by the next momentum predictor.
 
void finalizeMomentumPredictor ()
 Capture the lagged velocity gradients computed while assembling the momentum predictor.
 
void preparePISOCorrector ()
 Capture the lagged velocity gradient for another corrector using the current predictor.
 
void preparePressureRelaxation ()
 Before pressure relaxation, form the conservative reconstructed candidate from the corrected face flux and update the cell velocity from that unrelaxed candidate.
 
void finalizePressureCorrector ()
 After pressure relaxation, refresh every registered pressure gradient and publish relaxed reconstructed feedback for the next momentum predictor.
 
void initPressureGradient ()
 Compute every registered pressure gradient once, before the first momentum predictor of a SIMPLE iteration sequence has anything to read.
 
virtual void meshChanged () override
 
virtual void initialize () override
 
virtual void execute () override
 
virtual void finalize () override
 
virtual void initialSetup () override
 
virtual void timestepSetup () override
 Prepare reconstructed-gradient state once per attempted time step.
 
void linkMomentumPressureSystems (const std::vector< LinearSystem * > &momentum_systems, LinearSystem &pressure_system, const std::vector< unsigned int > &momentum_system_numbers)
 Update the momentum system-related information.
 
void computeHbyA (const bool verbose)
 Computes the inverse of the diagonal (1/A) of the system matrix plus the H/A components for the pressure equation plus Rhie-Chow interpolation.
 
bool hasFaceSide (const FaceInfo &fi, const bool fi_elem_side) const override
 
virtual Real spatialValue (const Point &) const
 
virtual const std::vector< Point > spatialPoints () const
 
void setPrimaryThreadCopy (UserObject *primary)
 
UserObject * primaryThreadCopy ()
 
SubProblem & getSubProblem () const
 
bool shouldDuplicateInitialExecution () const
 
void gatherSum (T &value)
 
void gatherMax (T &value)
 
void gatherMin (T &value)
 
void gatherProxyValueMax (T1 &proxy, T2 &value)
 
void gatherProxyValueMin (T1 &proxy, T2 &value)
 
std::set< UserObjectName > getDependObjects () const
 
const std::set< std::string > & getRequestedItems () override
 
const std::set< std::string > & getSuppliedItems () override
 
unsigned int systemNumber () const
 
virtual bool needThreadedCopy () const
 
virtual bool enabled () const
 
std::shared_ptr< MooseObject > getSharedPtr ()
 
std::shared_ptr< const MooseObject > getSharedPtr () const
 
bool isKokkosObject () const
 
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
 
virtual void jacobianSetup ()
 
virtual void residualSetup ()
 
virtual void customSetup (const ExecFlagType &)
 
const ExecFlagEnum & getExecuteOnEnum () const
 
UserObjectName getUserObjectName (const std::string &param_name) const
 
const T & getUserObject (const std::string &param_name, bool is_dependency=true) const
 
const T & getUserObjectByName (const UserObjectName &object_name, bool is_dependency=true) const
 
const UserObjectBase & getUserObjectBase (const std::string &param_name, bool is_dependency=true) const
 
const UserObjectBase & getUserObjectBaseByName (const UserObjectName &object_name, bool is_dependency=true) const
 
const std::vector< MooseVariableScalar * > & getCoupledMooseScalarVars ()
 
const std::set< TagID > & getScalarVariableCoupleableVectorTags () const
 
const std::set< TagID > & getScalarVariableCoupleableMatrixTags () const
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialProperty (const std::string &name, MaterialData &material_data, const unsigned int state=0)
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialProperty (const std::string &name, const unsigned int state=0)
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialProperty (const std::string &name, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialProperty (const std::string &name, MaterialData &material_data, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialProperty (const std::string &name, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialProperty (const std::string &name, const unsigned int state=0)
 
const ADMaterialProperty< T > & getADMaterialProperty (const std::string &name, MaterialData &material_data)
 
const ADMaterialProperty< T > & getADMaterialProperty (const std::string &name)
 
const ADMaterialProperty< T > & getADMaterialProperty (const std::string &name)
 
const MaterialProperty< T > & getMaterialPropertyOld (const std::string &name, MaterialData &material_data)
 
const MaterialProperty< T > & getMaterialPropertyOld (const std::string &name)
 
const MaterialProperty< T > & getMaterialPropertyOld (const std::string &name)
 
const MaterialProperty< T > & getMaterialPropertyOlder (const std::string &name, MaterialData &material_data)
 
const MaterialProperty< T > & getMaterialPropertyOlder (const std::string &name)
 
const MaterialProperty< T > & getMaterialPropertyOlder (const std::string &name)
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialPropertyByName (const MaterialPropertyName &name, MaterialData &material_data, const unsigned int state)
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialPropertyByName (const MaterialPropertyName &name, const unsigned int state=0)
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialPropertyByName (const MaterialPropertyName &name, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialPropertyByName (const MaterialPropertyName &name, MaterialData &material_data, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialPropertyByName (const MaterialPropertyName &name, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialPropertyByName (const MaterialPropertyName &name, const unsigned int state=0)
 
const ADMaterialProperty< T > & getADMaterialPropertyByName (const MaterialPropertyName &name, MaterialData &material_data)
 
const ADMaterialProperty< T > & getADMaterialPropertyByName (const MaterialPropertyName &name)
 
const ADMaterialProperty< T > & getADMaterialPropertyByName (const MaterialPropertyName &name)
 
const MaterialProperty< T > & getMaterialPropertyOldByName (const MaterialPropertyName &name, MaterialData &material_data)
 
const MaterialProperty< T > & getMaterialPropertyOldByName (const MaterialPropertyName &name)
 
const MaterialProperty< T > & getMaterialPropertyOldByName (const MaterialPropertyName &name)
 
const MaterialProperty< T > & getMaterialPropertyOlderByName (const MaterialPropertyName &name, MaterialData &material_data)
 
const MaterialProperty< T > & getMaterialPropertyOlderByName (const MaterialPropertyName &name)
 
const MaterialProperty< T > & getMaterialPropertyOlderByName (const MaterialPropertyName &name)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyByName (const std::string &prop_name_in)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyOldByName (const std::string &prop_name)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyOlderByName (const std::string &prop_name)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialProperty (const std::string &name)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyOld (const std::string &name)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyOlder (const std::string &name)
 
std::pair< const MaterialProperty< T > *, std::set< SubdomainID > > getBlockMaterialProperty (const MaterialPropertyName &name)
 
std::pair< Moose::Kokkos::MaterialProperty< T, dimension >, std::set< SubdomainID > > getKokkosBlockMaterialProperty (const MaterialPropertyName &name)
 
const GenericMaterialProperty< T, is_ad > & getGenericZeroMaterialProperty (const std::string &name)
 
const GenericMaterialProperty< T, is_ad > & getGenericZeroMaterialProperty ()
 
const GenericMaterialProperty< T, is_ad > & getGenericZeroMaterialPropertyByName (const std::string &prop_name)
 
const MaterialProperty< T > & getZeroMaterialProperty (Ts... args)
 
std::set< SubdomainID > getMaterialPropertyBlocks (const std::string &name)
 
std::vector< SubdomainName > getMaterialPropertyBlockNames (const std::string &name)
 
std::set< BoundaryID > getMaterialPropertyBoundaryIDs (const std::string &name)
 
std::vector< BoundaryName > getMaterialPropertyBoundaryNames (const std::string &name)
 
void checkBlockAndBoundaryCompatibility (std::shared_ptr< MaterialBase > discrete)
 
std::unordered_map< SubdomainID, std::vector< MaterialBase * > > buildRequiredMaterials (bool allow_stateful=true)
 
void statefulPropertiesAllowed (bool)
 
virtual bool getMaterialPropertyCalled () const
 
virtual const std::unordered_set< unsigned int > & getMatPropDependencies () const
 
virtual void resolveOptionalProperties ()
 
const GenericMaterialProperty< T, is_ad > & getPossiblyConstantGenericMaterialPropertyByName (const MaterialPropertyName &prop_name, MaterialData &material_data, const unsigned int state)
 
bool isImplicit ()
 
Moose::StateArg determineState () const
 
virtual void threadJoin (const UserObject &) override
 
virtual void threadJoin (const UserObject &) override
 
virtual void subdomainSetup () override
 
virtual void subdomainSetup () override
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
const GenericOptionalMaterialProperty< T, is_ad > & getGenericOptionalMaterialProperty (const std::string &name, const unsigned int state=0)
 
const GenericOptionalMaterialProperty< T, is_ad > & getGenericOptionalMaterialProperty (const std::string &name, const unsigned int state=0)
 
const OptionalMaterialProperty< T > & getOptionalMaterialProperty (const std::string &name, const unsigned int state=0)
 
const OptionalMaterialProperty< T > & getOptionalMaterialProperty (const std::string &name, const unsigned int state=0)
 
const OptionalADMaterialProperty< T > & getOptionalADMaterialProperty (const std::string &name)
 
const OptionalADMaterialProperty< T > & getOptionalADMaterialProperty (const std::string &name)
 
const OptionalMaterialProperty< T > & getOptionalMaterialPropertyOld (const std::string &name)
 
const OptionalMaterialProperty< T > & getOptionalMaterialPropertyOld (const std::string &name)
 
const OptionalMaterialProperty< T > & getOptionalMaterialPropertyOlder (const std::string &name)
 
const OptionalMaterialProperty< T > & getOptionalMaterialPropertyOlder (const std::string &name)
 
MaterialBase & getMaterial (const std::string &name)
 
MaterialBase & getMaterial (const std::string &name)
 
MaterialBase & getMaterialByName (const std::string &name, bool no_warn=false)
 
MaterialBase & getMaterialByName (const std::string &name, bool no_warn=false)
 
bool hasMaterialProperty (const std::string &name)
 
bool hasMaterialProperty (const std::string &name)
 
bool hasMaterialPropertyByName (const std::string &name)
 
bool hasMaterialPropertyByName (const std::string &name)
 
bool hasADMaterialProperty (const std::string &name)
 
bool hasADMaterialProperty (const std::string &name)
 
bool hasADMaterialPropertyByName (const std::string &name)
 
bool hasADMaterialPropertyByName (const std::string &name)
 
bool hasKokkosMaterialProperty (const std::string &name)
 
bool hasKokkosMaterialProperty (const std::string &name)
 
bool hasKokkosMaterialPropertyByName (const std::string &name)
 
bool hasKokkosMaterialPropertyByName (const std::string &name)
 
bool hasGenericMaterialProperty (const std::string &name)
 
bool hasGenericMaterialProperty (const std::string &name)
 
bool hasGenericMaterialPropertyByName (const std::string &name)
 
bool hasGenericMaterialPropertyByName (const std::string &name)
 
const Function & getFunction (const std::string &name) const
 
const Function & getFunctionByName (const FunctionName &name) const
 
bool hasFunction (const std::string &param_name) const
 
bool hasFunctionByName (const FunctionName &name) const
 
Moose::Kokkos::Function getKokkosFunction (const std::string &name) const
 
const T & getKokkosFunction (const std::string &name) const
 
Moose::Kokkos::Function getKokkosFunctionByName (const FunctionName &name) const
 
const T & getKokkosFunctionByName (const FunctionName &name) const
 
bool hasKokkosFunction (const std::string &param_name) const
 
bool hasKokkosFunctionByName (const FunctionName &name) const
 
bool isDefaultPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
bool hasPostprocessor (const std::string &param_name, const unsigned int index=0) const
 
bool hasPostprocessorByName (const PostprocessorName &name) const
 
std::size_t coupledPostprocessors (const std::string &param_name) const
 
const PostprocessorName & getPostprocessorName (const std::string &param_name, const unsigned int index=0) const
 
const VectorPostprocessorValue & getVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name) const
 
const VectorPostprocessorValue & getVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValue & getVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const VectorPostprocessorValue & getVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValue & getVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name) const
 
const VectorPostprocessorValue & getVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValue & getVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const VectorPostprocessorValue & getVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name, bool needs_broadcast) const
 
const ScatterVectorPostprocessorValue & getScatterVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValue & getScatterVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValue & getScatterVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValue & getScatterVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
bool hasVectorPostprocessor (const std::string &param_name, const std::string &vector_name) const
 
bool hasVectorPostprocessor (const std::string &param_name) const
 
bool hasVectorPostprocessorByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
bool hasVectorPostprocessorByName (const VectorPostprocessorName &name) const
 
const VectorPostprocessorName & getVectorPostprocessorName (const std::string &param_name) const
 
T & getSampler (const std::string &name)
 
Sampler & getSampler (const std::string &name)
 
T & getSamplerByName (const SamplerName &name)
 
Sampler & getSamplerByName (const SamplerName &name)
 
virtual void meshDisplaced ()
 
PerfGraph & perfGraph ()
 
const PostprocessorValue & getPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValue & getPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValue & getPostprocessorValueOld (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValue & getPostprocessorValueOld (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValue & getPostprocessorValueOlder (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValue & getPostprocessorValueOlder (const std::string &param_name, const unsigned int index=0) const
 
virtual const PostprocessorValue & getPostprocessorValueByName (const PostprocessorName &name) const
 
virtual const PostprocessorValue & getPostprocessorValueByName (const PostprocessorName &name) const
 
const PostprocessorValue & getPostprocessorValueOldByName (const PostprocessorName &name) const
 
const PostprocessorValue & getPostprocessorValueOldByName (const PostprocessorName &name) const
 
const PostprocessorValue & getPostprocessorValueOlderByName (const PostprocessorName &name) const
 
const PostprocessorValue & getPostprocessorValueOlderByName (const PostprocessorName &name) const
 
bool isVectorPostprocessorDistributed (const std::string &param_name) const
 
bool isVectorPostprocessorDistributed (const std::string &param_name) const
 
bool isVectorPostprocessorDistributedByName (const VectorPostprocessorName &name) const
 
bool isVectorPostprocessorDistributedByName (const VectorPostprocessorName &name) const
 
const Distribution & getDistribution (const std::string &name) const
 
const T & getDistribution (const std::string &name) const
 
const Distribution & getDistribution (const std::string &name) const
 
const T & getDistribution (const std::string &name) const
 
const Distribution & getDistributionByName (const DistributionName &name) const
 
const T & getDistributionByName (const std::string &name) const
 
const Distribution & getDistributionByName (const DistributionName &name) const
 
const T & getDistributionByName (const std::string &name) const
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 
const std::vector< SubdomainName > & blocks () const
 
unsigned int numBlocks () const
 
virtual const std::set< SubdomainID > & blockIDs () const
 
unsigned int blocksMaxDimension () const
 
bool hasBlocks (const SubdomainName &name) const
 
bool hasBlocks (const std::vector< SubdomainName > &names) const
 
bool hasBlocks (const std::set< SubdomainName > &names) const
 
bool hasBlocks (SubdomainID id) const
 
bool hasBlocks (const std::vector< SubdomainID > &ids) const
 
bool hasBlocks (const std::set< SubdomainID > &ids) const
 
bool isBlockSubset (const std::set< SubdomainID > &ids) const
 
bool isBlockSubset (const std::vector< SubdomainID > &ids) const
 
bool hasBlockMaterialProperty (const std::string &prop_name)
 
const std::set< SubdomainID > & meshBlockIDs () const
 
virtual bool blockRestricted () const
 
virtual void checkVariable (const MooseVariableBase &variable) const
 
const Moose::Functor< Real > * defaultFunctor (const std::string &name)
 
const Moose::Functor< ADReal > * defaultFunctor (const std::string &name)
 

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)
 
static void sort (typename std::vector< T > &vector)
 
static void sortDFS (typename std::vector< T > &vector)
 
static void cyclicDependencyError (CyclicDependencyException< T2 > &e, const std::string &header, NameFunc &&name_func)
 
static void cyclicDependencyError (CyclicDependencyException< T2 > &e, const std::string &header)
 
static std::string deduceFunctorName (const std::string &name, const InputParameters &params)
 

Public Attributes

 usingCombinedWarningSolutionWarnings
 
const ConsoleStream _console
 

Static Public Attributes

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 PropertyValue::id_type default_property_id
 
static constexpr PropertyValue::id_type zero_property_id
 
static constexpr auto SYSTEM
 
static constexpr auto NAME
 

Protected Member Functions

template<typename GradientComponent >
void updateCellVelocity (const std::vector< GradientComponent > &pressure_gradient)
 Update cell velocity from the supplied momentum-coupling pressure gradient.
 
const std::vector< NumericVector< Number > * > & pressureGradientComponents () const
 Get the registered pressure gradient component vectors.
 
FVReconstructedPressureGradient & reconstructedGradientMethod ()
 Access the reconstructed gradient method when it is selected.
 
const FVReconstructedPressureGradient & reconstructedGradientMethod () const
 Access the reconstructed gradient method when it is selected.
 
void checkReconstructedPressureGradientCompatibility () const
 Check the single-variable system layout assumed by reconstructed pressure-gradient vector ops.
 
void setupMeshInformation ()
 Compute the cell volumes on the mesh.
 
void populateCouplingFunctors (const std::vector< std::unique_ptr< NumericVector< Number > > > &raw_hbya, const std::vector< std::unique_ptr< NumericVector< Number > > > &raw_Ainv)
 Populate the face values of the H/A and 1/A fields.
 
template<typename VarType >
void checkBlocks (const VarType &var) const
 Check the block consistency between the passed in var and us.
 
virtual bool supportMeshVelocity () const override
 Returns whether the UO can support mesh velocity advection.
 
virtual void addPostprocessorDependencyHelper (const PostprocessorName &name) const override
 
virtual void addVectorPostprocessorDependencyHelper (const VectorPostprocessorName &name) const override
 
virtual void addUserObjectDependencyHelper (const UserObjectBase &uo) const override
 
void addReporterDependencyHelper (const ReporterName &reporter_name) override
 
void flagInvalidSolutionInternal (const InvalidSolutionID invalid_solution_id) const
 
InvalidSolutionID registerInvalidSolutionInternal (const std::string &message, const bool warning) const
 
const ReporterContextBase & getReporterContextBaseByName (const ReporterName &reporter_name) const
 
const ReporterName & getReporterName (const std::string &param_name) const
 
T & declareRestartableData (const std::string &data_name, Args &&... args)
 
ManagedValue< T > declareManagedRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
const T & getRestartableData (const std::string &data_name) const
 
T & declareRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
T & declareRecoverableData (const std::string &data_name, Args &&... args)
 
T & declareRestartableDataWithObjectName (const std::string &data_name, const std::string &object_name, Args &&... args)
 
T & declareRestartableDataWithObjectNameWithContext (const std::string &data_name, const std::string &object_name, void *context, Args &&... args)
 
std::string restartableName (const std::string &data_name) 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
 
bool isCoupledScalar (const std::string &var_name, unsigned int i=0) const
 
unsigned int coupledScalarComponents (const std::string &var_name) const
 
unsigned int coupledScalar (const std::string &var_name, unsigned int comp=0) const
 
libMesh::Order coupledScalarOrder (const std::string &var_name, unsigned int comp=0) const
 
const VariableValue & coupledScalarValue (const std::string &var_name, unsigned int comp=0) const
 
const ADVariableValue & adCoupledScalarValue (const std::string &var_name, unsigned int comp=0) const
 
const GenericVariableValue< is_ad > & coupledGenericScalarValue (const std::string &var_name, unsigned int comp=0) const
 
const GenericVariableValue< false > & coupledGenericScalarValue (const std::string &var_name, const unsigned int comp) const
 
const GenericVariableValue< true > & coupledGenericScalarValue (const std::string &var_name, const unsigned int comp) const
 
const VariableValue & coupledVectorTagScalarValue (const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
 
const VariableValue & coupledMatrixTagScalarValue (const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
 
const VariableValue & coupledScalarValueOld (const std::string &var_name, unsigned int comp=0) const
 
const VariableValue & coupledScalarValueOlder (const std::string &var_name, unsigned int comp=0) const
 
const VariableValue & coupledScalarDot (const std::string &var_name, unsigned int comp=0) const
 
const ADVariableValue & adCoupledScalarDot (const std::string &var_name, unsigned int comp=0) const
 
const VariableValue & coupledScalarDotDot (const std::string &var_name, unsigned int comp=0) const
 
const VariableValue & coupledScalarDotOld (const std::string &var_name, unsigned int comp=0) const
 
const VariableValue & coupledScalarDotDotOld (const std::string &var_name, unsigned int comp=0) const
 
const VariableValue & coupledScalarDotDu (const std::string &var_name, unsigned int comp=0) const
 
const VariableValue & coupledScalarDotDotDu (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledVectorTagScalarValueByName (const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledVectorTagScalarValue (const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledScalarValue (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledScalarValueOld (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledScalarValueOlder (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledScalarDot (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::Scalar< const Real > kokkosCoupledScalarDotDu (const std::string &var_name, unsigned int comp=0) const
 
const MooseVariableScalar * getScalarVar (const std::string &var_name, unsigned int comp) const
 
virtual void checkMaterialProperty (const std::string &name, const unsigned int state)
 
virtual void getKokkosMaterialPropertyHook (const std::string &, const unsigned int)
 
void markMatPropRequested (const std::string &)
 
MaterialPropertyName getMaterialPropertyName (const std::string &name) const
 
void checkExecutionStage ()
 
const T & getReporterValue (const std::string &param_name, const std::size_t time_index=0)
 
const T & getReporterValue (const std::string &param_name, ReporterMode mode, const std::size_t time_index=0)
 
const T & getReporterValue (const std::string &param_name, const std::size_t time_index=0)
 
const T & getReporterValue (const std::string &param_name, ReporterMode mode, const std::size_t time_index=0)
 
const T & getReporterValueByName (const ReporterName &reporter_name, const std::size_t time_index=0)
 
const T & getReporterValueByName (const ReporterName &reporter_name, ReporterMode mode, const std::size_t time_index=0)
 
const T & getReporterValueByName (const ReporterName &reporter_name, const std::size_t time_index=0)
 
const T & getReporterValueByName (const ReporterName &reporter_name, ReporterMode mode, const std::size_t time_index=0)
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
const GenericMaterialProperty< T, is_ad > * defaultGenericMaterialProperty (const std::string &name)
 
const GenericMaterialProperty< T, is_ad > * defaultGenericMaterialProperty (const std::string &name)
 
const MaterialProperty< T > * defaultMaterialProperty (const std::string &name)
 
const MaterialProperty< T > * defaultMaterialProperty (const std::string &name)
 
const ADMaterialProperty< T > * defaultADMaterialProperty (const std::string &name)
 
const ADMaterialProperty< T > * defaultADMaterialProperty (const std::string &name)
 
virtual bool hasBlockMaterialPropertyHelper (const std::string &prop_name)
 
void initializeBlockRestrictable (const MooseObject *moose_object)
 
void initializeKokkosBlockRestrictable ()
 
Moose::CoordinateSystemType getBlockCoordSystem ()
 
KOKKOS_FUNCTION dof_id_type numKokkosBlockElements () const
 
KOKKOS_FUNCTION dof_id_type numKokkosBlockNodes () const
 
KOKKOS_FUNCTION dof_id_type numKokkosBlockSides () const
 
KOKKOS_FUNCTION ContiguousElementID kokkosBlockElementID (Moose::Kokkos::ThreadID tid) const
 
KOKKOS_FUNCTION ContiguousElementID kokkosBlockNodeID (Moose::Kokkos::ThreadID tid) const
 
KOKKOS_FUNCTION auto kokkosBlockElementSideID (Moose::Kokkos::ThreadID tid) const
 
std::string deduceFunctorName (const std::string &name) const
 
const Moose::Functor< T > & getFunctor (const std::string &name)
 
const Moose::Functor< T > & getFunctor (const std::string &name, THREAD_ID tid)
 
const Moose::Functor< T > & getFunctor (const std::string &name, SubProblem &subproblem)
 
const Moose::Functor< T > & getFunctor (const std::string &name, SubProblem &subproblem, THREAD_ID tid)
 
bool isFunctor (const std::string &name) const
 
bool isFunctor (const std::string &name, const SubProblem &subproblem) const
 
Moose::ElemArg makeElemArg (const Elem *elem, bool correct_skewnewss=false) const
 
void checkFunctorSupportsSideIntegration (const std::string &name, bool qp_integration)
 
const Moose::Functor< T > & getFunctorByName (const std::string &name)
 

Static Protected Member Functions

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

Protected Attributes

const MooseMesh & _moose_mesh
 The MooseMesh that this user object operates on.
 
const libMesh::MeshBase & _mesh
 The libMesh mesh that this object acts on.
 
const unsigned int _dim
 The dimension of the mesh, e.g. 3 for hexes and tets, 2 for quads and tris.
 
const MooseLinearVariableFVReal *const _p
 The thread 0 copy of the pressure variable.
 
std::vector< MooseLinearVariableFVReal * > _vel
 Thread 0 copies of the velocity variables; non-const to allow writing cell velocities in updateCellVelocity().
 
LinearFVPressureCorrectionDiffusion * _p_diffusion_kernel
 Pointer to the pressure diffusion term in the pressure Poisson equation.
 
FaceCenteredMapFunctor< Real, std::unordered_map< dof_id_type, Real > > _HbyA_flux
 A map functor from faces to $HbyA_{ij} = (A_{offdiag}*\mathrm{(predicted~velocity)} - \mathrm{Source})_{ij}/A_{ij}$.
 
std::vector< std::unique_ptr< NumericVector< Number > > > _HbyA_raw
 We hold on to the cell-based HbyA vectors so that we can easily reconstruct the cell velocities as well.
 
FaceCenteredMapFunctor< RealVectorValue, std::unordered_map< dof_id_type, RealVectorValue > > _Ainv
 A map functor from faces to $(1/A)_f$.
 
std::vector< std::unique_ptr< NumericVector< Number > > > _Ainv_raw
 We hold on to the cell-based 1/A vectors so that we can easily reconstruct the cell velocities as well.
 
std::unique_ptr< NumericVector< Number > > _A_avg
 
FaceCenteredMapFunctor< Real, std::unordered_map< dof_id_type, Real > > & _face_mass_flux
 A map functor from faces to mass fluxes which are used in the advection terms.
 
std::vector< std::unique_ptr< NumericVector< Number > > > _grad_p_current
 Coupling pressure gradient captured before the current momentum predictor is assembled.
 
dof_id_type _face_mass_flux_generation = 0
 Producer counter for the conservative face mass flux: incremented every time computeFaceMassFlux() runs.
 
const Moose::Functor< Real > & _rho
 Functor describing the density of the fluid.
 
std::vector< LinearSystem * > _momentum_systems
 Pointers to the linear system(s) in moose corresponding to the momentum equation(s)
 
std::vector< unsigned int > _momentum_system_numbers
 Numbers of the momentum system(s)
 
std::vector< unsigned int > _global_momentum_system_numbers
 Global numbers of the momentum system(s)
 
std::vector< libMesh::LinearImplicitSystem * > _momentum_implicit_systems
 Pointers to the momentum equation implicit system(s) from libmesh.
 
LinearSystem * _pressure_system
 Pointer to the pressure system.
 
const LinearFVGradientReader * _pressure_gradient_field
 Registered pressure gradient field used by Rhie-Chow and compatible momentum pressure kernels.
 
const LinearFVGradientReader * _base_pressure_gradient_field
 Base pressure gradient field used to seed reconstructed gradient updates.
 
unsigned int _global_pressure_system_number
 Global number of the pressure system.
 
std::unique_ptr< NumericVector< Number > > _cell_volumes
 We will hold a vector of cell volumes to make sure we can do volume corrections rapidly.
 
const MooseEnum _pressure_projection_method
 Enumerator for the method used for pressure projection.
 
const Moose::FV::InterpMethod _pressure_diffusion_interp_method
 Interpolation method used for the pressure diffusion coefficient on faces.
 
const Moose::CoordinateSystemType & _coord_sys
 
const THREAD_ID _tid
 
SubProblem & _subproblem
 
FEProblemBase & _fe_problem
 
SystemBase & _sys
 
Assembly & _assembly
 
const bool _duplicate_initial_execution
 
std::set< std::string > _depend_uo
 
const bool & _enabled
 
MooseApp & _app
 
Factory & _factory
 
ActionFactory & _action_factory
 
const std::string & _type
 
const std::string & _name
 
const InputParameters & _pars
 
const ExecFlagEnum & _execute_enum
 
const ExecFlagType & _current_execute_flag
 
MooseApp & _restartable_app
 
const std::string _restartable_system_name
 
const THREAD_ID _restartable_tid
 
const bool _restartable_read_only
 
FEProblemBase & _mci_feproblem
 
FEProblemBase & _mdi_feproblem
 
MooseApp & _pg_moose_app
 
const std::string _prefix
 
FEProblemBase & _sc_fe_problem
 
const THREAD_ID _sc_tid
 
const Real & _real_zero
 
const VariableValue & _scalar_zero
 
const Point & _point_zero
 
const InputParameters & _mi_params
 
const std::string _mi_name
 
const MooseObjectName _mi_moose_object_name
 
FEProblemBase & _mi_feproblem
 
SubProblem & _mi_subproblem
 
const THREAD_ID _mi_tid
 
const bool _is_kokkos_object
 
const Moose::MaterialDataType _material_data_type
 
MaterialData & _material_data
 
bool _stateful_allowed
 
bool _get_material_property_called
 
std::vector< std::unique_ptr< PropertyValue > > _default_properties
 
std::unordered_set< unsigned int > _material_property_dependencies
 
const MaterialPropertyName _get_suffix
 
const bool _use_interpolated_state
 
const InputParameters & _ti_params
 
FEProblemBase & _ti_feproblem
 
bool _is_implicit
 
Real & _t
 
const Real & _t_old
 
int & _t_step
 
Real & _dt
 
Real & _dt_old
 
bool _is_transient
 
const Parallel::Communicator & _communicator
 
const MaterialData * _blk_material_data
 

Static Protected Attributes

static const std::string _interpolated_old
 
static const std::string _interpolated_older
 

Private Member Functions

const Moose::FunctionBase * getKokkosFunctionByNameHelper (const FunctionName &name) const
 
const UserObjectBase & getUserObjectFromFEProblem (const UserObjectName &object_name, const THREAD_ID tid=0) const
 
const T & castUserObject (const UserObjectBase &uo_base, const std::string &param_name="") const
 
void mooseObjectError (const std::string &param_name, std::stringstream &oss) const
 
const std::string & userObjectType (const UserObjectBase &uo) const
 
const std::string & userObjectName (const UserObjectBase &uo) const
 
const PostprocessorName & getPostprocessorNameInternal (const std::string &param_name, const unsigned int index, const bool allow_default_value=true) const
 
bool isDefaultPostprocessorValueByName (const PostprocessorName &name) const
 
PostprocessorValue getDefaultPostprocessorValueByName (const PostprocessorName &name) const
 
void checkParam (const std::string &param_name, const unsigned int index=std::numeric_limits< unsigned int >::max()) const
 
bool postprocessorsAdded () const
 
const VectorPostprocessorValue & getVectorPostprocessorByNameHelper (const VectorPostprocessorName &name, const std::string &vector_name, bool broadcast, std::size_t t_index) const
 
const VectorPostprocessorContext< VectorPostprocessorValue > & getVectorPostprocessorContextByNameHelper (const VectorPostprocessorName &name, const std::string &vector_name) const
 
bool vectorPostprocessorsAdded () const
 
bool reportersAdded () const
 
void possiblyCheckHasReporter (const ReporterName &reporter_name, const std::string &param_name="") const
 
RestartableDataValue & registerRestartableDataOnApp (std::unique_ptr< RestartableDataValue > data, THREAD_ID tid) const
 
void registerRestartableNameWithFilterOnApp (const std::string &name, Moose::RESTARTABLE_FILTER filter)
 
RestartableData< T > & declareRestartableDataHelper (const std::string &data_name, void *context, Args &&... args) 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 VariableValue * getDefaultValue (const std::string &var_name) const
 
const ADVariableValue * getADDefaultValue (const std::string &var_name) const
 
void checkVar (const std::string &var_name) const
 
void validateExecutionerType (const std::string &name, const std::string &fn_name) const
 
Moose::Kokkos::Variable kokkosCoupledVectorTagScalarVariable (const std::string &var_name, const std::string &tag_name, unsigned int comp) const
 
Moose::MaterialDataType getMaterialDataType (const std::set< BoundaryID > &boundary_ids) const
 
unsigned int getMaxQps () const
 
void addConsumedPropertyName (const MooseObjectName &obj_name, const std::string &prop_name)
 
const PostprocessorValue & getPostprocessorValueInternal (const std::string &param_name, unsigned int index, std::size_t t_index) const
 
const PostprocessorValue & getPostprocessorValueInternal (const std::string &param_name, unsigned int index, std::size_t t_index) const
 
const PostprocessorValue & getPostprocessorValueByNameInternal (const PostprocessorName &name, std::size_t t_index) const
 
const PostprocessorValue & getPostprocessorValueByNameInternal (const PostprocessorName &name, std::size_t t_index) const
 
void possiblyCheckHasVectorPostprocessor (const std::string &param_name, const std::string &vector_name) const
 
void possiblyCheckHasVectorPostprocessor (const std::string &param_name, const std::string &vector_name) const
 
void possiblyCheckHasVectorPostprocessorByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
void possiblyCheckHasVectorPostprocessorByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const Moose::Functor< T > * defaultFunctor (const std::string &name)
 
const Moose::Functor< Real > * defaultFunctor (const std::string &name)
 
const Moose::Functor< ADReal > * defaultFunctor (const std::string &name)
 
const Moose::Functor< T > & getFunctorByName (const std::string &name, SubProblem &subproblem, THREAD_ID tid)
 
virtual bool isADObject () const override
 

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

std::vector< const FaceInfo * > _flow_face_info
 The subset of the FaceInfo objects that actually cover the subdomains which the flow field is defined on.
 
UserObject * _primary_thread_copy
 
std::set< std::string > _supplied_uo
 
const ParallelParamObject & _parent
 
const MooseBase & _si_moose_base
 
const FEProblemBase * _si_problem
 
ExecFlagEnum _empty_execute_enum
 
const MooseObject & _fni_object
 
const InputParameters & _fni_params
 
FEProblemBase & _fni_feproblem
 
const THREAD_ID _fni_tid
 
const MooseObject & _uoi_moose_object
 
const FEProblemBase & _uoi_feproblem
 
const THREAD_ID _uoi_tid
 
const MooseObject & _ppi_moose_object
 
const InputParameters & _ppi_params
 
const FEProblemBase & _ppi_feproblem
 
std::map< PostprocessorName, std::unique_ptr< PostprocessorValue > > _default_values
 
const bool _broadcast_by_default
 
const MooseObject & _vpi_moose_object
 
const FEProblemBase & _vpi_feproblem
 
const THREAD_ID _vpi_tid
 
const InputParameters & _ri_params
 
FEProblemBase & _ri_fe_problem_base
 
const ReporterData & _ri_reporter_data
 
const MooseObject & _ri_moose_object
 
const InputParameters & _dni_params
 
FEProblemBase & _dni_feproblem
 
const MooseObject *const _dni_moose_object_ptr
 
const InputParameters & _si_params
 
FEProblemBase & _si_feproblem
 
THREAD_ID _si_tid
 
const RestartableDataMapName _metaname
 
std::string _restartable_name
 
MooseApp & _meta_data_app
 
const MooseObject *const _meta_data_object
 
const InputParameters & _sc_parameters
 
const std::string & _sc_name
 
const bool _sc_is_implicit
 
std::unordered_map< std::string, std::vector< MooseVariableScalar * > > _coupled_scalar_vars
 
std::unordered_map< std::string, std::unique_ptr< VariableValue > > _default_value
 
std::unordered_map< std::string, std::unique_ptr< ADVariableValue > > _dual_default_value
 
std::vector< MooseVariableScalar * > _coupled_moose_scalar_vars
 
std::unordered_map< std::string, std::vector< MooseVariableFieldBase * > > _sc_coupled_vars
 
std::set< TagID > _sc_coupleable_vector_tags
 
std::set< TagID > _sc_coupleable_matrix_tags
 
const MooseObject & _mi_moose_object
 
const bool _mi_boundary_restricted
 
const std::set< SubdomainID > & _mi_block_ids
 
const std::set< BoundaryID > & _mi_boundary_ids
 
std::vector< std::unique_ptr< OptionalMaterialPropertyProxyBase< MaterialPropertyInterface > > > _optional_property_proxies
 
const std::string _ti_name
 
std::set< SubdomainID > _blk_ids
 
std::vector< SubdomainID > _vec_ids
 
std::vector< SubdomainName > _blocks
 
const bool _blk_dual_restrictable
 
FEProblemBase * _blk_feproblem
 
const MooseMesh * _blk_mesh
 
const std::set< BoundaryID > _empty_boundary_ids
 
const std::set< BoundaryID > & _boundary_ids
 
THREAD_ID _blk_tid
 
const std::string & _blk_name
 
unsigned int _blk_dim
 
const MooseObject * _moose_object
 
Moose::Kokkos::Array< ContiguousElementID > _kokkos_element_ids
 
Moose::Kokkos::Array< ContiguousNodeID > _kokkos_node_ids
 
Moose::Kokkos::Array< Moose::Kokkos::Pair< ContiguousElementID, unsigned int > > _kokkos_element_side_ids
 
const InputParameters & _fi_params
 
const std::string _fi_name
 
SubProblem *const _fi_subproblem
 
const THREAD_ID _fi_tid
 
std::vector< std::unique_ptr< Moose::Functor< Real > > > _default_real_functors
 
std::vector< std::unique_ptr< Moose::Functor< ADReal > > > _default_ad_real_functors
 

Detailed Description

User object responsible for determining the face fluxes using the Rhie-Chow interpolation in a segregated solver that uses the linear FV formulation.

Definition at line 37 of file RhieChowMassFlux.h.

Constructor & Destructor Documentation

◆ RhieChowMassFlux()

RhieChowMassFlux::RhieChowMassFlux ( const InputParameters &  params)

Definition at line 78 of file RhieChowMassFlux.C.

84 _p(dynamic_cast<MooseLinearVariableFVReal *>(
85 &UserObject::_subproblem.getVariable(0, getParam<VariableName>(NS::pressure)))),
86 _vel(_dim, nullptr),
87 _HbyA_flux(_moose_mesh, blockIDs(), "HbyA_flux"),
88 _Ainv(_moose_mesh, blockIDs(), "Ainv"),
90 declareRestartableData<FaceCenteredMapFunctor<Real, std::unordered_map<dof_id_type, Real>>>(
91 "face_flux", _moose_mesh, blockIDs(), "face_values")),
92 _rho(getFunctor<Real>(NS::density)),
93 _pressure_system(nullptr),
97 _pressure_projection_method(getParam<MooseEnum>("pressure_projection_method")),
98 _pressure_diffusion_interp_method(getParam<MooseEnum>("pressure_diffusion_interpolation") ==
99 "harmonic"
100 ? Moose::FV::InterpMethod::HarmonicAverage
101 : Moose::FV::InterpMethod::Average)
102{
103 if (!_p)
104 paramError(NS::pressure, "the pressure must be a MooseLinearVariableFVReal.");
105 checkBlocks(*_p);
106
107 std::vector<std::string> vel_names = {"u", "v", "w"};
108 for (const auto i : index_range(_vel))
109 {
110 _vel[i] = dynamic_cast<MooseLinearVariableFVReal *>(
111 &UserObject::_subproblem.getVariable(0, getParam<VariableName>(vel_names[i])));
112
113 if (!_vel[i])
114 paramError(vel_names[i], "the velocity must be a MOOSELinearVariableFVReal.");
115 checkBlocks(*_vel[i]);
116 }
117
118 // Register the elemental/face functors which will be queried in the pressure equation
119 for (const auto tid : make_range(UserObject::_subproblem.numThreads()))
120 {
123 }
124
125 if (!dynamic_cast<SIMPLE *>(getMooseApp().getExecutioner()) &&
126 !dynamic_cast<PIMPLE *>(getMooseApp().getExecutioner()))
127 mooseError(this->name(),
128 " should only be used with a linear segregated thermal-hydraulics solver!");
129}
unsigned int blocksMaxDimension() const
virtual const std::set< SubdomainID > & blockIDs() const
A functor whose evaluation relies on querying a map where the keys are face info ids and the values c...
const std::string & name() const
void paramError(const std::string &param, Args... args) const
void mooseError(Args &&... args) const
MooseApp & getMooseApp() const
MeshBase & getMesh()
Executioner set up to solve a transient thermal-hydraulics problem using the PIMPLE algorithm.
Definition PIMPLE.h:21
T & declareRestartableData(const std::string &data_name, Args &&... args)
const MooseMesh & _moose_mesh
The MooseMesh that this user object operates on.
const Moose::FV::InterpMethod _pressure_diffusion_interp_method
Interpolation method used for the pressure diffusion coefficient on faces.
const LinearFVGradientReader * _pressure_gradient_field
Registered pressure gradient field used by Rhie-Chow and compatible momentum pressure kernels.
const libMesh::MeshBase & _mesh
The libMesh mesh that this object acts on.
unsigned int _global_pressure_system_number
Global number of the pressure system.
const MooseLinearVariableFVReal *const _p
The thread 0 copy of the pressure variable.
std::vector< MooseLinearVariableFVReal * > _vel
Thread 0 copies of the velocity variables; non-const to allow writing cell velocities in updateCellVe...
LinearSystem * _pressure_system
Pointer to the pressure system.
void checkBlocks(const VarType &var) const
Check the block consistency between the passed in var and us.
const Moose::Functor< Real > & _rho
Functor describing the density of the fluid.
FaceCenteredMapFunctor< RealVectorValue, std::unordered_map< dof_id_type, RealVectorValue > > _Ainv
A map functor from faces to $(1/A)_f$.
const LinearFVGradientReader * _base_pressure_gradient_field
Base pressure gradient field used to seed reconstructed gradient updates.
const unsigned int _dim
The dimension of the mesh, e.g. 3 for hexes and tets, 2 for quads and tris.
FaceCenteredMapFunctor< Real, std::unordered_map< dof_id_type, Real > > & _face_mass_flux
A map functor from faces to mass fluxes which are used in the advection terms.
FaceCenteredMapFunctor< Real, std::unordered_map< dof_id_type, Real > > _HbyA_flux
A map functor from faces to $HbyA_{ij} = (A_{offdiag}*\mathrm{(predicted~velocity)} - \mathrm{Source}...
const MooseEnum _pressure_projection_method
Enumerator for the method used for pressure projection.
Executioner set up to solve a thermal-hydraulics problem using the SIMPLE algorithm.
Definition SIMPLE.h:20
virtual const MooseVariableFieldBase & getVariable(const THREAD_ID tid, const std::string &var_name, Moose::VarKindType expected_var_type=Moose::VarKindType::VAR_ANY, Moose::VarFieldType expected_var_field_type=Moose::VarFieldType::VAR_FIELD_ANY) const=0
void addFunctor(const std::string &name, const Moose::FunctorBase< T > &functor, const THREAD_ID tid)
SubProblem & _subproblem
MeshBase & mesh
static const std::string density
Definition NS.h:34
static const std::string pressure
Definition NS.h:57
auto index_range(const T &sizable)
IntRange< T > make_range(T beg, T end)

Member Function Documentation

◆ AinvComponents()

const std::vector< std::unique_ptr< NumericVector< Number > > > & RhieChowMassFlux::AinvComponents ( ) const

Get the momentum-layout 1/A component vectors.

Definition at line 718 of file RhieChowMassFlux.C.

719{
720 mooseAssert(!_Ainv_raw.empty(), "Ainv data is not ready.");
721
722 return _Ainv_raw;
723}
std::vector< std::unique_ptr< NumericVector< Number > > > _Ainv_raw
We hold on to the cell-based 1/A vectors so that we can easily reconstruct the cell velocities as wel...

Referenced by TestRhieChowMassFluxSequence::execute(), and FVReconstructedPressureGradient::reconstructPressureGradient().

◆ basePressureGradientComponents()

const std::vector< NumericVector< Number > * > & RhieChowMassFlux::basePressureGradientComponents ( ) const

Get the base-pressure gradient component vectors used to seed reconstructed updates.

Definition at line 726 of file RhieChowMassFlux.C.

727{
729}
const GradientContainer & components() const
const LinearFVGradientReader & basePressureGradientField() const
Get the base pressure gradient field used to seed reconstructed gradient updates.

Referenced by FVReconstructedPressureGradient::computeCandidateFromCorrectedFlux(), and finalizePressureCorrector().

◆ basePressureGradientField()

const LinearFVGradientReader & RhieChowMassFlux::basePressureGradientField ( ) const

Get the base pressure gradient field used to seed reconstructed gradient updates.

Definition at line 699 of file RhieChowMassFlux.C.

700{
702 mooseError("The base pressure gradient field has not been registered for RhieChowMassFlux '",
703 name(),
704 "'.");
705
707}

Referenced by basePressureGradientComponents().

◆ checkBlocks()

template<typename VarType >
void RhieChowMassFlux::checkBlocks ( const VarType &  var) const
protected

Check the block consistency between the passed in var and us.

Definition at line 313 of file RhieChowMassFlux.h.

314{
315 const auto & var_blocks = var.blockIDs();
316 const auto & uo_blocks = blockIDs();
317
318 // Error if this UO has any blocks that the variable does not
319 std::set<SubdomainID> uo_blocks_minus_var_blocks;
320 std::set_difference(uo_blocks.begin(),
321 uo_blocks.end(),
322 var_blocks.begin(),
323 var_blocks.end(),
324 std::inserter(uo_blocks_minus_var_blocks, uo_blocks_minus_var_blocks.end()));
325 if (uo_blocks_minus_var_blocks.size() > 0)
326 mooseError("Block restriction of interpolator user object '",
327 this->name(),
328 "' (",
330 ") includes blocks not in the block restriction of variable '",
331 var.name(),
332 "' (",
333 Moose::stringify(var.blocks()),
334 ")");
335
336 // Get the blocks in the variable but not this UO
337 std::set<SubdomainID> var_blocks_minus_uo_blocks;
338 std::set_difference(var_blocks.begin(),
339 var_blocks.end(),
340 uo_blocks.begin(),
341 uo_blocks.end(),
342 std::inserter(var_blocks_minus_uo_blocks, var_blocks_minus_uo_blocks.end()));
343
344 // For each block in the variable but not this UO, error if there is connection
345 // to any blocks on the UO.
346 for (auto & block_id : var_blocks_minus_uo_blocks)
347 {
348 const auto connected_blocks = _moose_mesh.getBlockConnectedBlocks(block_id);
349 std::set<SubdomainID> connected_blocks_on_uo;
350 std::set_intersection(connected_blocks.begin(),
351 connected_blocks.end(),
352 uo_blocks.begin(),
353 uo_blocks.end(),
354 std::inserter(connected_blocks_on_uo, connected_blocks_on_uo.end()));
355 if (connected_blocks_on_uo.size() > 0)
356 mooseError("Block restriction of interpolator user object '",
357 this->name(),
358 "' (",
359 Moose::stringify(uo_blocks),
360 ") doesn't match the block restriction of variable '",
361 var.name(),
362 "' (",
363 Moose::stringify(var_blocks),
364 ")");
365 }
366}
const std::vector< SubdomainName > & blocks() const
const std::set< SubdomainID > & getBlockConnectedBlocks(const SubdomainID subdomain_id) const
std::string stringify(const T &t)

Referenced by RhieChowMassFlux().

◆ checkReconstructedPressureGradientCompatibility()

void RhieChowMassFlux::checkReconstructedPressureGradientCompatibility ( ) const
protected

Check the single-variable system layout assumed by reconstructed pressure-gradient vector ops.

Definition at line 1185 of file RhieChowMassFlux.C.

1186{
1189 mooseError("RhieChowMassFlux '",
1190 name(),
1191 "' is missing a required pressure system, pressure-gradient field, base-gradient "
1192 "field, or pressure-correction diffusion kernel for reconstructed pressure "
1193 "gradients.");
1194
1196
1197 if (_momentum_systems.size() != _dim || _momentum_implicit_systems.size() != _dim ||
1199 mooseError("RhieChowMassFlux '",
1200 name(),
1201 "' requires one linked momentum system per spatial component for reconstructed "
1202 "pressure gradients.");
1203
1204 if (_pressure_system->nVariables() != 1)
1205 mooseError(
1206 "FVReconstructedPressureGradient assumes the pressure and momentum systems each have "
1207 "exactly one variable so their DOF indices can be used in vector operations. Pressure "
1208 "system '",
1210 "' has variables: ",
1212
1213 for (const auto system_i : index_range(_momentum_systems))
1214 {
1215 const auto * const momentum_system = _momentum_systems[system_i];
1216 if (!momentum_system || !_momentum_implicit_systems[system_i])
1217 mooseError("RhieChowMassFlux '",
1218 name(),
1219 "' has an invalid momentum-system layout for component ",
1220 system_i,
1221 ".");
1222
1223 if (momentum_system->nVariables() != 1)
1224 mooseError("FVReconstructedPressureGradient assumes the pressure and momentum systems each "
1225 "have exactly one variable so their DOF indices can be used in vector operations. "
1226 "Momentum system '",
1227 momentum_system->name(),
1228 "' has variables: ",
1229 Moose::stringify(momentum_system->getVariableNames()));
1230 }
1231}
void validateSetup(const RhieChowMassFlux &rc) const
Validate the one-time Rhie-Chow linkage and field layouts required by reconstruction.
LinearFVPressureCorrectionDiffusion * _p_diffusion_kernel
Pointer to the pressure diffusion term in the pressure Poisson equation.
std::vector< LinearSystem * > _momentum_systems
Pointers to the linear system(s) in moose corresponding to the momentum equation(s)
FVReconstructedPressureGradient & reconstructedGradientMethod()
Access the reconstructed gradient method when it is selected.
std::vector< libMesh::LinearImplicitSystem * > _momentum_implicit_systems
Pointers to the momentum equation implicit system(s) from libmesh.
std::vector< unsigned int > _global_momentum_system_numbers
Global numbers of the momentum system(s)
virtual unsigned int nVariables() const
const std::vector< VariableName > & getVariableNames() const
virtual const std::string & name() const

Referenced by linkMomentumPressureSystems().

◆ computeFaceMassFlux()

void RhieChowMassFlux::computeFaceMassFlux ( )

Update the values of the face velocities in the containers.

Definition at line 755 of file RhieChowMassFlux.C.

756{
757 using namespace Moose::FV;
758
759 const auto time_arg = Moose::currentState();
760
761 // Petsc vector reader to make the repeated reading from the vector faster
762 PetscVectorReader p_reader(*_pressure_system->system().current_local_solution);
763
764 // We loop through the faces and compute the face fluxes using the pressure gradient
765 // and the momentum matrix/right hand side
766 for (auto & fi : _flow_face_info)
767 {
768 // Making sure the kernel knows which face we are on
770
771 // We are setting this to 1.0 because we don't want to multiply the kernel contributions
772 // with the surface area yet. The surface area will be factored in in the advection kernels.
774
775 Real p_grad_flux = 0.0;
776 if (_p->isInternalFace(*fi))
777 {
778 const auto & elem_info = *fi->elemInfo();
779 const auto & neighbor_info = *fi->neighborInfo();
780
781 // Fetching the dof indices for the pressure variable
782 const auto elem_dof = elem_info.dofIndices()[_global_pressure_system_number][0];
783 const auto neighbor_dof = neighbor_info.dofIndices()[_global_pressure_system_number][0];
784
785 // Fetching the values of the pressure for the element and the neighbor
786 const auto p_elem_value = p_reader(elem_dof);
787 const auto p_neighbor_value = p_reader(neighbor_dof);
788
789 // Compute the elem matrix contributions for the face
790 const auto elem_matrix_contribution = _p_diffusion_kernel->computeElemMatrixContribution();
791 const auto neighbor_matrix_contribution =
793 const auto elem_rhs_contribution =
795
796 // Compute the face flux from the matrix and right hand side contributions
797 p_grad_flux = (p_neighbor_value * neighbor_matrix_contribution +
798 p_elem_value * elem_matrix_contribution) -
799 elem_rhs_contribution;
800 }
801 else if (auto * bc_pointer = _p->getBoundaryCondition(*fi->boundaryIDs().begin()))
802 {
803 mooseAssert(fi->boundaryIDs().size() == 1, "We should only have one boundary on every face.");
804
805 bc_pointer->setupFaceData(
806 fi, fi->faceType(std::make_pair(_p->number(), _global_pressure_system_number)));
807
808 const ElemInfo & elem_info =
809 hasBlocks(fi->elemPtr()->subdomain_id()) ? *fi->elemInfo() : *fi->neighborInfo();
810 const auto p_elem_value = _p->getElemValue(elem_info, time_arg);
811 const auto matrix_contribution =
813 const auto rhs_contribution =
815
816 // On the boundary, only the element side has a contribution
817 p_grad_flux = (p_elem_value * matrix_contribution - rhs_contribution);
818 }
819 // Compute the new face flux
820 _face_mass_flux[fi->id()] = -_HbyA_flux[fi->id()] + p_grad_flux;
821 }
822
824}
bool hasBlocks(const SubdomainName &name) const
virtual Real computeBoundaryRHSContribution(const LinearFVBoundaryCondition &bc) override
virtual Real computeElemMatrixContribution() override
virtual Real computeNeighborMatrixContribution() override
virtual Real computeElemRightHandSideContribution() override
virtual Real computeBoundaryMatrixContribution(const LinearFVBoundaryCondition &bc) override
virtual void setupFaceData(const FaceInfo *face_info)
void setCurrentFaceArea(const Real area)
virtual System & system() override
Real getElemValue(const ElemInfo &elem_info, const StateArg &state) const
LinearFVBoundaryCondition * getBoundaryCondition(const BoundaryID bd_id) const
unsigned int number() const
bool isInternalFace(const FaceInfo &) const
dof_id_type _face_mass_flux_generation
Producer counter for the conservative face mass flux: incremented every time computeFaceMassFlux() ru...
std::vector< const FaceInfo * > _flow_face_info
The subset of the FaceInfo objects that actually cover the subdomains which the flow field is defined...
StateArg currentState()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

Referenced by LinearAssemblySegregatedSolve::correctVelocity(), and TestRhieChowMassFluxSequence::execute().

◆ computeHbyA()

void RhieChowMassFlux::computeHbyA ( const bool  verbose)

Computes the inverse of the diagonal (1/A) of the system matrix plus the H/A components for the pressure equation plus Rhie-Chow interpolation.

Definition at line 952 of file RhieChowMassFlux.C.

953{
954 if (verbose)
955 {
956 _console << "************************************" << std::endl;
957 _console << "Computing HbyA" << std::endl;
958 _console << "************************************" << std::endl;
959 }
961 "The momentum system shall be linked before calling this function!");
962
963 mooseAssert(!_grad_p_current.empty(),
964 "A coupling pressure-gradient snapshot must exist before computing H/A.");
965 mooseAssert(_grad_p_current.size() == _momentum_implicit_systems.size(),
966 "The coupling pressure-gradient snapshot must have one component per momentum "
967 "system.");
968
969#ifndef NDEBUG
970 for (const auto system_i : index_range(_momentum_implicit_systems))
971 {
972 const auto & snapshot = *_grad_p_current[system_i];
973 const auto & momentum_layout = *_momentum_implicit_systems[system_i]->current_local_solution;
974 mooseAssert(snapshot.size() == momentum_layout.size() &&
975 snapshot.local_size() == momentum_layout.local_size() &&
976 snapshot.first_local_index() == momentum_layout.first_local_index() &&
977 snapshot.last_local_index() == momentum_layout.last_local_index(),
978 "The coupling pressure-gradient snapshot layout must match its momentum system.");
979 }
980#endif
981
982 const auto & coupling_pressure_gradient = _grad_p_current;
983
984 _HbyA_raw.clear();
985 _Ainv_raw.clear();
986
987 for (auto system_i : index_range(_momentum_systems))
988 {
989 LinearImplicitSystem * momentum_system = _momentum_implicit_systems[system_i];
990
991 NumericVector<Number> & rhs = *(momentum_system->rhs);
992 NumericVector<Number> & current_local_solution = *(momentum_system->current_local_solution);
993 NumericVector<Number> & solution = *(momentum_system->solution);
994 PetscMatrix<Number> * mmat = dynamic_cast<PetscMatrix<Number> *>(momentum_system->matrix);
995 mooseAssert(mmat,
996 "The matrices used in the segregated INSFVRhieChow objects need to be convertable "
997 "to PetscMatrix!");
998
999 if (verbose)
1000 {
1001 _console << "Matrix in rc object" << std::endl;
1002 mmat->print();
1003 }
1004
1005 // First, we extract the diagonal and we will hold on to it for a little while
1006 _Ainv_raw.push_back(current_local_solution.zero_clone());
1007 NumericVector<Number> & Ainv = *(_Ainv_raw.back());
1008
1009 mmat->get_diagonal(Ainv);
1010
1011 if (verbose)
1012 {
1013 _console << "Velocity solution in H(u)" << std::endl;
1014 solution.print();
1015 }
1016
1017 // Time to create H(u) = M_{offdiag} * u - b_{nonpressure}
1018 _HbyA_raw.push_back(current_local_solution.zero_clone());
1019 NumericVector<Number> & HbyA = *(_HbyA_raw.back());
1020
1021 // We start with the matrix product part, we will do
1022 // M*u - A*u for 2 reasons:
1023 // 1, We assume A*u petsc operation is faster than setting the matrix diagonal to 0
1024 // 2, In PISO loops we need to reuse the matrix so we can't just set the diagonals to 0
1025
1026 // We create a working vector to ease some of the operations, we initialize its values
1027 // with the current solution values to have something for the A*u term
1028 auto working_vector = momentum_system->current_local_solution->zero_clone();
1029 PetscVector<Number> * working_vector_petsc =
1030 dynamic_cast<PetscVector<Number> *>(working_vector.get());
1031 mooseAssert(working_vector_petsc,
1032 "The vectors used in the RhieChowMassFlux objects need to be convertable "
1033 "to PetscVectors!");
1034
1035 mmat->vector_mult(HbyA, solution);
1036 working_vector_petsc->pointwise_mult(Ainv, solution);
1037 HbyA.add(-1.0, *working_vector_petsc);
1038
1039 if (verbose)
1040 {
1041 _console << " H(u)" << std::endl;
1042 HbyA.print();
1043 }
1044
1045 // We continue by adding the momentum right hand side contributions
1046 HbyA.add(-1.0, rhs);
1047
1048 // Unfortunately, the pressure forces are included in the momentum RHS
1049 // so we have to correct them back using the same coupling gradient that
1050 // assembled the momentum pressure source.
1051 working_vector_petsc->pointwise_mult(*coupling_pressure_gradient[system_i], *_cell_volumes);
1052 HbyA.add(-1.0, *working_vector_petsc);
1053
1054 if (verbose)
1055 {
1056 _console << "total RHS" << std::endl;
1057 rhs.print();
1058 _console << "pressure RHS" << std::endl;
1059 coupling_pressure_gradient[system_i]->print();
1060 _console << " H(u)-rhs-relaxation_source" << std::endl;
1061 HbyA.print();
1062 }
1063
1064 // It is time to create element-wise 1/A-s based on the the diagonal of the momentum matrix
1065 *working_vector_petsc = 1.0;
1066 Ainv.pointwise_divide(*working_vector_petsc, Ainv);
1067
1068 // Create 1/A*(H(u)-RHS)
1069 HbyA.pointwise_mult(HbyA, Ainv);
1070
1071 if (verbose)
1072 {
1073 _console << " (H(u)-rhs)/A" << std::endl;
1074 HbyA.print();
1075 }
1076
1077 if (_pressure_projection_method == "consistent")
1078 {
1079
1080 // Consistent Corrections to SIMPLE
1081 // 1. Ainv_old = 1/a_p <- Ainv = 1/(a_p + \sum_n a_n)
1082 // 2. H(u) <- H(u*) + H(u') = H(u*) - (Ainv - Ainv_old) * grad(p) * Vc
1083
1084 if (verbose)
1085 _console << "Performing SIMPLEC projection." << std::endl;
1086
1087 // Lambda function to calculate the sum of diagonal and neighbor coefficients
1088 auto get_row_sum = [mmat](NumericVector<Number> & sum_vector)
1089 {
1090 // Ensure the sum_vector is zeroed out
1091 sum_vector.zero();
1092
1093 // Local row size
1094 const auto local_size = mmat->local_m();
1095
1096 for (const auto row_i : make_range(local_size))
1097 {
1098 // Get all non-zero components of the row of the matrix
1099 const auto global_index = mmat->row_start() + row_i;
1100 std::vector<numeric_index_type> indices;
1101 std::vector<Real> values;
1102 mmat->get_row(global_index, indices, values);
1103
1104 // Sum row elements (no absolute values)
1105 const Real row_sum = std::accumulate(values.cbegin(), values.cend(), 0.0);
1106
1107 // Add the sum of diagonal and elements to the sum_vector
1108 sum_vector.add(global_index, row_sum);
1109 }
1110 sum_vector.close();
1111 };
1112
1113 // Create a temporary vector to store the sum of diagonal and neighbor coefficients
1114 auto row_sum = current_local_solution.zero_clone();
1115 get_row_sum(*row_sum);
1116
1117 // Create vector with new inverse projection matrix
1118 auto Ainv_full = current_local_solution.zero_clone();
1119 *working_vector_petsc = 1.0;
1120 Ainv_full->pointwise_divide(*working_vector_petsc, *row_sum);
1121 const auto Ainv_full_old = Ainv_full->clone();
1122
1123 // Correct HbyA
1124 Ainv_full->add(-1.0, Ainv);
1125 working_vector_petsc->pointwise_mult(*Ainv_full, *coupling_pressure_gradient[system_i]);
1126 working_vector_petsc->pointwise_mult(*working_vector_petsc, *_cell_volumes);
1127 HbyA.add(-1.0, *working_vector_petsc);
1128
1129 // Correct Ainv
1130 Ainv = *Ainv_full_old;
1131 }
1132
1133 Ainv.pointwise_mult(Ainv, *_cell_volumes);
1134
1135 if (verbose)
1136 {
1137 _console << " 1/A" << std::endl;
1138 Ainv.print();
1139 }
1140 }
1141
1142 // We fill the 1/A and H/A functors
1144
1145 if (verbose)
1146 {
1147 _console << "************************************" << std::endl;
1148 _console << "DONE Computing HbyA " << std::endl;
1149 _console << "************************************" << std::endl;
1150 }
1151}
std::array< Real, 2 > values
const ConsoleStream _console
std::vector< std::unique_ptr< NumericVector< Number > > > _grad_p_current
Coupling pressure gradient captured before the current momentum predictor is assembled.
std::unique_ptr< NumericVector< Number > > _cell_volumes
We will hold a vector of cell volumes to make sure we can do volume corrections rapidly.
void populateCouplingFunctors(const std::vector< std::unique_ptr< NumericVector< Number > > > &raw_hbya, const std::vector< std::unique_ptr< NumericVector< Number > > > &raw_Ainv)
Populate the face values of the H/A and 1/A fields.
std::vector< std::unique_ptr< NumericVector< Number > > > _HbyA_raw
We hold on to the cell-based HbyA vectors so that we can easily reconstruct the cell velocities as we...

Referenced by LinearAssemblySegregatedSolve::correctVelocity().

◆ dimension()

unsigned int RhieChowMassFlux::dimension ( ) const
inline

◆ execute()

virtual void RhieChowMassFlux::execute ( )
inlineoverridevirtual

Implements GeneralUserObject.

Definition at line 143 of file RhieChowMassFlux.h.

143{}

◆ faceMassFluxGeneration()

dof_id_type RhieChowMassFlux::faceMassFluxGeneration ( ) const
inline

Producer counter for the conservative face mass flux: incremented every time computeFaceMassFlux() runs.

Used to verify reconstruction consumes the face flux produced by the current pressure corrector, not one left over from a preceding corrector.

Definition at line 96 of file RhieChowMassFlux.h.

Referenced by FVReconstructedPressureGradient::computeCandidateFromCorrectedFlux().

◆ finalize()

virtual void RhieChowMassFlux::finalize ( )
inlineoverridevirtual

Implements GeneralUserObject.

Definition at line 144 of file RhieChowMassFlux.h.

144{}

◆ finalizeMomentumPredictor()

void RhieChowMassFlux::finalizeMomentumPredictor ( )

Capture the lagged velocity gradients computed while assembling the momentum predictor.

Definition at line 412 of file RhieChowMassFlux.C.

413{
416}
void saveLaggedVelocityGradient(RhieChowMassFlux &rc)
Save the lagged cell velocity gradient used by the reconstruction.
bool usingReconstructedPressureGradientMethod() const
Whether the registered pressure gradient field is produced by the reconstructed method.

Referenced by LinearAssemblySegregatedSolve::solveMomentumPredictor().

◆ finalizePressureCorrector()

void RhieChowMassFlux::finalizePressureCorrector ( )

After pressure relaxation, refresh every registered pressure gradient and publish relaxed reconstructed feedback for the next momentum predictor.

Ordinary methods also update the cell velocity here, preserving their existing relaxed-pressure behavior.

Definition at line 445 of file RhieChowMassFlux.C.

446{
448 {
449 // Refresh every ordinary pressure gradient while leaving the old coupling field untouched
450 // until the current reconstructed candidate has been relaxed into it.
455 }
456 else
457 {
460 }
461}
void finalizeCouplingPressureGradient(const RhieChowMassFlux &rc, const GradientView &base_gradient)
Relax and publish the current candidate as the coupling pressure gradient.
void computeGradientsExcept(const LinearFVGradientReader &excluded_reader)
void updateFVGradient(const LinearFVGradientReader &reader)
void computeGradients()
void updateCellVelocity(const std::vector< GradientComponent > &pressure_gradient)
Update cell velocity from the supplied momentum-coupling pressure gradient.
const std::vector< NumericVector< Number > * > & pressureGradientComponents() const
Get the registered pressure gradient component vectors.
const std::vector< NumericVector< Number > * > & basePressureGradientComponents() const
Get the base-pressure gradient component vectors used to seed reconstructed updates.
const LinearFVGradientReader & pressureGradientField() const
Get the registered pressure gradient field used by compatible momentum pressure kernels.

Referenced by LinearAssemblySegregatedSolve::correctVelocity().

◆ getMassFlux()

Real RhieChowMassFlux::getMassFlux ( const FaceInfo &  fi) const

Get the face velocity times density (used in advection terms)

Definition at line 615 of file RhieChowMassFlux.C.

616{
617 return _face_mass_flux.evaluate(&fi);
618}
ValueType evaluate(const FaceInfo *const fi) const
Evaluate the face functor using a FaceInfo argument.

Referenced by LinearFVEnergyAdvection::setupFaceData(), LinearFVTurbulentAdvection::setupFaceData(), LinearWCNSFV2PMomentumDriftFlux::setupFaceData(), and LinearWCNSFVMomentumFlux::setupFaceData().

◆ getVolumetricFaceFlux() [1/2]

Real RhieChowMassFlux::getVolumetricFaceFlux ( const FaceInfo &  fi) const

Get the volumetric face flux (used in advection terms)

Definition at line 621 of file RhieChowMassFlux.C.

622{
623 const std::string neighbor_cell_id =
624 fi.neighborPtr() ? std::to_string(fi.neighborPtr()->id()) : "none";
625 const auto face_flux = _face_mass_flux.find(fi.id());
626 if (face_flux == _face_mass_flux.end())
627 mooseError("RhieChowMassFlux '",
628 name(),
629 "' has no corrected mass flux for face ID ",
630 fi.id(),
631 " adjacent to cell ID ",
632 fi.elem().id(),
633 " and neighbor cell ID ",
634 neighbor_cell_id,
635 ".");
636
637 if (!std::isfinite(face_flux->second))
638 mooseError("RhieChowMassFlux '",
639 name(),
640 "' has non-finite corrected mass flux ",
641 face_flux->second,
642 " on face ID ",
643 fi.id(),
644 " adjacent to cell ID ",
645 fi.elem().id(),
646 " and neighbor cell ID ",
647 neighbor_cell_id,
648 ".");
649
650 const Moose::FaceArg face_arg{&fi,
651 /*limiter_type=*/Moose::FV::LimiterType::CentralDifference,
652 /*elem_is_upwind=*/true,
653 /*correct_skewness=*/false,
654 &fi.elem(),
655 /*state_limiter*/ nullptr};
656 const Real face_rho = _rho(face_arg, Moose::currentState());
657 if (!std::isfinite(face_rho) || face_rho <= 0.0)
658 mooseError("RhieChowMassFlux '",
659 name(),
660 "' requires finite, positive density for corrected face flux reconstruction, but "
661 "density is ",
662 face_rho,
663 " on face ID ",
664 fi.id(),
665 " adjacent to cell ID ",
666 fi.elem().id(),
667 " and neighbor cell ID ",
668 neighbor_cell_id,
669 ".");
670
671 const Real volumetric_flux = face_flux->second / face_rho;
672 if (!std::isfinite(volumetric_flux))
673 mooseError("RhieChowMassFlux '",
674 name(),
675 "' computed non-finite volumetric flux ",
676 volumetric_flux,
677 " on face ID ",
678 fi.id(),
679 " adjacent to cell ID ",
680 fi.elem().id(),
681 " and neighbor cell ID ",
682 neighbor_cell_id,
683 ".");
684
685 return volumetric_flux;
686}
const Elem & elem() const
const Elem * neighborPtr() const
dof_id_type id() const

Referenced by FVReconstructedPressureGradient::assembleFaceProjection(), and LinearFVScalarAdvection::setupFaceData().

◆ getVolumetricFaceFlux() [2/2]

virtual Real RhieChowMassFlux::getVolumetricFaceFlux ( const Moose::FV::InterpMethod  m,
const FaceInfo &  fi,
const Moose::StateArg &  time,
const THREAD_ID  tid,
bool  subtract_mesh_velocity 
) const
overridevirtual

Retrieve the volumetric face flux, will not include derivatives.

Parameters
mThe velocity interpolation method. This is either Rhie-Chow or Average. Rhie-Chow is recommended as it avoids checkerboards in the pressure field
fiThe face that we wish to retrieve the velocity for
tidThe thread ID
Returns
The face velocity

Implements RhieChowFaceFluxProvider.

◆ hasFaceSide()

bool RhieChowFaceFluxProvider::hasFaceSide ( const FaceInfo &  fi,
const bool  fi_elem_side 
) const
overridevirtualinherited

Implements FaceArgInterface.

Definition at line 27 of file RhieChowFaceFluxProvider.C.

28{
29 if (fi_elem_side)
30 return hasBlocks(fi.elem().subdomain_id());
31 else
32 return fi.neighborPtr() && hasBlocks(fi.neighbor().subdomain_id());
33}
const Elem & neighbor() const

◆ HbyAComponents()

const std::vector< std::unique_ptr< NumericVector< Number > > > & RhieChowMassFlux::HbyAComponents ( ) const

Get the momentum-layout H/A component vectors.

Definition at line 710 of file RhieChowMassFlux.C.

711{
712 mooseAssert(!_HbyA_raw.empty(), "HbyA data is not ready.");
713
714 return _HbyA_raw;
715}

Referenced by FVReconstructedPressureGradient::reconstructPressureGradient().

◆ initCouplingField()

void RhieChowMassFlux::initCouplingField ( )

Initialize the coupling fields (HbyA and Ainv)

Definition at line 827 of file RhieChowMassFlux.C.

828{
829 // We loop through the faces and populate the coupling fields (face H/A and 1/H)
830 // with 0s for now. Pressure corrector solves will always come after the
831 // momentum source so we expect these fields to change before the actual solve.
832 for (auto & fi : _fe_problem.mesh().faceInfo())
833 {
834 _Ainv[fi->id()];
835 _HbyA_flux[fi->id()];
836 }
837}
FEProblemBase & _fe_problem

Referenced by LinearAssemblySegregatedSolve::linkRhieChowUserObject().

◆ initFaceMassFlux()

void RhieChowMassFlux::initFaceMassFlux ( )

Initialize the container for face velocities.

Definition at line 564 of file RhieChowMassFlux.C.

565{
566 using namespace Moose::FV;
567
568 const auto time_arg = Moose::currentState();
569
570 // We loop through the faces and compute the resulting face fluxes from the
571 // initial conditions for velocity
572 for (auto & fi : _flow_face_info)
573 {
574 RealVectorValue density_times_velocity;
575
576 // On internal face we do a regular interpolation with geometric weights
577 if (_vel[0]->isInternalFace(*fi))
578 {
579 const auto & elem_info = *fi->elemInfo();
580 const auto & neighbor_info = *fi->neighborInfo();
581
582 Real elem_rho = _rho(makeElemArg(fi->elemPtr()), time_arg);
583 Real neighbor_rho = _rho(makeElemArg(fi->neighborPtr()), time_arg);
584
585 for (const auto dim_i : index_range(_vel))
586 interpolate(InterpMethod::Average,
587 density_times_velocity(dim_i),
588 _vel[dim_i]->getElemValue(elem_info, time_arg) * elem_rho,
589 _vel[dim_i]->getElemValue(neighbor_info, time_arg) * neighbor_rho,
590 *fi,
591 true);
592 }
593 // On the boundary, we just take the boundary values
594 else
595 {
596 const bool elem_is_fluid = hasBlocks(fi->elemPtr()->subdomain_id());
597 const Elem * const boundary_elem = elem_is_fluid ? fi->elemPtr() : fi->neighborPtr();
598
599 // We need this multiplier in case the face is an internal face and
600 const Real boundary_normal_multiplier = elem_is_fluid ? 1.0 : -1.0;
601 const Moose::FaceArg boundary_face{
602 fi, Moose::FV::LimiterType::CentralDifference, true, false, boundary_elem, nullptr};
603
604 const Real face_rho = _rho(boundary_face, time_arg);
605 for (const auto dim_i : index_range(_vel))
606 density_times_velocity(dim_i) = boundary_normal_multiplier * face_rho *
607 raw_value((*_vel[dim_i])(boundary_face, time_arg));
608 }
609
610 _face_mass_flux[fi->id()] = density_times_velocity * fi->normal();
611 }
612}
Moose::ElemArg makeElemArg(const Elem *elem, bool correct_skewnewss=false) const
auto raw_value(const Eigen::Map< T > &in)
void interpolate(InterpMethod m, T &result, const T2 &value1, const T3 &value2, const FaceInfo &fi, const bool one_is_elem)
VectorValue< Real > RealVectorValue

Referenced by LinearAssemblySegregatedSolve::linkRhieChowUserObject().

◆ initialize()

void RhieChowMassFlux::initialize ( )
overridevirtual

Implements GeneralUserObject.

Definition at line 554 of file RhieChowMassFlux.C.

555{
556 for (const auto & pair : _HbyA_flux)
557 _HbyA_flux[pair.first] = 0;
558
559 for (const auto & pair : _Ainv)
560 _Ainv[pair.first] = 0;
561}

◆ initialSetup()

void RhieChowMassFlux::initialSetup ( )
overridevirtual

Reimplemented from GeneralUserObject.

Definition at line 470 of file RhieChowMassFlux.C.

471{
472 // We fetch the pressure diffusion kernel to ensure that the face flux correction
473 // is consistent with the pressure discretization in the Poisson equation.
474 std::vector<LinearFVFluxKernel *> flux_kernel;
475 auto base_query = _fe_problem.theWarehouse()
476 .query()
477 .template condition<AttribThread>(_tid)
478 .template condition<AttribSysNum>(_p->sys().number())
479 .template condition<AttribSystem>("LinearFVFluxKernel")
480 .template condition<AttribName>(getParam<std::string>("p_diffusion_kernel"))
481 .queryInto(flux_kernel);
482 if (flux_kernel.size() != 1)
484 "p_diffusion_kernel",
485 "The kernel with the given name could not be found or multiple instances were identified.");
486 _p_diffusion_kernel = dynamic_cast<LinearFVPressureCorrectionDiffusion *>(flux_kernel[0]);
488 paramError("p_diffusion_kernel",
489 "The provided diffusion kernel must be of type "
490 "LinearFVPressureCorrectionDiffusion.");
491}
TheWarehouse & theWarehouse() const
Pressure correction diffusion kernel for the linear finite volume SIMPLE algorithm.
SystemBase & sys()
unsigned int number() const
Query query()
const THREAD_ID _tid

◆ initPressureGradient()

void RhieChowMassFlux::initPressureGradient ( )

Compute every registered pressure gradient once, before the first momentum predictor of a SIMPLE iteration sequence has anything to read.

Definition at line 464 of file RhieChowMassFlux.C.

Referenced by TestRhieChowMassFluxSequence::execute(), and LinearAssemblySegregatedSolve::solve().

◆ linkMomentumPressureSystems()

void RhieChowMassFlux::linkMomentumPressureSystems ( const std::vector< LinearSystem * > &  momentum_systems,
LinearSystem &  pressure_system,
const std::vector< unsigned int > &  momentum_system_numbers 
)

Update the momentum system-related information.

Parameters
momentum_systemsPointers to the momentum systems which are solved for the momentum vector components
pressure_systemReference to the pressure system
momentum_system_numbersThe numbers of these systems

Definition at line 132 of file RhieChowMassFlux.C.

136{
137 _momentum_systems = momentum_systems;
138 _momentum_system_numbers = momentum_system_numbers;
139 _pressure_system = &pressure_system;
141
142 auto * const pressure_var =
144 if (!pressure_var)
145 mooseError("The pressure variable in system '",
147 "' must be a MooseLinearVariableFVReal.");
148
149 // For each momentum system, find the LinearFVMomentumPressure kernels applicable to this RC
150 // object, i.e. those whose blocks overlap the blocks this RC object handles. Kernels entirely
151 // outside our blocks are irrelevant and ignored; multiple applicable kernels per system are
152 // allowed as long as they partition our blocks without overlapping (checked below).
153 std::vector<std::vector<const LinearFVMomentumPressure *>> applicable_kernels(
154 momentum_systems.size());
155 for (const auto system_index : index_range(momentum_systems))
156 {
157 std::vector<LinearFVElementalKernel *> kernels;
159 .query()
160 .template condition<AttribThread>(_tid)
161 .template condition<AttribSystem>("LinearFVElementalKernel")
162 .template condition<AttribSysNum>(momentum_system_numbers[system_index])
163 .queryInto(kernels);
164
165 for (const auto * const kernel : kernels)
166 {
167 const auto * const candidate = dynamic_cast<const LinearFVMomentumPressure *>(kernel);
168 if (candidate && MooseUtils::setsIntersect(candidate->blockIDs(), blockIDs()))
169 applicable_kernels[system_index].push_back(candidate);
170 }
171 }
172
173 for (const auto system_index : index_range(momentum_systems))
174 {
175 const auto & kernels = applicable_kernels[system_index];
176 const auto & system_name = momentum_systems[system_index]->name();
177
178 // Coverage: the applicable kernels must together cover every block this RC object handles.
179 std::set<SubdomainID> covered_blocks;
180 for (const auto * const kernel : kernels)
181 covered_blocks.insert(kernel->blockIDs().begin(), kernel->blockIDs().end());
182
183 std::set<SubdomainID> missing_blocks;
184 std::set_difference(blockIDs().begin(),
185 blockIDs().end(),
186 covered_blocks.begin(),
187 covered_blocks.end(),
188 std::inserter(missing_blocks, missing_blocks.end()));
189
190 if (!missing_blocks.empty())
191 mooseError("RhieChowMassFlux '",
192 name(),
193 "' found no applicable LinearFVMomentumPressure kernel for momentum system '",
194 system_name,
195 "' on block(s) ",
196 Moose::stringify(missing_blocks),
197 ".");
198
199 // Component and pairwise block-overlap checks among the applicable kernels for this system.
200 for (const auto i : index_range(kernels))
201 {
202 if (kernels[i]->momentumComponent() != system_index)
203 mooseError("LinearFVMomentumPressure kernel '",
204 kernels[i]->name(),
205 "' declares momentum component ",
206 kernels[i]->momentumComponent(),
207 " but is linked to momentum system '",
208 system_name,
209 "' (component ",
210 system_index,
211 ") through RhieChowMassFlux '",
212 name(),
213 "'.");
214
215 for (const auto j : make_range(i + 1, kernels.size()))
216 {
217 std::set<SubdomainID> overlap;
218 for (const auto block : kernels[i]->blockIDs())
219 if (hasBlocks(block) && kernels[j]->blockIDs().count(block))
220 overlap.insert(block);
221 if (!overlap.empty())
222 mooseError("Momentum system '",
223 system_name,
224 "' has more than one LinearFVMomentumPressure kernel contributing a "
225 "pressure source on the same block(s) for RhieChowMassFlux '",
226 name(),
227 "': '",
228 kernels[i]->name(),
229 "' and '",
230 kernels[j]->name(),
231 "' overlap on block(s) ",
232 Moose::stringify(overlap),
233 ".");
234 }
235 }
236 }
237
238 // Flatten every system's applicable kernels into one list spanning the whole RC object. Even
239 // kernels on disjoint blocks/components must share one coupling-gradient field, because H/A
240 // has a single field source for this RC object.
241 std::vector<const LinearFVMomentumPressure *> momentum_pressure_kernels;
242 for (auto & kernels : applicable_kernels)
243 momentum_pressure_kernels.insert(
244 momentum_pressure_kernels.end(), kernels.begin(), kernels.end());
245
246 const auto * const coupling_kernel = momentum_pressure_kernels.front();
247 const auto & coupling_reader = coupling_kernel->pressureGradientField();
248
249 if (dynamic_cast<const FVReconstructedPressureGradient *>(&coupling_reader.method()) &&
250 coupling_kernel->pressureVariableNumber() != _p->number())
251 mooseError("FVReconstructedPressureGradient can only be used for the pressure variable "
252 "registered on RhieChowMassFlux '",
253 name(),
254 "'.");
255
256 for (const auto * const kernel : momentum_pressure_kernels)
257 {
258 const auto & reader = kernel->pressureGradientField();
259
260 if (&reader.system() != &coupling_reader.system() ||
261 reader.systemNumber() != coupling_reader.systemNumber())
262 mooseError("RhieChowMassFlux '",
263 name(),
264 "': momentum pressure kernels '",
265 coupling_kernel->name(),
266 "' (block(s) ",
267 Moose::stringify(coupling_kernel->blockIDs()),
268 ") and '",
269 kernel->name(),
270 "' (block(s) ",
271 Moose::stringify(kernel->blockIDs()),
272 ") must use pressure gradients from the same system.");
273
274 if (reader.variableNumber() != coupling_reader.variableNumber())
275 mooseError("RhieChowMassFlux '",
276 name(),
277 "': momentum pressure kernels '",
278 coupling_kernel->name(),
279 "' (pressure variable number ",
280 coupling_reader.variableNumber(),
281 ") and '",
282 kernel->name(),
283 "' (pressure variable number ",
284 reader.variableNumber(),
285 ") must use the same pressure variable.");
286
287 if (&reader.method() != &coupling_reader.method())
288 mooseError("RhieChowMassFlux '",
289 name(),
290 "': momentum pressure kernels '",
291 coupling_kernel->name(),
292 "' and '",
293 kernel->name(),
294 "' must use the same pressure gradient method.");
295
296 if (&reader.components() != &coupling_reader.components())
297 mooseError("RhieChowMassFlux '",
298 name(),
299 "': momentum pressure kernels '",
300 coupling_kernel->name(),
301 "' and '",
302 kernel->name(),
303 "' must share the same registered pressure gradient field.");
304 }
305
306 _pressure_gradient_field = &coupling_reader;
307
309 {
310 reconstructedGradientMethod().linkFlowSystem(*this, coupling_reader);
311 const auto & base_reader =
312 pressure_var->requestCellGradients(reconstructedGradientMethod().baseGradientMethodName());
313 _base_pressure_gradient_field = &base_reader;
314
316 "Reconstructed and base pressure gradient readers must be distinct when "
317 "FVReconstructedPressureGradient is active.");
318 }
319 else
321
324 for (auto & system : _momentum_systems)
325 {
326 _global_momentum_system_numbers.push_back(system->number());
327 _momentum_implicit_systems.push_back(dynamic_cast<LinearImplicitSystem *>(&system->system()));
328 }
329
331 {
334 _pressure_projection_method != "consistent")
335 paramError("pressure_projection_method",
336 "FVReconstructedPressureGradient with nonorthogonal pressure diffusion requires "
337 "the consistent pressure projection.");
338 }
339
341
342 std::set<BoundaryID> velocity_boundary_ids;
343 for (const auto dim_i : make_range(_dim))
344 for (const auto & [boundary_id, _] : _vel[dim_i]->getBoundaryConditionMap())
345 velocity_boundary_ids.insert(boundary_id);
346
347 const auto is_dirichlet =
348 [](const MooseLinearVariableFVReal & variable, const BoundaryID boundary_id)
349 {
350 return dynamic_cast<const LinearFVAdvectionDiffusionFunctorDirichletBC *>(
351 variable.getBoundaryCondition(boundary_id)) != nullptr;
352 };
353
354 // The legacy boundary HbyA reconstruction uses the x-velocity BC as a proxy for every velocity
355 // component, so all components must have the same Dirichlet classification on those boundaries.
356 for (const auto boundary_id : velocity_boundary_ids)
357 {
358 const auto * const pressure_bc = _p->getBoundaryCondition(boundary_id);
359 if (dynamic_cast<const LinearFVPressureFluxBC *>(pressure_bc))
360 continue;
361
362 const bool velocity_is_dirichlet = is_dirichlet(*_vel[0], boundary_id);
363 for (const auto dim_i : make_range(_dim))
364 if (is_dirichlet(*_vel[dim_i], boundary_id) != velocity_is_dirichlet)
365 mooseError("All velocity components must either have Dirichlet boundary conditions or "
366 "non-Dirichlet boundary conditions on boundary '",
367 _moose_mesh.getBoundaryName(boundary_id),
368 "' when the pressure boundary condition is not a LinearFVPressureFluxBC.");
369 }
370}
boundary_id_type BoundaryID
unsigned int count
for(PetscInt i=0;i< nvars;++i)
Gradient method that reconstructs and relaxes the pressure gradient used for Rhie-Chow momentum-press...
void linkFlowSystem(RhieChowMassFlux &rc, const LinearFVGradientReader &pressure_gradient)
Link this stateful method to one Rhie-Chow flow-system configuration.
bool useNonorthogonalCorrection() const
Kernel that adds the component of the pressure gradient in the momentum equations to the right hand s...
Class implementing a flux boundary condition for linear finite volume pressure variables used in the ...
std::vector< unsigned int > _momentum_system_numbers
Numbers of the momentum system(s)
void checkReconstructedPressureGradientCompatibility() const
Check the single-variable system layout assumed by reconstructed pressure-gradient vector ops.
void setupMeshInformation()
Compute the cell volumes on the mesh.
MooseVariableFieldBase & getVariable(THREAD_ID tid, const std::string &var_name) const
if(subdm)

Referenced by LinearAssemblySegregatedSolve::linkRhieChowUserObject().

◆ meshChanged()

void RhieChowMassFlux::meshChanged ( )
overridevirtual

Reimplemented from GeneralUserObject.

Definition at line 373 of file RhieChowMassFlux.C.

374{
375 _HbyA_flux.clear();
376 _Ainv.clear();
377 _face_mass_flux.clear();
378 _grad_p_current.clear();
380}

◆ momentumSystem() [1/2]

LinearSystem & RhieChowMassFlux::momentumSystem ( unsigned int  component)
inline

◆ momentumSystem() [2/2]

const LinearSystem & RhieChowMassFlux::momentumSystem ( unsigned int  component) const
inline

Momentum linear system for one spatial component.

Definition at line 83 of file RhieChowMassFlux.h.

84 {
86 }

◆ populateCouplingFunctors()

void RhieChowMassFlux::populateCouplingFunctors ( const std::vector< std::unique_ptr< NumericVector< Number > > > &  raw_hbya,
const std::vector< std::unique_ptr< NumericVector< Number > > > &  raw_Ainv 
)
protected

Populate the face values of the H/A and 1/A fields.

Definition at line 840 of file RhieChowMassFlux.C.

843{
844 // We have the raw H/A and 1/A vectors in a petsc format. This function
845 // will create face functors from them
846 using namespace Moose::FV;
847 const auto time_arg = Moose::currentState();
848
849 // Create the petsc vector readers for faster repeated access
850 std::vector<PetscVectorReader> hbya_reader;
851 for (const auto dim_i : index_range(raw_hbya))
852 hbya_reader.emplace_back(*raw_hbya[dim_i]);
853
854 std::vector<PetscVectorReader> ainv_reader;
855 for (const auto dim_i : index_range(raw_Ainv))
856 ainv_reader.emplace_back(*raw_Ainv[dim_i]);
857
858 // We loop through the faces and populate the coupling fields (face H/A and 1/A)
859 for (auto & fi : _flow_face_info)
860 {
861 Real face_rho = 0;
862 RealVectorValue face_hbya;
863
864 // We do the lookup in advance
865 auto & Ainv = _Ainv[fi->id()];
866
867 // If it is internal, we just interpolate (using geometric weights) to the face
868 if (_vel[0]->isInternalFace(*fi))
869 {
870 // Get the dof indices for the element and the neighbor
871 const auto & elem_info = *fi->elemInfo();
872 const auto & neighbor_info = *fi->neighborInfo();
873 const auto elem_dof = elem_info.dofIndices()[_global_momentum_system_numbers[0]][0];
874 const auto neighbor_dof = neighbor_info.dofIndices()[_global_momentum_system_numbers[0]][0];
875
876 // Get the density values for the element and neighbor. We need this multiplication to make
877 // the coupling fields mass fluxes.
878 const Real elem_rho = _rho(makeElemArg(fi->elemPtr()), time_arg);
879 const Real neighbor_rho = _rho(makeElemArg(fi->neighborPtr()), time_arg);
880
881 // Now we do the interpolation to the face
882 interpolate(Moose::FV::InterpMethod::Average, face_rho, elem_rho, neighbor_rho, *fi, true);
883 for (const auto dim_i : index_range(raw_hbya))
884 {
885 interpolate(Moose::FV::InterpMethod::Average,
886 face_hbya(dim_i),
887 hbya_reader[dim_i](elem_dof),
888 hbya_reader[dim_i](neighbor_dof),
889 *fi,
890 true);
892 Ainv(dim_i),
893 elem_rho * ainv_reader[dim_i](elem_dof),
894 neighbor_rho * ainv_reader[dim_i](neighbor_dof),
895 *fi,
896 true);
897 }
898 }
899 else
900 {
901 const bool elem_is_fluid = hasBlocks(fi->elemPtr()->subdomain_id());
902
903 // We need this multiplier in case the face is an internal face and
904 const Real boundary_normal_multiplier = elem_is_fluid ? 1.0 : -1.0;
905
906 const ElemInfo & elem_info = elem_is_fluid ? *fi->elemInfo() : *fi->neighborInfo();
907 const auto elem_dof = elem_info.dofIndices()[_global_momentum_system_numbers[0]][0];
908
909 mooseAssert(fi->boundaryIDs().size() == 1, "We should only have one boundary on every face.");
910 const auto * pressure_bc = _p->getBoundaryCondition(*fi->boundaryIDs().begin());
911
912 // For the legacy Dirichlet-velocity plus extrapolated-pressure path, we still need a
913 // special boundary HbyA reconstruction to keep the face flux consistent. When the pressure
914 // BC itself is a LinearFVPressureFluxBC, that object already enforces the prescribed
915 // boundary mass flux, so we use the standard one-term boundary expansion instead.
916 if (_vel[0]->isDirichletBoundaryFace(*fi) &&
917 !dynamic_cast<const LinearFVPressureFluxBC *>(pressure_bc))
918 {
919 const Moose::FaceArg boundary_face{
920 fi, Moose::FV::LimiterType::CentralDifference, true, false, elem_info.elem(), nullptr};
921 face_rho = _rho(boundary_face, Moose::currentState());
922
923 for (const auto dim_i : make_range(_dim))
924 {
925
926 face_hbya(dim_i) =
927 -MetaPhysicL::raw_value((*_vel[dim_i])(boundary_face, Moose::currentState()));
928 face_hbya(dim_i) *= boundary_normal_multiplier;
929 }
930 }
931 // Otherwise we just do a one-term expansion (so we just use the element value)
932 else
933 {
934 const auto elem_dof = elem_info.dofIndices()[_global_momentum_system_numbers[0]][0];
935
936 face_rho = _rho(makeElemArg(elem_info.elem()), time_arg);
937 for (const auto dim_i : make_range(_dim))
938 face_hbya(dim_i) = boundary_normal_multiplier * hbya_reader[dim_i](elem_dof);
939 }
940
941 // We just do a one-term expansion for 1/A no matter what
942 const Real elem_rho = _rho(makeElemArg(elem_info.elem()), time_arg);
943 for (const auto dim_i : index_range(raw_Ainv))
944 Ainv(dim_i) = elem_rho * ainv_reader[dim_i](elem_dof);
945 }
946 // Lastly, we populate the face flux resulted by H/A
947 _HbyA_flux[fi->id()] = face_hbya * fi->normal() * face_rho;
948 }
949}
const Elem * elem() const
const std::vector< std::vector< dof_id_type > > & dofIndices() const

Referenced by computeHbyA().

◆ prepareMomentumPredictor()

void RhieChowMassFlux::prepareMomentumPredictor ( )

Snapshot the fields read by the next momentum predictor.

Definition at line 401 of file RhieChowMassFlux.C.

402{
403 mooseAssert(_pressure_gradient_field,
404 "The pressure gradient field must be linked before preparing momentum.");
405
406 _grad_p_current.clear();
407 for (const auto & component : pressureGradientComponents())
408 _grad_p_current.push_back(component->clone());
409}

Referenced by LinearAssemblySegregatedSolve::solve().

◆ preparePISOCorrector()

void RhieChowMassFlux::preparePISOCorrector ( )

Capture the lagged velocity gradient for another corrector using the current predictor.

Definition at line 419 of file RhieChowMassFlux.C.

420{
422 return;
423
424 mooseAssert(!_grad_p_current.empty(),
425 "A momentum predictor must be prepared before another PISO corrector.");
426
427 for (const auto component : make_range(dimension()))
428 momentumSystem(component).updateFVGradient(velocityVariable(component).requestCellGradients());
430}
MooseLinearVariableFVReal & velocityVariable(unsigned int component)
Velocity variable for one spatial component.
LinearSystem & momentumSystem(unsigned int component)
Momentum linear system for one spatial component.
unsigned int dimension() const
Number of spatial dimensions of the coupled momentum/pressure systems.

Referenced by PIMPLESolve::correctVelocity(), and TestRhieChowMassFluxSequence::execute().

◆ preparePressureRelaxation()

void RhieChowMassFlux::preparePressureRelaxation ( )

Before pressure relaxation, form the conservative reconstructed candidate from the corrected face flux and update the cell velocity from that unrelaxed candidate.

No-op for ordinary pressure-gradient methods.

Definition at line 433 of file RhieChowMassFlux.C.

434{
436 return;
437
438 // The current pressure solution and corrected face flux are both unrelaxed here. Form the
439 // conservative candidate before pressure relaxation replaces that solution.
441 updateCellVelocity(reconstructedGradientMethod().reconstructedCandidate(*this));
442}
void computeCandidateFromCorrectedFlux(const RhieChowMassFlux &rc)
Reconstruct the conservative pressure-gradient candidate from the corrected face flux.

Referenced by LinearAssemblySegregatedSolve::correctVelocity(), and TestRhieChowMassFluxSequence::execute().

◆ pressureGradientComponents()

const std::vector< NumericVector< Number > * > & RhieChowMassFlux::pressureGradientComponents ( ) const
protected

Get the registered pressure gradient component vectors.

Definition at line 1154 of file RhieChowMassFlux.C.

1155{
1157}

Referenced by finalizePressureCorrector(), and prepareMomentumPredictor().

◆ pressureGradientField()

const LinearFVGradientReader & RhieChowMassFlux::pressureGradientField ( ) const

Get the registered pressure gradient field used by compatible momentum pressure kernels.

Definition at line 689 of file RhieChowMassFlux.C.

690{
693 "The pressure gradient field has not been registered for RhieChowMassFlux '", name(), "'.");
694
696}

Referenced by finalizePressureCorrector(), pressureGradientComponents(), reconstructedGradientMethod(), reconstructedGradientMethod(), FVReconstructedPressureGradient::resetForTimeStep(), and usingReconstructedPressureGradientMethod().

◆ pressureSystem()

const LinearSystem & RhieChowMassFlux::pressureSystem ( ) const
inline

◆ pressureVariableNumber()

unsigned int RhieChowMassFlux::pressureVariableNumber ( ) const

Variable number of the pressure variable reconstructed by this object.

Definition at line 732 of file RhieChowMassFlux.C.

733{
734 return _p->number();
735}

Referenced by FVReconstructedPressureGradient::linkFlowSystem(), and FVReconstructedPressureGradient::validateSetup().

◆ reconstructedGradientMethod() [1/2]

FVReconstructedPressureGradient & RhieChowMassFlux::reconstructedGradientMethod ( )
protected

Access the reconstructed gradient method when it is selected.

Definition at line 1176 of file RhieChowMassFlux.C.

1177{
1178 auto & method = _fe_problem.getFVGradientMethod(pressureGradientField().method().name(), _tid);
1179 mooseAssert(&method == &pressureGradientField().method(),
1180 "The registered writable gradient method must match the pressure-gradient reader.");
1181 return dynamic_cast<FVReconstructedPressureGradient &>(method);
1182}
FVGradientMethod & getFVGradientMethod(const GradientMethodName &name, const THREAD_ID tid=0)

Referenced by checkReconstructedPressureGradientCompatibility(), finalizeMomentumPredictor(), finalizePressureCorrector(), linkMomentumPressureSystems(), preparePISOCorrector(), preparePressureRelaxation(), and timestepSetup().

◆ reconstructedGradientMethod() [2/2]

const FVReconstructedPressureGradient & RhieChowMassFlux::reconstructedGradientMethod ( ) const
protected

Access the reconstructed gradient method when it is selected.

Definition at line 1166 of file RhieChowMassFlux.C.

1167{
1169 "reconstructedGradientMethod() should only be called when reconstructed "
1170 "pressure gradients are active.");
1171
1172 return dynamic_cast<const FVReconstructedPressureGradient &>(pressureGradientField().method());
1173}
const FVGradientMethod & method() const

◆ setupMeshInformation()

void RhieChowMassFlux::setupMeshInformation ( )
protected

Compute the cell volumes on the mesh.

Definition at line 494 of file RhieChowMassFlux.C.

495{
496 // We cache the cell volumes into a petsc vector for corrections here so we can use
497 // the optimized petsc operations for the normalization
499 for (const auto & elem_info : _fe_problem.mesh().elemInfoVector())
500 // We have to check this because the variable might not be defined on the given
501 // block
502 if (hasBlocks(elem_info->subdomain_id()))
503 {
504 const auto elem_dof = elem_info->dofIndices()[_global_pressure_system_number][0];
505 _cell_volumes->set(elem_dof, elem_info->volume() * elem_info->coordFactor());
506 }
507
508 _cell_volumes->close();
509
510 _flow_face_info.clear();
511 for (auto & fi : _fe_problem.mesh().faceInfo())
512 if (hasBlocks(fi->elemPtr()->subdomain_id()) ||
513 (fi->neighborPtr() && hasBlocks(fi->neighborPtr()->subdomain_id())))
514 _flow_face_info.push_back(fi);
515}
virtual const NumericVector< Number > *const & currentSolution() const override final
virtual std::unique_ptr< NumericVector< T > > zero_clone() const=0

Referenced by linkMomentumPressureSystems(), and meshChanged().

◆ supportMeshVelocity()

virtual bool RhieChowMassFlux::supportMeshVelocity ( ) const
inlineoverrideprotectedvirtual

Returns whether the UO can support mesh velocity advection.

Reimplemented from RhieChowFaceFluxProvider.

Definition at line 202 of file RhieChowMassFlux.h.

202{ return false; }

◆ timestepSetup()

void RhieChowMassFlux::timestepSetup ( )
overridevirtual

Prepare reconstructed-gradient state once per attempted time step.

Accepted coupling feedback is retained for the next time step and restored when an attempt is retried, while candidate fields and sequencing counters are reset for every attempt.

Reimplemented from GeneralUserObject.

Definition at line 383 of file RhieChowMassFlux.C.

384{
385 // Nothing to reset when momentum hasn't been linked (e.g. should_solve_momentum = false, used
386 // by the restart-freeze pattern).
388 return;
389
390 _grad_p_current.clear();
391
393 return;
394
395 // Seed the next attempt from the most recently accepted coupling gradient. The linear FV
396 // gradient manager restores that state after rejection and checkpoints it for restart/recovery.
398}
void resetForTimeStep(const RhieChowMassFlux &rc)
Prepare solver-iteration state for a new time-step attempt.

◆ updateCellVelocity()

template<typename GradientComponent >
void RhieChowMassFlux::updateCellVelocity ( const std::vector< GradientComponent > &  pressure_gradient)
protected

Update cell velocity from the supplied momentum-coupling pressure gradient.

Definition at line 519 of file RhieChowMassFlux.C.

520{
521 // u_C = -(H/A)_C - (1/A)_C * grad(p)_C.
522 for (const auto system_i : index_range(_momentum_implicit_systems))
523 {
524 auto working_vector = _Ainv_raw[system_i]->clone();
525 working_vector->pointwise_mult(*working_vector, *pressure_gradient[system_i]);
526 working_vector->add(*_HbyA_raw[system_i]);
527 working_vector->scale(-1.0);
528 (*_momentum_implicit_systems[system_i]->solution) = *working_vector;
529
530#ifndef NDEBUG
531 {
532 // Proof that the assignment above satisfies the momentum-coupling identity
533 // u_C + (H/A)_C + Ainv_C * grad(p)_C = 0. The solution was just assigned directly from
534 // this formula, so the residual is pure floating-point round-off from the
535 // clone/scale/add sequence, not solver error; 1e-10 is a loose absolute bound with
536 // headroom over that round-off.
537 auto defect = _Ainv_raw[system_i]->clone();
538 defect->pointwise_mult(*defect, *pressure_gradient[system_i]);
539 defect->add(*_HbyA_raw[system_i]);
540 defect->add(*_momentum_implicit_systems[system_i]->solution);
541 mooseAssert(MooseUtils::absoluteFuzzyEqual(defect->linfty_norm(), 0.0, 1e-10),
542 "RhieChowMassFlux: cell-velocity update violates the momentum-coupling "
543 "identity u + H/A + Ainv*grad(p) = 0.");
544 }
545#endif
546
547 _momentum_implicit_systems[system_i]->update();
548 _momentum_systems[system_i]->setSolution(
549 *_momentum_implicit_systems[system_i]->current_local_solution);
550 }
551}

Referenced by finalizePressureCorrector(), and preparePressureRelaxation().

◆ usingReconstructedPressureGradientMethod()

bool RhieChowMassFlux::usingReconstructedPressureGradientMethod ( ) const

Whether the registered pressure gradient field is produced by the reconstructed method.

Definition at line 1160 of file RhieChowMassFlux.C.

1161{
1162 return dynamic_cast<const FVReconstructedPressureGradient *>(&pressureGradientField().method());
1163}

Referenced by PIMPLESolve::correctVelocity(), finalizeMomentumPredictor(), finalizePressureCorrector(), linkMomentumPressureSystems(), preparePISOCorrector(), preparePressureRelaxation(), reconstructedGradientMethod(), and timestepSetup().

◆ validParams()

InputParameters RhieChowMassFlux::validParams ( )
static

Definition at line 41 of file RhieChowMassFlux.C.

42{
45
46 params.addClassDescription("Computes H/A and 1/A together with face mass fluxes for segregated "
47 "momentum-pressure equations using linear systems.");
48
49 params.addRequiredParam<VariableName>(NS::pressure, "The pressure variable.");
50 params.addRequiredParam<VariableName>("u", "The x-component of velocity");
51 params.addParam<VariableName>("v", "The y-component of velocity");
52 params.addParam<VariableName>("w", "The z-component of velocity");
53 params.addRequiredParam<std::string>(
54 "p_diffusion_kernel",
55 "The LinearFVPressureCorrectionDiffusion kernel acting on the pressure.");
56
57 params.addRequiredParam<MooseFunctorName>(NS::density, "Density functor");
58
59 // We disable the execution of this, should only provide functions
60 // for the SIMPLE executioner
61 ExecFlagEnum & exec_enum = params.set<ExecFlagEnum>("execute_on", true);
62 exec_enum.addAvailableFlags(EXEC_NONE);
63 exec_enum = {EXEC_NONE};
64 params.suppressParameter<ExecFlagEnum>("execute_on");
65
66 // Pressure projection
67 params.addParam<MooseEnum>("pressure_projection_method",
68 MooseEnum("standard consistent", "standard"),
69 "The method to use in the pressure projection for Ainv - "
70 "standard (SIMPLE) or consistent (SIMPLEC)");
71 params.addParam<MooseEnum>(
72 "pressure_diffusion_interpolation",
73 MooseEnum("average harmonic", "average"),
74 "The face interpolation method for Ainv in the pressure correction diffusion term.");
75 return params;
76}
const ExecFlagType EXEC_NONE
void addAvailableFlags(const ExecFlagType &flag, Args... flags)
static InputParameters validParams()
static InputParameters validParams()

Referenced by WCNSLinearFVFlowPhysics::validParams().

◆ velocityVariable() [1/2]

MooseLinearVariableFVReal & RhieChowMassFlux::velocityVariable ( unsigned int  component)
inline

◆ velocityVariable() [2/2]

const MooseLinearVariableFVReal & RhieChowMassFlux::velocityVariable ( unsigned int  component) const
inline

Velocity variable for one spatial component.

Definition at line 74 of file RhieChowMassFlux.h.

75 {
76 return *_vel[component];
77 }

Member Data Documentation

◆ _A_avg

std::unique_ptr<NumericVector<Number> > RhieChowMassFlux::_A_avg
protected

Definition at line 249 of file RhieChowMassFlux.h.

◆ _Ainv

FaceCenteredMapFunctor<RealVectorValue, std::unordered_map<dof_id_type, RealVectorValue> > RhieChowMassFlux::_Ainv
protected

A map functor from faces to $(1/A)_f$.

Where $A_i$ is the diagonal of the system matrix for the momentum equation.

Definition at line 241 of file RhieChowMassFlux.h.

Referenced by initCouplingField(), initialize(), meshChanged(), populateCouplingFunctors(), and RhieChowMassFlux().

◆ _Ainv_raw

std::vector<std::unique_ptr<NumericVector<Number> > > RhieChowMassFlux::_Ainv_raw
protected

We hold on to the cell-based 1/A vectors so that we can easily reconstruct the cell velocities as well.

Definition at line 247 of file RhieChowMassFlux.h.

Referenced by AinvComponents(), computeHbyA(), and updateCellVelocity().

◆ _base_pressure_gradient_field

const LinearFVGradientReader* RhieChowMassFlux::_base_pressure_gradient_field
protected

Base pressure gradient field used to seed reconstructed gradient updates.

Definition at line 291 of file RhieChowMassFlux.h.

Referenced by basePressureGradientField(), checkReconstructedPressureGradientCompatibility(), and linkMomentumPressureSystems().

◆ _cell_volumes

std::unique_ptr<NumericVector<Number> > RhieChowMassFlux::_cell_volumes
protected

We will hold a vector of cell volumes to make sure we can do volume corrections rapidly.

Definition at line 297 of file RhieChowMassFlux.h.

Referenced by computeHbyA(), and setupMeshInformation().

◆ _dim

const unsigned int RhieChowMassFlux::_dim
protected

The dimension of the mesh, e.g. 3 for hexes and tets, 2 for quads and tris.

Definition at line 211 of file RhieChowMassFlux.h.

Referenced by checkReconstructedPressureGradientCompatibility(), dimension(), linkMomentumPressureSystems(), and populateCouplingFunctors().

◆ _face_mass_flux

FaceCenteredMapFunctor<Real, std::unordered_map<dof_id_type, Real> >& RhieChowMassFlux::_face_mass_flux
protected

A map functor from faces to mass fluxes which are used in the advection terms.

Definition at line 254 of file RhieChowMassFlux.h.

Referenced by computeFaceMassFlux(), getMassFlux(), getVolumetricFaceFlux(), initFaceMassFlux(), and meshChanged().

◆ _face_mass_flux_generation

dof_id_type RhieChowMassFlux::_face_mass_flux_generation = 0
protected

Producer counter for the conservative face mass flux: incremented every time computeFaceMassFlux() runs.

Exposed read-only through faceMassFluxGeneration() so the reconstructed gradient can verify it is reconstructing from the face flux produced by the current pressure corrector, not one left over from a preceding corrector.

Definition at line 265 of file RhieChowMassFlux.h.

Referenced by computeFaceMassFlux(), and faceMassFluxGeneration().

◆ _flow_face_info

std::vector<const FaceInfo *> RhieChowMassFlux::_flow_face_info
private

The subset of the FaceInfo objects that actually cover the subdomains which the flow field is defined on.

Cached for performance optimization.

Definition at line 308 of file RhieChowMassFlux.h.

Referenced by computeFaceMassFlux(), initFaceMassFlux(), populateCouplingFunctors(), and setupMeshInformation().

◆ _global_momentum_system_numbers

std::vector<unsigned int> RhieChowMassFlux::_global_momentum_system_numbers
protected

Global numbers of the momentum system(s)

Definition at line 279 of file RhieChowMassFlux.h.

Referenced by checkReconstructedPressureGradientCompatibility(), linkMomentumPressureSystems(), and populateCouplingFunctors().

◆ _global_pressure_system_number

unsigned int RhieChowMassFlux::_global_pressure_system_number
protected

Global number of the pressure system.

Definition at line 294 of file RhieChowMassFlux.h.

Referenced by computeFaceMassFlux(), linkMomentumPressureSystems(), and setupMeshInformation().

◆ _grad_p_current

std::vector<std::unique_ptr<NumericVector<Number> > > RhieChowMassFlux::_grad_p_current
protected

Coupling pressure gradient captured before the current momentum predictor is assembled.

Definition at line 257 of file RhieChowMassFlux.h.

Referenced by computeHbyA(), meshChanged(), prepareMomentumPredictor(), preparePISOCorrector(), and timestepSetup().

◆ _HbyA_flux

FaceCenteredMapFunctor<Real, std::unordered_map<dof_id_type, Real> > RhieChowMassFlux::_HbyA_flux
protected

A map functor from faces to $HbyA_{ij} = (A_{offdiag}*\mathrm{(predicted~velocity)} - \mathrm{Source})_{ij}/A_{ij}$.

So this contains the off-diagonal part of the system matrix multiplied by the predicted velocity minus the source terms from the right hand side of the linearized momentum predictor step.

Definition at line 229 of file RhieChowMassFlux.h.

Referenced by computeFaceMassFlux(), initCouplingField(), initialize(), meshChanged(), populateCouplingFunctors(), and RhieChowMassFlux().

◆ _HbyA_raw

std::vector<std::unique_ptr<NumericVector<Number> > > RhieChowMassFlux::_HbyA_raw
protected

We hold on to the cell-based HbyA vectors so that we can easily reconstruct the cell velocities as well.

Definition at line 235 of file RhieChowMassFlux.h.

Referenced by computeHbyA(), HbyAComponents(), and updateCellVelocity().

◆ _mesh

const libMesh::MeshBase& RhieChowMassFlux::_mesh
protected

The libMesh mesh that this object acts on.

Definition at line 208 of file RhieChowMassFlux.h.

◆ _momentum_implicit_systems

std::vector<libMesh::LinearImplicitSystem *> RhieChowMassFlux::_momentum_implicit_systems
protected

Pointers to the momentum equation implicit system(s) from libmesh.

Definition at line 282 of file RhieChowMassFlux.h.

Referenced by checkReconstructedPressureGradientCompatibility(), computeHbyA(), linkMomentumPressureSystems(), and updateCellVelocity().

◆ _momentum_system_numbers

std::vector<unsigned int> RhieChowMassFlux::_momentum_system_numbers
protected

Numbers of the momentum system(s)

Definition at line 276 of file RhieChowMassFlux.h.

Referenced by linkMomentumPressureSystems().

◆ _momentum_systems

std::vector<LinearSystem *> RhieChowMassFlux::_momentum_systems
protected

Pointers to the linear system(s) in moose corresponding to the momentum equation(s)

Definition at line 273 of file RhieChowMassFlux.h.

Referenced by checkReconstructedPressureGradientCompatibility(), computeHbyA(), linkMomentumPressureSystems(), momentumSystem(), momentumSystem(), and updateCellVelocity().

◆ _moose_mesh

const MooseMesh& RhieChowMassFlux::_moose_mesh
protected

The MooseMesh that this user object operates on.

Definition at line 205 of file RhieChowMassFlux.h.

Referenced by checkBlocks(), and linkMomentumPressureSystems().

◆ _p

const MooseLinearVariableFVReal* const RhieChowMassFlux::_p
protected

The thread 0 copy of the pressure variable.

Definition at line 214 of file RhieChowMassFlux.h.

Referenced by computeFaceMassFlux(), initialSetup(), linkMomentumPressureSystems(), populateCouplingFunctors(), pressureVariableNumber(), and RhieChowMassFlux().

◆ _p_diffusion_kernel

LinearFVPressureCorrectionDiffusion* RhieChowMassFlux::_p_diffusion_kernel
protected

Pointer to the pressure diffusion term in the pressure Poisson equation.

Definition at line 221 of file RhieChowMassFlux.h.

Referenced by checkReconstructedPressureGradientCompatibility(), computeFaceMassFlux(), initialSetup(), and linkMomentumPressureSystems().

◆ _pressure_diffusion_interp_method

const Moose::FV::InterpMethod RhieChowMassFlux::_pressure_diffusion_interp_method
protected

Interpolation method used for the pressure diffusion coefficient on faces.

Definition at line 303 of file RhieChowMassFlux.h.

Referenced by populateCouplingFunctors().

◆ _pressure_gradient_field

const LinearFVGradientReader* RhieChowMassFlux::_pressure_gradient_field
protected

Registered pressure gradient field used by Rhie-Chow and compatible momentum pressure kernels.

Definition at line 288 of file RhieChowMassFlux.h.

Referenced by checkReconstructedPressureGradientCompatibility(), linkMomentumPressureSystems(), prepareMomentumPredictor(), pressureGradientField(), and timestepSetup().

◆ _pressure_projection_method

const MooseEnum RhieChowMassFlux::_pressure_projection_method
protected

Enumerator for the method used for pressure projection.

Definition at line 300 of file RhieChowMassFlux.h.

Referenced by computeHbyA(), and linkMomentumPressureSystems().

◆ _pressure_system

LinearSystem* RhieChowMassFlux::_pressure_system
protected

◆ _rho

const Moose::Functor<Real>& RhieChowMassFlux::_rho
protected

Functor describing the density of the fluid.

Definition at line 270 of file RhieChowMassFlux.h.

Referenced by getVolumetricFaceFlux(), initFaceMassFlux(), and populateCouplingFunctors().

◆ _vel

std::vector<MooseLinearVariableFVReal *> RhieChowMassFlux::_vel
protected

Thread 0 copies of the velocity variables; non-const to allow writing cell velocities in updateCellVelocity().

Definition at line 218 of file RhieChowMassFlux.h.

Referenced by initFaceMassFlux(), linkMomentumPressureSystems(), populateCouplingFunctors(), RhieChowMassFlux(), velocityVariable(), and velocityVariable().


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