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
PorousRhieChowMassFlux Class Reference

Computes Rhie-Chow face mass fluxes for porous flow with optional internal pressure jumps. More...

#include <PorousRhieChowMassFlux.h>

Inheritance diagram for PorousRhieChowMassFlux:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 PorousRhieChowMassFlux (const InputParameters &params)
 Construct the porous Rhie-Chow mass flux object.
 
void linkMomentumPressureSystems (const std::vector< LinearSystem * > &momentum_systems, LinearSystem &pressure_system, const std::vector< unsigned int > &momentum_system_numbers) override
 Update the momentum system-related information.
 
void computeHbyA (bool verbose) override
 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.
 
Real getFaceSidePorosity (const FaceInfo &fi, bool elem_side, const Moose::StateArg &time) const
 Return the porosity on one side of a face.
 
Real getSignedBaffleJump (const FaceInfo &fi, bool elem_side) const
 Return the pressure jump seen from one side of a baffle face.
 
bool faceIsBaffle (const FaceInfo &fi) const
 Whether a face is governed by a pressure-jump model.
 
bool hasPressureBaffles () const
 Whether at least one pressure-jump model is configured.
 
RealVectorValue baffleFaceVelocity (const FaceInfo &fi, bool elem_side) const
 Return the superficial velocity at a baffle face as seen from one side.
 
Real baffleNormalVelocity (const FaceInfo &fi) const
 Return the normal superficial velocity at a baffle face, recovered from the shared face mass flux and the face-interpolated density.
 
Real cellPressureDiffusionCoefficient (const ElemInfo &elem_info, unsigned int component) const
 Cell coefficient whose face interpolation forms the pressure-diffusion tensor.
 
bool pressureDiffusionDataReady () const
 Whether the pressure-diffusion kernel and cell coefficients are ready for interface use.
 
bool pressureDiffusionUsesNonorthogonalCorrection () const
 Whether the linked pressure-diffusion kernel applies a nonorthogonal correction.
 
NS::FV::PressureJumpInterfaceData pressureJumpInterfaceData (const FaceInfo &fi, const RealVectorValue &elem_gradient, const RealVectorValue &neighbor_gradient, Real face_area) const
 Construct the complete pressure-jump operator for a face.
 
void initCouplingField () override
 Populate baffle-jump storage after initializing the pressure coupling field.
 
void meshChanged () override
 Clear face-indexed baffle-jump data after a mesh change.
 
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)
 
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.
 
template<typename VarType >
void checkBlocks (const VarType &var) const
 Check the block consistency between the passed in var and us.
 
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 void initFaceMassFlux ()
 Initialize the container for face velocities.
 
virtual 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 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.
 
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.
 
Real computeFacePressureGradientFlux (const FaceInfo &fi, PetscVectorReader &p_reader)
 Compute the pressure-gradient flux contribution for a single face.
 
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.
 
Real velocityBoundaryValue (unsigned int component, const FaceInfo &fi, const Moose::FaceArg &boundary_face) const
 Get the prescribed velocity value on a Dirichlet boundary face.
 
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_fluid_volumes
 Fluid volume of each cell, used to rapidly scale the pressure-gradient force in H/A and 1/A.
 
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.
 
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.
 
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

void setupPorousMeshInformation ()
 Overwrite the cached cell fluid volumes with cell volume times porosity.
 
void updateBaffleJumps ()
 Recompute and relax the pressure jumps using the current face mass fluxes.
 
const PressureJumpModel * getPressureJumpModel (const FaceInfo &fi) const
 Return the pressure-jump model that applies to the face, or null if there is none.
 
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

const Moose::Functor< Real > & _eps
 Porosity functor.
 
std::vector< const PressureJumpModel * > _pressure_jump_models
 Pressure-jump models with mutually disjoint boundary sets.
 
const Real _pressure_jump_relaxation
 Under-relaxation factor applied when updating pressure jumps.
 
std::vector< const LinearFVGradientReader * > _velocity_gradients
 Published velocity gradients, one per component, read by the baffle face states.
 
FaceCenteredMapFunctor< Real, std::unordered_map< dof_id_type, Real > > & _baffle_jump
 Restartable face field storing pressure as non-owner minus owner.
 
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

Computes Rhie-Chow face mass fluxes for porous flow with optional internal pressure jumps.

This object supplies side-specific porosity values to porous momentum kernels, maintains the relaxed pressure jump on each modeled baffle face, and applies the jump consistently to pressure reconstruction and face fluxes.

Definition at line 29 of file PorousRhieChowMassFlux.h.

Constructor & Destructor Documentation

◆ PorousRhieChowMassFlux()

PorousRhieChowMassFlux::PorousRhieChowMassFlux ( const InputParameters &  params)

Construct the porous Rhie-Chow mass flux object.

Parameters
paramsThe input parameters for the object

Definition at line 49 of file PorousRhieChowMassFlux.C.

50 : RhieChowMassFlux(params),
51 _eps(getFunctor<Real>(NS::porosity)),
52 _pressure_jump_relaxation(getParam<Real>("pressure_jump_relaxation")),
54 declareRestartableData<FaceCenteredMapFunctor<Real, std::unordered_map<dof_id_type, Real>>>(
55 "baffle_jump", _moose_mesh, blockIDs(), "baffle_jump"))
56{
57 // A face on this object's blocks must be either fully internal or fully external to the
58 // pressure and velocity variables too; a face that is one-sided for a momentum variable but
59 // two-sided for this object has no baffle treatment.
60 if (_p->blockIDs() != blockIDs())
62 "Pressure variable '",
63 _p->name(),
64 "' must have the same block restriction as this object. Variable blocks: ",
66 "; this object's blocks: ",
68 ".");
69 for (const auto * const velocity : _vel)
70 if (velocity->blockIDs() != blockIDs())
71 paramError("u",
72 "Velocity variable '",
73 velocity->name(),
74 "' must have the same block restriction as this object. Variable blocks: ",
75 Moose::stringify(velocity->blockIDs()),
76 "; this object's blocks: ",
78 ".");
79
80 std::unordered_set<BoundaryID> pressure_jump_boundary_ids;
81 for (const auto & model_name : getParam<std::vector<UserObjectName>>("pressure_jump_models"))
82 {
83 const auto & model = getUserObjectByName<PressureJumpModel>(model_name);
84 for (const auto boundary_id : model.boundaryIDs())
85 if (!pressure_jump_boundary_ids.insert(boundary_id).second)
86 paramError("pressure_jump_models",
87 "Pressure jump models must not act on overlapping boundaries.");
88 _pressure_jump_models.push_back(&model);
89
90 // A jump model evaluating different porosity or density than this object would act on a
91 // flow that is not the one being solved.
92 for (const auto & [model_param, rc_param] :
93 {std::make_pair("porosity", NS::porosity), std::make_pair("density", NS::density)})
94 if (model.parameters().have_parameter<MooseFunctorName>(model_param) &&
95 model.getParam<MooseFunctorName>(model_param) != getParam<MooseFunctorName>(rc_param))
96 paramError("pressure_jump_models",
97 "Pressure jump model '",
98 model.name(),
99 "' uses ",
100 model_param,
101 " '",
102 model.getParam<MooseFunctorName>(model_param),
103 "' but this object uses '",
104 getParam<MooseFunctorName>(rc_param),
105 "'.");
106 }
107}
const PertinentGeochemicalSystem model(database, {"H2O", "H+", "HCO3-", "O2(aq)", "Ca++", ">(s)FeOH", "radius_neg1", "radius_neg1.5"}, {"Calcite"}, {}, {"Calcite_asdf"}, {"CH4(aq)"}, {">(s)FeOCa+"}, "O2(aq)", "e-")
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
const T & getParam(const std::string &name) const
const Moose::Functor< Real > & _eps
Porosity functor.
const Real _pressure_jump_relaxation
Under-relaxation factor applied when updating pressure jumps.
std::vector< const PressureJumpModel * > _pressure_jump_models
Pressure-jump models with mutually disjoint boundary sets.
FaceCenteredMapFunctor< Real, std::unordered_map< dof_id_type, Real > > & _baffle_jump
Restartable face field storing pressure as non-owner minus owner.
T & declareRestartableData(const std::string &data_name, Args &&... args)
User object responsible for determining the face fluxes using the Rhie-Chow interpolation in a segreg...
const MooseMesh & _moose_mesh
The MooseMesh that this user object operates on.
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...
std::string stringify(const T &t)
static const std::string density
Definition NS.h:34
static const std::string porosity
Definition NS.h:108
static const std::string pressure
Definition NS.h:57
if(subdm)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

Member Function Documentation

◆ AinvComponents()

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

Get the momentum-layout 1/A component vectors.

Definition at line 724 of file RhieChowMassFlux.C.

725{
726 mooseAssert(!_Ainv_raw.empty(), "Ainv data is not ready.");
727
728 return _Ainv_raw;
729}
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().

◆ baffleFaceVelocity()

RealVectorValue PorousRhieChowMassFlux::baffleFaceVelocity ( const FaceInfo &  fi,
bool  elem_side 
) const

Return the superficial velocity at a baffle face as seen from one side.

The velocity is extrapolated from the side's cell center with that side's velocity gradient, which is exact for a velocity that is linear on each side and needs no data from across the baffle. Before linkMomentumPressureSystems() collects the FVVelocityJumpGreenGaussGradient velocity gradients, no gradient is available and the cell velocity is returned.

Parameters
fiThe baffle face
elem_sideWhether to return the element-side state

Definition at line 332 of file PorousRhieChowMassFlux.C.

333{
334 mooseAssert(fi.neighborPtr() && faceIsBaffle(fi), "Baffle face states require a baffle face.");
335
336 const auto & cell_info = elem_side ? *fi.elemInfo() : *fi.neighborInfo();
337 const auto state = Moose::currentState();
338 RealVectorValue velocity;
339 for (const auto component : index_range(_vel))
340 velocity(component) = _vel[component]->getElemValue(cell_info, state);
341
342 // Gradient history is initialized before the velocity gradients are linked.
343 if (_velocity_gradients.empty())
344 return velocity;
345
346 const auto cell_to_face = fi.faceCentroid() - cell_info.centroid();
347 for (const auto component : index_range(_vel))
348 velocity(component) += _velocity_gradients[component]->gradient(cell_info) * cell_to_face;
349
350 return velocity;
351}
const Elem * neighborPtr() const
const ElemInfo * elemInfo() const
const ElemInfo * neighborInfo() const
const Point & faceCentroid() const
bool faceIsBaffle(const FaceInfo &fi) const
Whether a face is governed by a pressure-jump model.
std::vector< const LinearFVGradientReader * > _velocity_gradients
Published velocity gradients, one per component, read by the baffle face states.
StateArg currentState()
T component(const RankTwoTensorTempl< T > &r2tensor, unsigned int i, unsigned int j)
auto index_range(const T &sizable)

Referenced by LinearPWCNSFVMomentumFlux::baffleStressData(), LinearPWCNSFVMomentumFlux::computeBaffleAdvectionExplicitCorrection(), and FVVelocityJumpGreenGaussGradient::internalFaceValues().

◆ baffleNormalVelocity()

Real PorousRhieChowMassFlux::baffleNormalVelocity ( const FaceInfo &  fi) const

Return the normal superficial velocity at a baffle face, recovered from the shared face mass flux and the face-interpolated density.

Density is assumed to vary smoothly across the baffle, so both sides share this value.

Parameters
fiThe baffle face

Definition at line 354 of file PorousRhieChowMassFlux.C.

355{
356 mooseAssert(fi.neighborPtr() && faceIsBaffle(fi), "Baffle face states require a baffle face.");
357
358 const auto state = Moose::currentState();
359 const Real elem_rho = _rho(makeElemArg(fi.elemPtr()), state);
360 const Real neighbor_rho = _rho(makeElemArg(fi.neighborPtr()), state);
361 if (elem_rho <= 0.0 || neighbor_rho <= 0.0)
362 mooseError("density must be positive on pressure-jump face ", fi.id(), ".");
363
364 // Mass conservation makes rho U.n continuous. Density is assumed to vary smoothly across the
365 // baffle, as in BernoulliFormLossPressureJump, so the same face-interpolated density recovers
366 // one normal velocity for both sides. Dividing by the cell-center density instead would make
367 // the normal velocity first-order accurate wherever density varies within the cell.
368 Real face_rho = 0.0;
370 Moose::FV::InterpMethod::Average, face_rho, elem_rho, neighbor_rho, fi, true);
371 return _face_mass_flux.evaluate(&fi) / face_rho;
372}
ValueType evaluate(const FaceInfo *const fi) const
Evaluate the face functor using a FaceInfo argument.
dof_id_type id() const
const Elem * elemPtr() const
Moose::ElemArg makeElemArg(const Elem *elem, bool correct_skewnewss=false) const
void mooseError(Args &&... args) const
const Moose::Functor< Real > & _rho
Functor describing the density of the fluid.
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.
void interpolate(InterpMethod m, T &result, const T2 &value1, const T3 &value2, const FaceInfo &fi, const bool one_is_elem)

Referenced by LinearPWCNSFVMomentumFlux::computeBaffleAdvectionExplicitCorrection().

◆ basePressureGradientComponents()

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

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

Definition at line 732 of file RhieChowMassFlux.C.

733{
735}
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 RhieChowMassFlux::finalizePressureCorrector().

◆ basePressureGradientField()

const LinearFVGradientReader & RhieChowMassFlux::basePressureGradientField ( ) const
inherited

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

Definition at line 705 of file RhieChowMassFlux.C.

706{
708 mooseError("The base pressure gradient field has not been registered for RhieChowMassFlux '",
709 name(),
710 "'.");
711
713}
const LinearFVGradientReader * _base_pressure_gradient_field
Base pressure gradient field used to seed reconstructed gradient updates.

Referenced by RhieChowMassFlux::basePressureGradientComponents(), computeHbyA(), and linkMomentumPressureSystems().

◆ cellPressureDiffusionCoefficient()

Real PorousRhieChowMassFlux::cellPressureDiffusionCoefficient ( const ElemInfo &  elem_info,
unsigned int  component 
) const

Cell coefficient whose face interpolation forms the pressure-diffusion tensor.

Definition at line 375 of file PorousRhieChowMassFlux.C.

377{
378 mooseAssert(component < _Ainv_raw.size(), "Invalid pressure-diffusion component.");
379
380 const auto momentum_dof = elem_info.dofIndices()[_global_momentum_system_numbers[component]][0];
381 const Real density = _rho(makeElemArg(elem_info.elem()), Moose::currentState());
382 return density * (*_Ainv_raw[component])(momentum_dof);
383}
const Elem * elem() const
const std::vector< std::vector< dof_id_type > > & dofIndices() const
std::vector< unsigned int > _global_momentum_system_numbers
Global numbers of the momentum system(s)

Referenced by pressureJumpInterfaceData().

◆ checkBlocks()

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

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

Definition at line 325 of file RhieChowMassFlux.h.

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

Referenced by LinearFVEnergyAdvection::LinearFVEnergyAdvection(), LinearFVScalarAdvection::LinearFVScalarAdvection(), LinearFVTurbulentAdvection::LinearFVTurbulentAdvection(), and RhieChowMassFlux::RhieChowMassFlux().

◆ checkReconstructedPressureGradientCompatibility()

void RhieChowMassFlux::checkReconstructedPressureGradientCompatibility ( ) const
protectedinherited

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

Definition at line 1226 of file RhieChowMassFlux.C.

1227{
1230 mooseError("RhieChowMassFlux '",
1231 name(),
1232 "' is missing a required pressure system, pressure-gradient field, base-gradient "
1233 "field, or pressure-correction diffusion kernel for reconstructed pressure "
1234 "gradients.");
1235
1237
1238 if (_momentum_systems.size() != _dim || _momentum_implicit_systems.size() != _dim ||
1240 mooseError("RhieChowMassFlux '",
1241 name(),
1242 "' requires one linked momentum system per spatial component for reconstructed "
1243 "pressure gradients.");
1244
1245 if (_pressure_system->nVariables() != 1)
1246 mooseError(
1247 "FVReconstructedPressureGradient assumes the pressure and momentum systems each have "
1248 "exactly one variable so their DOF indices can be used in vector operations. Pressure "
1249 "system '",
1251 "' has variables: ",
1253
1254 for (const auto system_i : index_range(_momentum_systems))
1255 {
1256 const auto * const momentum_system = _momentum_systems[system_i];
1257 if (!momentum_system || !_momentum_implicit_systems[system_i])
1258 mooseError("RhieChowMassFlux '",
1259 name(),
1260 "' has an invalid momentum-system layout for component ",
1261 system_i,
1262 ".");
1263
1264 if (momentum_system->nVariables() != 1)
1265 mooseError("FVReconstructedPressureGradient assumes the pressure and momentum systems each "
1266 "have exactly one variable so their DOF indices can be used in vector operations. "
1267 "Momentum system '",
1268 momentum_system->name(),
1269 "' has variables: ",
1270 Moose::stringify(momentum_system->getVariableNames()));
1271 }
1272}
void validateSetup(const RhieChowMassFlux &rc) const
Validate the one-time Rhie-Chow linkage and field layouts required by reconstruction.
const LinearFVGradientReader * _pressure_gradient_field
Registered pressure gradient field used by Rhie-Chow and compatible momentum pressure kernels.
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)
LinearSystem * _pressure_system
Pointer to the pressure system.
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.
const unsigned int _dim
The dimension of the mesh, e.g. 3 for hexes and tets, 2 for quads and tris.
virtual unsigned int nVariables() const
const std::vector< VariableName > & getVariableNames() const
virtual const std::string & name() const

Referenced by RhieChowMassFlux::linkMomentumPressureSystems().

◆ computeFaceMassFlux()

void RhieChowMassFlux::computeFaceMassFlux ( )
virtualinherited

Update the values of the face velocities in the containers.

Definition at line 761 of file RhieChowMassFlux.C.

762{
763 using namespace Moose::FV;
764
765 // Petsc vector reader to make the repeated reading from the vector faster
766 PetscVectorReader p_reader(*_pressure_system->system().current_local_solution);
767
768 // We loop through the faces and compute the face fluxes using the pressure gradient
769 // and the momentum matrix/right hand side
770 for (auto & fi : _flow_face_info)
771 {
772 const Real p_grad_flux = computeFacePressureGradientFlux(*fi, p_reader);
773 // Compute the new face flux
774 const Real face_flux = -_HbyA_flux[fi->id()] + p_grad_flux;
775 _face_mass_flux[fi->id()] = face_flux;
776 }
777
779}
virtual System & system() override
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...
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}...
Real computeFacePressureGradientFlux(const FaceInfo &fi, PetscVectorReader &p_reader)
Compute the pressure-gradient flux contribution for a single face.

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

◆ computeFacePressureGradientFlux()

Real RhieChowMassFlux::computeFacePressureGradientFlux ( const FaceInfo &  fi,
PetscVectorReader &  p_reader 
)
protectedinherited

Compute the pressure-gradient flux contribution for a single face.

Definition at line 811 of file RhieChowMassFlux.C.

812{
813 // Making sure the kernel knows which face we are on
815
816 // We are setting this to 1.0 because we don't want to multiply the kernel contributions
817 // with the surface area yet. The surface area will be factored in in the advection kernels.
819
820 Real p_grad_flux = 0.0;
821 if (_p->isInternalFace(fi))
822 {
823 const auto & elem_info = *fi.elemInfo();
824 const auto & neighbor_info = *fi.neighborInfo();
825
826 // Fetching the dof indices for the pressure variable
827 const auto elem_dof = elem_info.dofIndices()[_global_pressure_system_number][0];
828 const auto neighbor_dof = neighbor_info.dofIndices()[_global_pressure_system_number][0];
829
830 // Fetching the values of the pressure for the element and the neighbor
831 const auto p_elem_value = p_reader(elem_dof);
832 const auto p_neighbor_value = p_reader(neighbor_dof);
833
834 // Compute the elem matrix contributions for the face
835 const auto elem_matrix_contribution = _p_diffusion_kernel->computeElemMatrixContribution();
836 const auto neighbor_matrix_contribution =
838 const auto elem_rhs_contribution = _p_diffusion_kernel->computeElemRightHandSideContribution();
839
840 // Compute the face flux from the matrix and right hand side contributions
841 p_grad_flux = (p_neighbor_value * neighbor_matrix_contribution +
842 p_elem_value * elem_matrix_contribution) -
843 elem_rhs_contribution;
844 }
845 else if (auto * bc_pointer = _p->getBoundaryCondition(*fi.boundaryIDs().begin()))
846 {
847 mooseAssert(fi.boundaryIDs().size() == 1, "We should only have one boundary on every face.");
848 bc_pointer->setupFaceData(
849 &fi, fi.faceType(std::make_pair(_p->number(), _global_pressure_system_number)));
850
851 const auto time_arg = Moose::currentState();
852 const ElemInfo & elem_info =
853 hasBlocks(fi.elemPtr()->subdomain_id()) ? *fi.elemInfo() : *fi.neighborInfo();
854 const auto p_elem_value = _p->getElemValue(elem_info, time_arg);
855 const auto matrix_contribution =
857 const auto rhs_contribution = _p_diffusion_kernel->computeBoundaryRHSContribution(*bc_pointer);
858
859 // On the boundary, only the element side has a contribution
860 p_grad_flux = p_elem_value * matrix_contribution - rhs_contribution;
861 }
862
863 return p_grad_flux;
864}
bool hasBlocks(const SubdomainName &name) const
VarFaceNeighbors faceType(const std::pair< unsigned int, unsigned int > &var_sys) const
const std::set< BoundaryID > & boundaryIDs() 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)
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
unsigned int _global_pressure_system_number
Global number of the pressure system.

Referenced by RhieChowMassFlux::computeFaceMassFlux().

◆ computeHbyA()

void PorousRhieChowMassFlux::computeHbyA ( bool  verbose)
overridevirtual

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.

Reimplemented from RhieChowMassFlux.

Definition at line 219 of file PorousRhieChowMassFlux.C.

220{
221 // This runs before every pressure corrector, so PIMPLE relaxes the jump once per PISO corrector
222 // and the effective relaxation per outer iteration grows with num_piso_iterations. Without a
223 // reconstructed pressure gradient, all those updates use the same face flux.
225
226 // Pressure jumps are external data for the variable's gradient method. Refresh that field
227 // before pressure assembly even though the pressure solution itself has not changed yet.
228 if (hasPressureBaffles())
230
232
233 // Each side of a baffle carries its own momentum relation rho_s U_s.n = -h_s + (pressure flux),
234 // with h_s = rho_s (H/A)_s.n. Continuity of the mass flux weights the side H/A fluxes with the
235 // same half-cell conductances as the pressure, so a body force balanced by the pressure on each
236 // side (a fluid at rest across a porosity or density jump) gives zero face flux. The face area
237 // is 1 to match computeFacePressureGradientFlux, and the pressure gradients only enter the
238 // nonorthogonal correction, which the H/A flux does not use.
239 if (hasPressureBaffles())
240 for (const auto * const fi : _flow_face_info)
241 if (_vel[0]->isInternalFace(*fi) && faceIsBaffle(*fi))
242 _HbyA_flux[fi->id()] = NS::FV::pressureJumpHbyAFlux(
244}
void updateFVGradient(const LinearFVGradientReader &reader)
bool hasPressureBaffles() const
Whether at least one pressure-jump model is configured.
void updateBaffleJumps()
Recompute and relax the pressure jumps using the current face mass fluxes.
NS::FV::PressureJumpInterfaceData pressureJumpInterfaceData(const FaceInfo &fi, const RealVectorValue &elem_gradient, const RealVectorValue &neighbor_gradient, Real face_area) const
Construct the complete pressure-jump operator for a face.
virtual void computeHbyA(bool verbose)
Computes the inverse of the diagonal (1/A) of the system matrix plus the H/A components for the press...
Real pressureJumpHbyAFlux(const PressureJumpInterfaceData &data)
Compute the H/A part of the face mass flux after eliminating the interface pressures.

◆ dimension()

unsigned int RhieChowMassFlux::dimension ( ) const
inlineinherited

◆ execute()

virtual void RhieChowMassFlux::execute ( )
inlineoverridevirtualinherited

Implements GeneralUserObject.

Definition at line 150 of file RhieChowMassFlux.h.

150{}

◆ faceIsBaffle()

bool PorousRhieChowMassFlux::faceIsBaffle ( const FaceInfo &  fi) const

◆ faceMassFluxGeneration()

dof_id_type RhieChowMassFlux::faceMassFluxGeneration ( ) const
inlineinherited

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 103 of file RhieChowMassFlux.h.

Referenced by FVReconstructedPressureGradient::computeCandidateFromCorrectedFlux().

◆ finalize()

virtual void RhieChowMassFlux::finalize ( )
inlineoverridevirtualinherited

Implements GeneralUserObject.

Definition at line 151 of file RhieChowMassFlux.h.

151{}

◆ finalizeMomentumPredictor()

void RhieChowMassFlux::finalizeMomentumPredictor ( )
inherited

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

Definition at line 413 of file RhieChowMassFlux.C.

414{
417}
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 ( )
inherited

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 446 of file RhieChowMassFlux.C.

447{
449 {
450 // Refresh every ordinary pressure gradient while leaving the old coupling field untouched
451 // until the current reconstructed candidate has been relaxed into it.
456 }
457 else
458 {
461 }
462}
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 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().

◆ getFaceSidePorosity()

Real PorousRhieChowMassFlux::getFaceSidePorosity ( const FaceInfo &  fi,
bool  elem_side,
const Moose::StateArg &  time 
) const

Return the porosity on one side of a face.

Parameters
fiThe face on which to evaluate porosity
elem_sideWhether to use the element side instead of the neighbor side
timeThe solution state at which to evaluate porosity

Definition at line 280 of file PorousRhieChowMassFlux.C.

283{
284 const Elem * const elem = elem_side ? fi.elemPtr() : fi.neighborPtr();
285 if (!elem)
286 return 1.0;
287
288 return _eps(makeElemArg(elem), time);
289}

Referenced by LinearPWCNSFVMomentumFlux::inversePorosity(), and LinearPWCNSFVMomentumFlux::isClearFluidSide().

◆ getMassFlux()

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

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}

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

◆ getPressureJumpModel()

const PressureJumpModel * PorousRhieChowMassFlux::getPressureJumpModel ( const FaceInfo &  fi) const
private

Return the pressure-jump model that applies to the face, or null if there is none.

Definition at line 455 of file PorousRhieChowMassFlux.C.

456{
457 const PressureJumpModel * face_model = nullptr;
458 for (const auto * const model : _pressure_jump_models)
459 if (model->appliesTo(fi))
460 {
461 // The models act on disjoint boundaries, but a face can still carry boundaries of two
462 // models, which would make its jump ambiguous.
463 mooseAssert(!face_model,
464 "Pressure-jump face " + std::to_string(fi.id()) +
465 " lies on boundaries of more than one pressure jump model.");
466 face_model = model;
467 }
468
469 return face_model;
470}
Interface for pressure-jump models evaluated by PorousRhieChowMassFlux.

Referenced by faceIsBaffle(), getSignedBaffleJump(), and updateBaffleJumps().

◆ getSignedBaffleJump()

Real PorousRhieChowMassFlux::getSignedBaffleJump ( const FaceInfo &  fi,
bool  elem_side 
) const

Return the pressure jump seen from one side of a baffle face.

Parameters
fiThe face on which to query the jump
elem_sideWhether to return the jump seen from the element side

Definition at line 292 of file PorousRhieChowMassFlux.C.

293{
294 const auto * const pressure_jump_model = getPressureJumpModel(fi);
295 if (!pressure_jump_model)
296 return 0.0;
297
298 const Real J = _baffle_jump.evaluate(&fi);
299 const bool elem_is_owner = pressure_jump_model->elemIsOwner(fi);
300 // J is stored as (p_non_owner - p_owner), so the owner side sees -J.
301 return (elem_side == elem_is_owner) ? -J : J;
302}

Referenced by FVPressureJumpGreenGaussGradient::internalFaceValues(), and pressureJumpInterfaceData().

◆ getVolumetricFaceFlux() [1/2]

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

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 // On a face shared with a non-flow block, the FaceInfo element may be the non-flow cell, so
651 // the density must be evaluated on the flow side.
652 const Elem * face_side = fi.elemPtr();
653 if (!_vel[0]->isInternalFace(fi) && !hasBlocks(fi.elemPtr()->subdomain_id()))
654 face_side = fi.neighborPtr();
655
656 const Moose::FaceArg face_arg{&fi,
657 /*limiter_type=*/Moose::FV::LimiterType::CentralDifference,
658 /*elem_is_upwind=*/true,
659 /*correct_skewness=*/false,
660 face_side,
661 /*state_limiter*/ nullptr};
662 const Real face_rho = _rho(face_arg, Moose::currentState());
663 if (!std::isfinite(face_rho) || face_rho <= 0.0)
664 mooseError("RhieChowMassFlux '",
665 name(),
666 "' requires finite, positive density for corrected face flux reconstruction, but "
667 "density is ",
668 face_rho,
669 " on face ID ",
670 fi.id(),
671 " adjacent to cell ID ",
672 fi.elem().id(),
673 " and neighbor cell ID ",
674 neighbor_cell_id,
675 ".");
676
677 const Real volumetric_flux = face_flux->second / face_rho;
678 if (!std::isfinite(volumetric_flux))
679 mooseError("RhieChowMassFlux '",
680 name(),
681 "' computed non-finite volumetric flux ",
682 volumetric_flux,
683 " on face ID ",
684 fi.id(),
685 " adjacent to cell ID ",
686 fi.elem().id(),
687 " and neighbor cell ID ",
688 neighbor_cell_id,
689 ".");
690
691 return volumetric_flux;
692}
const Elem & elem() 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
overridevirtualinherited

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

◆ hasPressureBaffles()

bool PorousRhieChowMassFlux::hasPressureBaffles ( ) const
inline

Whether at least one pressure-jump model is configured.

Definition at line 66 of file PorousRhieChowMassFlux.h.

66{ return !_pressure_jump_models.empty(); }

Referenced by computeHbyA(), and linkMomentumPressureSystems().

◆ HbyAComponents()

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

Get the momentum-layout H/A component vectors.

Definition at line 716 of file RhieChowMassFlux.C.

717{
718 mooseAssert(!_HbyA_raw.empty(), "HbyA data is not ready.");
719
720 return _HbyA_raw;
721}
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 FVReconstructedPressureGradient::reconstructPressureGradient().

◆ initCouplingField()

void PorousRhieChowMassFlux::initCouplingField ( )
overridevirtual

Populate baffle-jump storage after initializing the pressure coupling field.

Reimplemented from RhieChowMassFlux.

Definition at line 271 of file PorousRhieChowMassFlux.C.

272{
274
275 for (const auto & fi : _fe_problem.mesh().faceInfo())
276 _baffle_jump[fi->id()];
277}
virtual void initCouplingField()
Initialize the coupling fields (HbyA and Ainv)
FEProblemBase & _fe_problem
MeshBase & mesh

◆ initFaceMassFlux()

void RhieChowMassFlux::initFaceMassFlux ( )
virtualinherited

Initialize the container for face velocities.

Definition at line 565 of file RhieChowMassFlux.C.

566{
567 using namespace Moose::FV;
568
569 const auto time_arg = Moose::currentState();
570
571 // We loop through the faces and compute the resulting face fluxes from the
572 // initial conditions for velocity
573 for (auto & fi : _flow_face_info)
574 {
575 RealVectorValue density_times_velocity;
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 velocityBoundaryValue(dim_i, *fi, boundary_face);
608 }
609
610 _face_mass_flux[fi->id()] = density_times_velocity * fi->normal();
611 }
612}
Real velocityBoundaryValue(unsigned int component, const FaceInfo &fi, const Moose::FaceArg &boundary_face) const
Get the prescribed velocity value on a Dirichlet boundary face.
VectorValue< Real > RealVectorValue

Referenced by LinearAssemblySegregatedSolve::linkRhieChowUserObject().

◆ initialize()

void RhieChowMassFlux::initialize ( )
overridevirtualinherited

Implements GeneralUserObject.

Definition at line 555 of file RhieChowMassFlux.C.

556{
557 for (const auto & pair : _HbyA_flux)
558 _HbyA_flux[pair.first] = 0;
559
560 for (const auto & pair : _Ainv)
561 _Ainv[pair.first] = 0;
562}
FaceCenteredMapFunctor< RealVectorValue, std::unordered_map< dof_id_type, RealVectorValue > > _Ainv
A map functor from faces to $(1/A)_f$.

◆ initialSetup()

void RhieChowMassFlux::initialSetup ( )
overridevirtualinherited

Reimplemented from GeneralUserObject.

Definition at line 471 of file RhieChowMassFlux.C.

472{
473 // We fetch the pressure diffusion kernel to ensure that the face flux correction
474 // is consistent with the pressure discretization in the Poisson equation.
475 std::vector<LinearFVFluxKernel *> flux_kernel;
476 auto base_query = _fe_problem.theWarehouse()
477 .query()
478 .template condition<AttribThread>(_tid)
479 .template condition<AttribSysNum>(_p->sys().number())
480 .template condition<AttribSystem>("LinearFVFluxKernel")
481 .template condition<AttribName>(getParam<std::string>("p_diffusion_kernel"))
482 .queryInto(flux_kernel);
483 if (flux_kernel.size() != 1)
485 "p_diffusion_kernel",
486 "The kernel with the given name could not be found or multiple instances were identified.");
487 _p_diffusion_kernel = dynamic_cast<LinearFVPressureCorrectionDiffusion *>(flux_kernel[0]);
489 paramError("p_diffusion_kernel",
490 "The provided diffusion kernel must be of type "
491 "LinearFVPressureCorrectionDiffusion.");
492}
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 ( )
inherited

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

Definition at line 465 of file RhieChowMassFlux.C.

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

◆ linkMomentumPressureSystems()

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

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

Reimplemented from RhieChowMassFlux.

Definition at line 110 of file PorousRhieChowMassFlux.C.

114{
116 momentum_systems, pressure_system, momentum_system_numbers);
117
118 // A pressure jump represents a baffle interior to the flow domain. A boundary with no
119 // flow-block element on one side is a domain boundary, not a baffle. The boundary element
120 // range this check needs is not yet built when this object is constructed.
121 for (const auto * const model : _pressure_jump_models)
122 for (const auto boundary_id : model->boundaryIDs())
123 if (_moose_mesh.isBoundaryFullyExternalToSubdomains(boundary_id, blockIDs()))
124 paramError("pressure_jump_models",
125 "Pressure jump model '",
126 model->name(),
127 "' boundary '",
128 _moose_mesh.getBoundaryName(boundary_id),
129 "' is not internal to this object's blocks. Pressure-jump baffles must lie "
130 "strictly inside the flow domain.");
131
132 // The porous momentum pressure kernels must weight the pressure gradient with the porosity
133 // this object uses to form the face fluxes.
134 for (const auto system_number : momentum_system_numbers)
135 {
136 std::vector<LinearFVElementalKernel *> kernels;
138 .query()
139 .template condition<AttribThread>(_tid)
140 .template condition<AttribSystem>("LinearFVElementalKernel")
141 .template condition<AttribSysNum>(system_number)
142 .queryInto(kernels);
143
144 for (const auto * const kernel : kernels)
145 if (const auto * const pressure_kernel =
146 dynamic_cast<const LinearPWCNSFVMomentumPressure *>(kernel);
147 pressure_kernel && MooseUtils::setsIntersect(pressure_kernel->blockIDs(), blockIDs()) &&
148 pressure_kernel->getParam<MooseFunctorName>(NS::porosity) !=
149 getParam<MooseFunctorName>(NS::porosity))
151 "Momentum pressure kernel '",
152 pressure_kernel->name(),
153 "' uses porosity '",
154 pressure_kernel->getParam<MooseFunctorName>(NS::porosity),
155 "' but this object uses '",
156 getParam<MooseFunctorName>(NS::porosity),
157 "'.");
158 }
159
160 if (hasPressureBaffles() &&
162 paramError("p_diffusion_kernel",
163 "Pressure jump models require LinearFVPressureCorrectionDiffusionJump.");
164
165 auto * const pressure_var =
167 mooseAssert(pressure_var, "The pressure variable type was checked by RhieChowMassFlux.");
168 const auto & solution_gradient_reader = pressure_var->requestCellGradients();
169
170 if (hasPressureBaffles())
171 {
172 auto * const jump_gradient_method = dynamic_cast<FVPressureJumpGreenGaussGradient *>(
173 &_fe_problem.getFVGradientMethod(solution_gradient_reader.method().name(), _tid));
174 if (!jump_gradient_method)
175 mooseError("Pressure variable '",
176 pressure_var->name(),
177 "' must use FVPressureJumpGreenGaussGradient as its default gradient method "
178 "when this object has pressure baffles.");
179
180 jump_gradient_method->linkFlowSystem(*this, solution_gradient_reader);
181
183 {
184 if (&basePressureGradientField().method() != &solution_gradient_reader.method())
185 mooseError("FVReconstructedPressureGradient '",
187 "' must use the pressure variable's FVPressureJumpGreenGaussGradient as its "
188 "base_gradient_method when this object has pressure baffles.");
189 }
190 else if (&pressureGradientField().method() != &solution_gradient_reader.method())
192 "Momentum pressure kernels coupled to this object must use the pressure "
193 "variable's FVPressureJumpGreenGaussGradient or an FVReconstructedPressureGradient "
194 "based on it when pressure baffles are present.");
195
196 // Velocity gradients that interpolate across a baffle turn the physical velocity jump into
197 // a slope. Every consumer of the default velocity gradient must see the one-sided states.
198 _velocity_gradients.clear();
199 for (auto * const velocity : _vel)
200 {
201 const auto & velocity_gradient = velocity->requestCellGradients();
202 auto * const velocity_gradient_method = dynamic_cast<FVVelocityJumpGreenGaussGradient *>(
203 &_fe_problem.getFVGradientMethod(velocity_gradient.method().name(), _tid));
204 if (!velocity_gradient_method)
205 mooseError("Velocity variable '",
206 velocity->name(),
207 "' must use FVVelocityJumpGreenGaussGradient as its default gradient method "
208 "when this object has pressure baffles.");
209
210 velocity_gradient_method->linkFlowSystem(*this);
211 _velocity_gradients.push_back(&velocity_gradient);
212 }
213 }
214
216}
for(PetscInt i=0;i< nvars;++i)
FVGradientMethod & getFVGradientMethod(const GradientMethodName &name, const THREAD_ID tid=0)
Green-Gauss pressure gradient that removes prescribed jumps before interpolating across baffles.
Green-Gauss velocity gradient that uses the one-sided baffle face states of a porous Rhie-Chow object...
const FVGradientMethod & method() const
Pressure-correction diffusion kernel that enforces modeled jumps on internal baffle faces.
Adds the porosity-weighted pressure gradient to the right hand side of the momentum equation written ...
void setupPorousMeshInformation()
Overwrite the cached cell fluid volumes with cell volume times porosity.
virtual 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.
MooseVariableFieldBase & getVariable(THREAD_ID tid, const std::string &var_name) const

◆ meshChanged()

void PorousRhieChowMassFlux::meshChanged ( )
overridevirtual

Clear face-indexed baffle-jump data after a mesh change.

Reimplemented from RhieChowMassFlux.

Definition at line 247 of file PorousRhieChowMassFlux.C.

248{
250 _baffle_jump.clear();
252}
virtual void meshChanged() override

◆ momentumSystem() [1/2]

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

◆ momentumSystem() [2/2]

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

Momentum linear system for one spatial component.

Definition at line 90 of file RhieChowMassFlux.h.

91 {
93 }

◆ populateCouplingFunctors()

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

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

Definition at line 880 of file RhieChowMassFlux.C.

883{
884 // We have the raw H/A and 1/A vectors in a petsc format. This function
885 // will create face functors from them
886 using namespace Moose::FV;
887 const auto time_arg = Moose::currentState();
888
889 // Create the petsc vector readers for faster repeated access
890 std::vector<PetscVectorReader> hbya_reader;
891 for (const auto dim_i : index_range(raw_hbya))
892 hbya_reader.emplace_back(*raw_hbya[dim_i]);
893
894 std::vector<PetscVectorReader> ainv_reader;
895 for (const auto dim_i : index_range(raw_Ainv))
896 ainv_reader.emplace_back(*raw_Ainv[dim_i]);
897
898 // We loop through the faces and populate the coupling fields (face H/A and 1/A)
899 for (auto & fi : _flow_face_info)
900 {
901 Real face_rho = 0;
902 RealVectorValue face_hbya;
903
904 // We do the lookup in advance
905 auto & Ainv = _Ainv[fi->id()];
906
907 // If it is internal, we just interpolate (using geometric weights) to the face
908 if (_vel[0]->isInternalFace(*fi))
909 {
910 // Get the dof indices for the element and the neighbor
911 const auto & elem_info = *fi->elemInfo();
912 const auto & neighbor_info = *fi->neighborInfo();
913 const auto elem_dof = elem_info.dofIndices()[_global_momentum_system_numbers[0]][0];
914 const auto neighbor_dof = neighbor_info.dofIndices()[_global_momentum_system_numbers[0]][0];
915
916 // Get the density values for the element and neighbor. We need this multiplication to make
917 // the coupling fields mass fluxes.
918 const Real elem_rho = _rho(makeElemArg(fi->elemPtr()), time_arg);
919 const Real neighbor_rho = _rho(makeElemArg(fi->neighborPtr()), time_arg);
920
921 // Now we do the interpolation to the face
922 interpolate(Moose::FV::InterpMethod::Average, face_rho, elem_rho, neighbor_rho, *fi, true);
923 for (const auto dim_i : index_range(raw_hbya))
924 {
925 interpolate(Moose::FV::InterpMethod::Average,
926 face_hbya(dim_i),
927 hbya_reader[dim_i](elem_dof),
928 hbya_reader[dim_i](neighbor_dof),
929 *fi,
930 true);
932 Ainv(dim_i),
933 elem_rho * ainv_reader[dim_i](elem_dof),
934 neighbor_rho * ainv_reader[dim_i](neighbor_dof),
935 *fi,
936 true);
937 }
938 }
939 else
940 {
941 const bool elem_is_fluid = hasBlocks(fi->elemPtr()->subdomain_id());
942
943 // We need this multiplier in case the face is an internal face and
944 const Real boundary_normal_multiplier = elem_is_fluid ? 1.0 : -1.0;
945
946 const ElemInfo & elem_info = elem_is_fluid ? *fi->elemInfo() : *fi->neighborInfo();
947 const auto elem_dof = elem_info.dofIndices()[_global_momentum_system_numbers[0]][0];
948
949 mooseAssert(fi->boundaryIDs().size() == 1, "We should only have one boundary on every face.");
950 const auto * pressure_bc = _p->getBoundaryCondition(*fi->boundaryIDs().begin());
951
952 // For the legacy Dirichlet-velocity plus extrapolated-pressure path, we still need a
953 // special boundary HbyA reconstruction to keep the face flux consistent. When the pressure
954 // BC itself is a LinearFVPressureFluxBC, that object already enforces the prescribed
955 // boundary mass flux, so we use the standard one-term boundary expansion instead.
956 if (_vel[0]->isDirichletBoundaryFace(*fi) &&
957 !dynamic_cast<const LinearFVPressureFluxBC *>(pressure_bc))
958 {
959 const Moose::FaceArg boundary_face{
960 fi, Moose::FV::LimiterType::CentralDifference, true, false, elem_info.elem(), nullptr};
961 face_rho = _rho(boundary_face, Moose::currentState());
962
963 for (const auto dim_i : make_range(_dim))
964 {
965
966 face_hbya(dim_i) =
967 -MetaPhysicL::raw_value((*_vel[dim_i])(boundary_face, Moose::currentState()));
968 face_hbya(dim_i) *= boundary_normal_multiplier;
969 }
970 }
971 // Otherwise we just do a one-term expansion (so we just use the element value)
972 else
973 {
974 const auto elem_dof = elem_info.dofIndices()[_global_momentum_system_numbers[0]][0];
975
976 face_rho = _rho(makeElemArg(elem_info.elem()), time_arg);
977 for (const auto dim_i : make_range(_dim))
978 face_hbya(dim_i) = boundary_normal_multiplier * hbya_reader[dim_i](elem_dof);
979 }
980
981 // We just do a one-term expansion for 1/A no matter what
982 const Real elem_rho = _rho(makeElemArg(elem_info.elem()), time_arg);
983 for (const auto dim_i : index_range(raw_Ainv))
984 Ainv(dim_i) = elem_rho * ainv_reader[dim_i](elem_dof);
985 }
986 // Lastly, we populate the face flux resulted by H/A
987 _HbyA_flux[fi->id()] = face_hbya * fi->normal() * face_rho;
988 }
989}
Class implementing a flux boundary condition for linear finite volume pressure variables used in the ...
const Moose::FV::InterpMethod _pressure_diffusion_interp_method
Interpolation method used for the pressure diffusion coefficient on faces.
auto raw_value(const Eigen::Map< T > &in)
IntRange< T > make_range(T beg, T end)

Referenced by RhieChowMassFlux::computeHbyA().

◆ prepareMomentumPredictor()

void RhieChowMassFlux::prepareMomentumPredictor ( )
inherited

Snapshot the fields read by the next momentum predictor.

Definition at line 402 of file RhieChowMassFlux.C.

403{
404 mooseAssert(_pressure_gradient_field,
405 "The pressure gradient field must be linked before preparing momentum.");
406
407 _grad_p_current.clear();
408 for (const auto & component : pressureGradientComponents())
409 _grad_p_current.push_back(component->clone());
410}
std::vector< std::unique_ptr< NumericVector< Number > > > _grad_p_current
Coupling pressure gradient captured before the current momentum predictor is assembled.

Referenced by LinearAssemblySegregatedSolve::solve().

◆ preparePISOCorrector()

void RhieChowMassFlux::preparePISOCorrector ( )
inherited

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

Definition at line 420 of file RhieChowMassFlux.C.

421{
423 return;
424
425 mooseAssert(!_grad_p_current.empty(),
426 "A momentum predictor must be prepared before another PISO corrector.");
427
428 for (const auto component : make_range(dimension()))
429 momentumSystem(component).updateFVGradient(velocityVariable(component).requestCellGradients());
431}
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 ( )
inherited

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 434 of file RhieChowMassFlux.C.

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

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

◆ pressureDiffusionDataReady()

bool PorousRhieChowMassFlux::pressureDiffusionDataReady ( ) const

Whether the pressure-diffusion kernel and cell coefficients are ready for interface use.

Definition at line 386 of file PorousRhieChowMassFlux.C.

387{
388 return _p_diffusion_kernel && _Ainv_raw.size() == dimension() && _HbyA_raw.size() == dimension();
389}

Referenced by FVPressureJumpGreenGaussGradient::internalFaceValues(), pressureDiffusionUsesNonorthogonalCorrection(), and pressureJumpInterfaceData().

◆ pressureDiffusionUsesNonorthogonalCorrection()

bool PorousRhieChowMassFlux::pressureDiffusionUsesNonorthogonalCorrection ( ) const

Whether the linked pressure-diffusion kernel applies a nonorthogonal correction.

Definition at line 392 of file PorousRhieChowMassFlux.C.

393{
394 mooseAssert(pressureDiffusionDataReady(), "Pressure-diffusion data must be ready first.");
396}
bool useNonorthogonalCorrection() const
bool pressureDiffusionDataReady() const
Whether the pressure-diffusion kernel and cell coefficients are ready for interface use.

Referenced by pressureJumpInterfaceData().

◆ pressureGradientComponents()

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

Get the registered pressure gradient component vectors.

Definition at line 1195 of file RhieChowMassFlux.C.

1196{
1198}

Referenced by RhieChowMassFlux::finalizePressureCorrector(), and RhieChowMassFlux::prepareMomentumPredictor().

◆ pressureGradientField()

const LinearFVGradientReader & RhieChowMassFlux::pressureGradientField ( ) const
inherited

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

Definition at line 695 of file RhieChowMassFlux.C.

696{
699 "The pressure gradient field has not been registered for RhieChowMassFlux '", name(), "'.");
700
702}

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

◆ pressureJumpInterfaceData()

NS::FV::PressureJumpInterfaceData PorousRhieChowMassFlux::pressureJumpInterfaceData ( const FaceInfo &  fi,
const RealVectorValue &  elem_gradient,
const RealVectorValue &  neighbor_gradient,
Real  face_area 
) const

Construct the complete pressure-jump operator for a face.

Parameters
fiThe face on which to construct the operator
elem_gradientThe lagged pressure gradient in the element
neighbor_gradientThe lagged pressure gradient in the neighbor
face_areaThe area multiplier used by the caller's flux convention

Definition at line 399 of file PorousRhieChowMassFlux.C.

403{
405 if (!fi.neighborPtr() || !faceIsBaffle(fi))
406 return data;
407
408 mooseAssert(pressureDiffusionDataReady(),
409 "Pressure-diffusion data must be ready before constructing a baffle face operator.");
410
411 const auto & elem_info = *fi.elemInfo();
412 const auto & neighbor_info = *fi.neighborInfo();
413 const auto time_arg = Moose::currentState();
414 const Real elem_rho = _rho(makeElemArg(fi.elemPtr()), time_arg);
415 const Real neighbor_rho = _rho(makeElemArg(fi.neighborPtr()), time_arg);
416 RealVectorValue elem_diffusion;
417 RealVectorValue neighbor_diffusion;
418 RealVectorValue elem_rho_hbya;
419 RealVectorValue neighbor_rho_hbya;
420 for (const auto component : make_range(dimension()))
421 {
422 elem_diffusion(component) = cellPressureDiffusionCoefficient(elem_info, component);
423 neighbor_diffusion(component) = cellPressureDiffusionCoefficient(neighbor_info, component);
424 const auto system_number = _global_momentum_system_numbers[component];
425 elem_rho_hbya(component) =
426 elem_rho * (*_HbyA_raw[component])(elem_info.dofIndices()[system_number][0]);
427 neighbor_rho_hbya(component) =
428 neighbor_rho * (*_HbyA_raw[component])(neighbor_info.dofIndices()[system_number][0]);
429 }
430
432 fi.faceCentroid() - elem_info.centroid(),
433 neighbor_info.centroid() - fi.faceCentroid(),
434 elem_diffusion,
435 neighbor_diffusion,
436 elem_gradient,
437 neighbor_gradient,
438 elem_rho_hbya,
439 neighbor_rho_hbya,
440 face_area,
442 getSignedBaffleJump(fi, /*elem_side=*/true));
443
444 // A valid mesh gives positive projected half-cell distances, and a positive momentum diagonal
445 // and density give positive conductances.
446 mooseAssert(data.valid,
447 "Cannot construct the pressure-jump operator on face " + std::to_string(fi.id()) +
448 ": the half-cell distances, normal pressure diffusion coefficients, face area, "
449 "and conductances must be finite and positive, and the corrections finite.");
450
451 return data;
452}
const Point & normal() const
bool pressureDiffusionUsesNonorthogonalCorrection() const
Whether the linked pressure-diffusion kernel applies a nonorthogonal correction.
Real getSignedBaffleJump(const FaceInfo &fi, bool elem_side) const
Return the pressure jump seen from one side of a baffle face.
Real cellPressureDiffusionCoefficient(const ElemInfo &elem_info, unsigned int component) const
Cell coefficient whose face interpolation forms the pressure-diffusion tensor.
PressureJumpInterfaceData pressureJumpInterfaceData(const RealVectorValue &normal, const Point &elem_to_face, const Point &face_to_neighbor, const RealVectorValue &elem_diffusion, const RealVectorValue &neighbor_diffusion, const RealVectorValue &elem_gradient, const RealVectorValue &neighbor_gradient, const RealVectorValue &elem_rho_hbya, const RealVectorValue &neighbor_rho_hbya, const Real face_area, const bool use_nonorthogonal_correction, const Real elem_jump)
Construct the conservative half-cell interface coefficients for a diagonal diffusion tensor.
Complete face operator obtained by eliminating the two one-sided interface pressures.

Referenced by computeHbyA(), FVPressureJumpGreenGaussGradient::internalFaceValues(), and LinearFVPressureCorrectionDiffusionJump::jumpInterfaceData().

◆ pressureSystem()

const LinearSystem & RhieChowMassFlux::pressureSystem ( ) const
inlineinherited

◆ pressureVariableNumber()

unsigned int RhieChowMassFlux::pressureVariableNumber ( ) const
inherited

Variable number of the pressure variable reconstructed by this object.

Definition at line 738 of file RhieChowMassFlux.C.

739{
740 return _p->number();
741}

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

◆ reconstructedGradientMethod() [1/2]

FVReconstructedPressureGradient & RhieChowMassFlux::reconstructedGradientMethod ( )
protectedinherited

Access the reconstructed gradient method when it is selected.

Definition at line 1217 of file RhieChowMassFlux.C.

1218{
1219 auto & method = _fe_problem.getFVGradientMethod(pressureGradientField().method().name(), _tid);
1220 mooseAssert(&method == &pressureGradientField().method(),
1221 "The registered writable gradient method must match the pressure-gradient reader.");
1222 return dynamic_cast<FVReconstructedPressureGradient &>(method);
1223}
Gradient method that reconstructs and relaxes the pressure gradient used for Rhie-Chow momentum-press...

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

◆ reconstructedGradientMethod() [2/2]

const FVReconstructedPressureGradient & RhieChowMassFlux::reconstructedGradientMethod ( ) const
protectedinherited

Access the reconstructed gradient method when it is selected.

Definition at line 1207 of file RhieChowMassFlux.C.

1208{
1210 "reconstructedGradientMethod() should only be called when reconstructed "
1211 "pressure gradients are active.");
1212
1213 return dynamic_cast<const FVReconstructedPressureGradient &>(pressureGradientField().method());
1214}

◆ setupMeshInformation()

void RhieChowMassFlux::setupMeshInformation ( )
protectedinherited

Compute the cell volumes on the mesh.

Definition at line 495 of file RhieChowMassFlux.C.

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

Referenced by RhieChowMassFlux::linkMomentumPressureSystems(), and RhieChowMassFlux::meshChanged().

◆ setupPorousMeshInformation()

void PorousRhieChowMassFlux::setupPorousMeshInformation ( )
private

Overwrite the cached cell fluid volumes with cell volume times porosity.

Definition at line 255 of file PorousRhieChowMassFlux.C.

256{
257 const auto time_arg = Moose::currentState();
258 for (const auto & elem_info : _fe_problem.mesh().elemInfoVector())
259 if (hasBlocks(elem_info->subdomain_id()))
260 {
261 const auto elem_dof = elem_info->dofIndices()[_global_pressure_system_number][0];
262 const Real cell_volume = elem_info->volume() * elem_info->coordFactor();
263 _cell_fluid_volumes->set(elem_dof,
264 cell_volume * _eps(makeElemArg(elem_info->elem()), time_arg));
265 }
266
267 _cell_fluid_volumes->close();
268}

Referenced by linkMomentumPressureSystems(), and meshChanged().

◆ supportMeshVelocity()

virtual bool RhieChowMassFlux::supportMeshVelocity ( ) const
inlineoverrideprotectedvirtualinherited

Returns whether the UO can support mesh velocity advection.

Reimplemented from RhieChowFaceFluxProvider.

Definition at line 212 of file RhieChowMassFlux.h.

212{ return false; }

◆ timestepSetup()

void RhieChowMassFlux::timestepSetup ( )
overridevirtualinherited

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 384 of file RhieChowMassFlux.C.

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

◆ updateBaffleJumps()

void PorousRhieChowMassFlux::updateBaffleJumps ( )
private

Recompute and relax the pressure jumps using the current face mass fluxes.

Definition at line 305 of file PorousRhieChowMassFlux.C.

306{
307 if (_pressure_jump_models.empty())
308 return;
309
310 for (auto & fi : _flow_face_info)
311 {
312 const auto * const pressure_jump_model = getPressureJumpModel(*fi);
313 if (!pressure_jump_model || !fi->neighborPtr())
314 continue;
315 if (!hasBlocks(fi->elemPtr()->subdomain_id()) || !hasBlocks(fi->neighborPtr()->subdomain_id()))
316 continue;
317
318 const Real new_jump =
319 pressure_jump_model->computePressureJump(*fi, _face_mass_flux.evaluate(fi));
320 _baffle_jump[fi->id()] = _pressure_jump_relaxation * new_jump +
321 (1.0 - _pressure_jump_relaxation) * _baffle_jump[fi->id()];
322 }
323}

Referenced by computeHbyA().

◆ updateCellVelocity()

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

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

Definition at line 520 of file RhieChowMassFlux.C.

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

Referenced by RhieChowMassFlux::finalizePressureCorrector(), and RhieChowMassFlux::preparePressureRelaxation().

◆ usingReconstructedPressureGradientMethod()

bool RhieChowMassFlux::usingReconstructedPressureGradientMethod ( ) const
inherited

◆ validParams()

InputParameters PorousRhieChowMassFlux::validParams ( )
static

Definition at line 32 of file PorousRhieChowMassFlux.C.

33{
36 "Rhie-Chow mass flux object specialized for porous flow/baffle cases.");
37
38 params.addParam<MooseFunctorName>(
39 NS::porosity, "1", "Porosity functor (defaults to 1 for non-porous calculations).");
40 params.addParam<std::vector<UserObjectName>>(
41 "pressure_jump_models", {}, "Pressure jump models applied by this object.");
42 params.addRangeCheckedParam<Real>("pressure_jump_relaxation",
43 1.0,
44 "0.0<pressure_jump_relaxation<=1.0",
45 "Under-relaxation factor for pressure jump updates.");
46 return params;
47}
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
void addRangeCheckedParam(const std::string &name, const T &value, const std::string &parsed_function, const std::string &doc_string)
static InputParameters validParams()

◆ velocityBoundaryValue()

Real RhieChowMassFlux::velocityBoundaryValue ( unsigned int  component,
const FaceInfo &  fi,
const Moose::FaceArg &  boundary_face 
) const
protectedinherited

Get the prescribed velocity value on a Dirichlet boundary face.

Definition at line 782 of file RhieChowMassFlux.C.

785{
786 const auto face_type = fi.faceType(
787 std::make_pair(_vel[component]->number(), _global_momentum_system_numbers[component]));
788
789 LinearFVBoundaryCondition * dirichlet_bc = nullptr;
790 for (const auto bnd_id : fi.boundaryIDs())
791 if (auto * const bc_pointer = _vel[component]->getBoundaryCondition(bnd_id))
792 if (dynamic_cast<LinearFVAdvectionDiffusionFunctorDirichletBC *>(bc_pointer))
793 {
794 // Two Dirichlet conditions on one face would prescribe conflicting velocities.
795 mooseAssert(!dirichlet_bc,
796 "Face " + std::to_string(fi.id()) +
797 " carries more than one Dirichlet velocity boundary condition.");
798 dirichlet_bc = bc_pointer;
799 }
800
801 if (dirichlet_bc)
802 {
803 dirichlet_bc->setupFaceData(&fi, face_type);
804 return dirichlet_bc->computeBoundaryValue();
805 }
806
807 return MetaPhysicL::raw_value((*_vel[component])(boundary_face, Moose::currentState()));
808}
void setupFaceData(const FaceInfo *face_info, const FaceInfo::VarFaceNeighbors face_type)
virtual Real computeBoundaryValue() const=0

Referenced by RhieChowMassFlux::initFaceMassFlux().

◆ velocityVariable() [1/2]

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

◆ velocityVariable() [2/2]

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

Velocity variable for one spatial component.

Definition at line 81 of file RhieChowMassFlux.h.

82 {
83 return *_vel[component];
84 }

Member Data Documentation

◆ _A_avg

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

Definition at line 259 of file RhieChowMassFlux.h.

◆ _Ainv

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

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 251 of file RhieChowMassFlux.h.

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

◆ _Ainv_raw

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

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

Definition at line 257 of file RhieChowMassFlux.h.

Referenced by RhieChowMassFlux::AinvComponents(), cellPressureDiffusionCoefficient(), RhieChowMassFlux::computeHbyA(), pressureDiffusionDataReady(), and RhieChowMassFlux::updateCellVelocity().

◆ _baffle_jump

FaceCenteredMapFunctor<Real, std::unordered_map<dof_id_type, Real> >& PorousRhieChowMassFlux::_baffle_jump
private

Restartable face field storing pressure as non-owner minus owner.

Definition at line 139 of file PorousRhieChowMassFlux.h.

Referenced by getSignedBaffleJump(), initCouplingField(), meshChanged(), and updateBaffleJumps().

◆ _base_pressure_gradient_field

const LinearFVGradientReader* RhieChowMassFlux::_base_pressure_gradient_field
protectedinherited

Base pressure gradient field used to seed reconstructed gradient updates.

Definition at line 301 of file RhieChowMassFlux.h.

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

◆ _cell_fluid_volumes

std::unique_ptr<NumericVector<Number> > RhieChowMassFlux::_cell_fluid_volumes
protectedinherited

Fluid volume of each cell, used to rapidly scale the pressure-gradient force in H/A and 1/A.

This is the cell volume, or the cell volume times porosity for porous flow.

Definition at line 310 of file RhieChowMassFlux.h.

Referenced by RhieChowMassFlux::computeHbyA(), RhieChowMassFlux::setupMeshInformation(), and setupPorousMeshInformation().

◆ _dim

const unsigned int RhieChowMassFlux::_dim
protectedinherited

◆ _eps

const Moose::Functor<Real>& PorousRhieChowMassFlux::_eps
private

Porosity functor.

Definition at line 127 of file PorousRhieChowMassFlux.h.

Referenced by getFaceSidePorosity(), and setupPorousMeshInformation().

◆ _face_mass_flux

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

◆ _face_mass_flux_generation

dof_id_type RhieChowMassFlux::_face_mass_flux_generation = 0
protectedinherited

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 275 of file RhieChowMassFlux.h.

Referenced by RhieChowMassFlux::computeFaceMassFlux(), and RhieChowMassFlux::faceMassFluxGeneration().

◆ _flow_face_info

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

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 320 of file RhieChowMassFlux.h.

Referenced by RhieChowMassFlux::computeFaceMassFlux(), computeHbyA(), RhieChowMassFlux::initFaceMassFlux(), RhieChowMassFlux::populateCouplingFunctors(), RhieChowMassFlux::setupMeshInformation(), and updateBaffleJumps().

◆ _global_momentum_system_numbers

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

◆ _global_pressure_system_number

unsigned int RhieChowMassFlux::_global_pressure_system_number
protectedinherited

◆ _grad_p_current

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

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

Definition at line 267 of file RhieChowMassFlux.h.

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

◆ _HbyA_flux

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

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 239 of file RhieChowMassFlux.h.

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

◆ _HbyA_raw

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

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

Definition at line 245 of file RhieChowMassFlux.h.

Referenced by RhieChowMassFlux::computeHbyA(), RhieChowMassFlux::HbyAComponents(), pressureDiffusionDataReady(), pressureJumpInterfaceData(), and RhieChowMassFlux::updateCellVelocity().

◆ _mesh

const libMesh::MeshBase& RhieChowMassFlux::_mesh
protectedinherited

The libMesh mesh that this object acts on.

Definition at line 218 of file RhieChowMassFlux.h.

◆ _momentum_implicit_systems

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

◆ _momentum_system_numbers

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

Numbers of the momentum system(s)

Definition at line 286 of file RhieChowMassFlux.h.

Referenced by RhieChowMassFlux::linkMomentumPressureSystems().

◆ _momentum_systems

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

◆ _moose_mesh

const MooseMesh& RhieChowMassFlux::_moose_mesh
protectedinherited

The MooseMesh that this user object operates on.

Definition at line 215 of file RhieChowMassFlux.h.

Referenced by RhieChowMassFlux::checkBlocks(), RhieChowMassFlux::linkMomentumPressureSystems(), and linkMomentumPressureSystems().

◆ _p

const MooseLinearVariableFVReal* const RhieChowMassFlux::_p
protectedinherited

◆ _p_diffusion_kernel

LinearFVPressureCorrectionDiffusion* RhieChowMassFlux::_p_diffusion_kernel
protectedinherited

◆ _pressure_diffusion_interp_method

const Moose::FV::InterpMethod RhieChowMassFlux::_pressure_diffusion_interp_method
protectedinherited

Interpolation method used for the pressure diffusion coefficient on faces.

Definition at line 316 of file RhieChowMassFlux.h.

Referenced by RhieChowMassFlux::populateCouplingFunctors().

◆ _pressure_gradient_field

const LinearFVGradientReader* RhieChowMassFlux::_pressure_gradient_field
protectedinherited

◆ _pressure_jump_models

std::vector<const PressureJumpModel *> PorousRhieChowMassFlux::_pressure_jump_models
private

Pressure-jump models with mutually disjoint boundary sets.

Definition at line 130 of file PorousRhieChowMassFlux.h.

Referenced by getPressureJumpModel(), hasPressureBaffles(), linkMomentumPressureSystems(), PorousRhieChowMassFlux(), and updateBaffleJumps().

◆ _pressure_jump_relaxation

const Real PorousRhieChowMassFlux::_pressure_jump_relaxation
private

Under-relaxation factor applied when updating pressure jumps.

Definition at line 133 of file PorousRhieChowMassFlux.h.

Referenced by updateBaffleJumps().

◆ _pressure_projection_method

const MooseEnum RhieChowMassFlux::_pressure_projection_method
protectedinherited

Enumerator for the method used for pressure projection.

Definition at line 313 of file RhieChowMassFlux.h.

Referenced by RhieChowMassFlux::computeHbyA(), and RhieChowMassFlux::linkMomentumPressureSystems().

◆ _pressure_system

LinearSystem* RhieChowMassFlux::_pressure_system
protectedinherited

◆ _rho

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

◆ _vel

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

◆ _velocity_gradients

std::vector<const LinearFVGradientReader *> PorousRhieChowMassFlux::_velocity_gradients
private

Published velocity gradients, one per component, read by the baffle face states.

Definition at line 136 of file PorousRhieChowMassFlux.h.

Referenced by baffleFaceVelocity(), and linkMomentumPressureSystems().


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