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

Class implementing a flux boundary condition for linear finite volume pressure variables used in the pressure corrector equation which is consistent with the H/A flux and a prescribed boundary velocity. More...

#include <LinearFVPressureFluxBC.h>

Inheritance diagram for LinearFVPressureFluxBC:
[legend]

Public Types

enum  TEST_TYPE
 
enum  ResidualTagType { ResidualTagType::NonReference, ResidualTagType::Reference }
 
typedef DataFileName DataFileParameterType
 

Public Member Functions

 LinearFVPressureFluxBC (const InputParameters &parameters)
 Class constructor. More...
 
virtual Real computeBoundaryValue () const override
 
virtual Real computeBoundaryNormalGradient () const override
 
virtual Real computeBoundaryValueMatrixContribution () const override
 
virtual Real computeBoundaryValueRHSContribution () const override
 
virtual Real computeBoundaryGradientMatrixContribution () const override
 
virtual Real computeBoundaryGradientRHSContribution () const override
 
virtual bool includesMaterialPropertyMultiplier () const override
 
virtual bool providesCompleteBoundaryFlux () const override
 
virtual bool needsBoundaryNonorthogonalCorrection () const
 
virtual bool hasFaceSide (const FaceInfo &fi, bool fi_elem_side) const override
 
const SubProblemsubProblem () const
 
const MooseLinearVariableFV< Real > & variable () const
 
void setupFaceData (const FaceInfo *face_info, const FaceInfo::VarFaceNeighbors face_type)
 
const FaceInfocurrentFaceInfo () const
 
FaceInfo::VarFaceNeighbors currentFaceType () const
 
virtual bool enabled () const
 
std::shared_ptr< MooseObjectgetSharedPtr ()
 
std::shared_ptr< const MooseObjectgetSharedPtr () const
 
bool isKokkosObject () const
 
MooseAppgetMooseApp () const
 
const std::string & type () const
 
const std::string & name () const
 
std::string typeAndName () const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
MooseObjectName uniqueName () const
 
const InputParametersparameters () const
 
const hit::Node * getHitNode () const
 
bool hasBase () const
 
const std::string & getBase () const
 
const TgetParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const TqueryParam (const std::string &name) const
 
const TgetRenamedParam (const std::string &old_name, const std::string &new_name) const
 
T getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool 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 const std::set< BoundaryID > & boundaryIDs () const
 
const std::vector< BoundaryName > & boundaryNames () const
 
unsigned int numBoundaryIDs () const
 
bool hasBoundary (const BoundaryName &name) const
 
bool hasBoundary (const std::vector< BoundaryName > &names) const
 
bool hasBoundary (const BoundaryID &id) const
 
bool hasBoundary (const std::vector< BoundaryID > &ids, TEST_TYPE type=ALL) const
 
bool hasBoundary (const std::set< BoundaryID > &ids, TEST_TYPE type=ALL) const
 
bool isBoundarySubset (const std::set< BoundaryID > &ids) const
 
bool isBoundarySubset (const std::vector< BoundaryID > &ids) const
 
bool hasBoundaryMaterialProperty (const std::string &prop_name) const
 
virtual bool boundaryRestricted () const
 
const std::set< BoundaryID > & meshBoundaryIDs () const
 
virtual bool checkVariableBoundaryIntegrity () const
 
virtual void initialSetup ()
 
virtual void timestepSetup ()
 
virtual void jacobianSetup ()
 
virtual void residualSetup ()
 
virtual void subdomainSetup ()
 
virtual void customSetup (const ExecFlagType &)
 
const ExecFlagEnumgetExecuteOnEnum () const
 
const FunctiongetFunction (const std::string &name) const
 
const FunctiongetFunctionByName (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 TgetKokkosFunction (const std::string &name) const
 
Moose::Kokkos::Function getKokkosFunctionByName (const FunctionName &name) const
 
const TgetKokkosFunctionByName (const FunctionName &name) const
 
bool hasKokkosFunction (const std::string &param_name) const
 
bool hasKokkosFunctionByName (const FunctionName &name) const
 
UserObjectName getUserObjectName (const std::string &param_name) const
 
const TgetUserObject (const std::string &param_name, bool is_dependency=true) const
 
const TgetUserObjectByName (const UserObjectName &object_name, bool is_dependency=true) const
 
const UserObjectBasegetUserObjectBase (const std::string &param_name, bool is_dependency=true) const
 
const UserObjectBasegetUserObjectBaseByName (const UserObjectName &object_name, bool is_dependency=true) const
 
bool isImplicit ()
 
Moose::StateArg determineState () 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 VectorPostprocessorValuegetVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name, bool needs_broadcast) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValueOldByName (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
 
PenetrationLocatorgetPenetrationLocator (const BoundaryName &primary, const BoundaryName &secondary, Order order)
 
PenetrationLocatorgetQuadraturePenetrationLocator (const BoundaryName &primary, const BoundaryName &secondary, Order order)
 
NearestNodeLocatorgetNearestNodeLocator (const BoundaryName &primary, const BoundaryName &secondary)
 
NearestNodeLocatorgetQuadratureNearestNodeLocator (const BoundaryName &primary, const BoundaryName &secondary)
 
bool requiresGeometricSearch () const
 
virtual void meshChanged ()
 
void useVectorTag (const TagName &tag_name, VectorTagsKey)
 
void useVectorTag (TagID tag_id, VectorTagsKey)
 
void useMatrixTag (const TagName &tag_name, MatrixTagsKey)
 
void useMatrixTag (TagID tag_id, MatrixTagsKey)
 
bool isVectorTagged ()
 
bool isMatrixTagged ()
 
bool hasVectorTags () const
 
const std::set< TagID > & getVectorTags (VectorTagsKey) const
 
const std::set< TagID > & getMatrixTags (MatrixTagsKey) const
 
MooseVariableBasemooseVariableBase () const
 
MooseVariableField< Real > & mooseVariableField ()
 
MooseVariableFE< Real > * mooseVariable () const
 
MooseVariableFV< Real > * mooseVariableFV () const
 
MooseLinearVariableFV< Real > * mooseLinearVariableFV () const
 
const std::set< MooseVariableFieldBase *> & getMooseVariableDependencies () const
 
std::set< MooseVariableFieldBase *> checkAllVariables (const DofObjectType &dof_object, const std::set< MooseVariableFieldBase * > &vars_to_omit={})
 
virtual std::set< MooseVariableFieldBase *> checkVariables (const libMesh::Node &node, const std::set< MooseVariableFieldBase * > &vars_to_check)
 
std::set< MooseVariableFieldBase *> checkVariables (const libMesh::Elem &element, const std::set< MooseVariableFieldBase * > &vars_to_check)
 
void addMooseVariableDependency (MooseVariableFieldBase *var)
 
void addMooseVariableDependency (const std::vector< MooseVariableFieldBase * > &vars)
 
Moose::FaceArg makeFace (const FaceInfo &fi, const Moose::FV::LimiterType limiter_type, const bool elem_is_upwind, const bool correct_skewness=false, const Moose::StateArg *state_limiter=nullptr) const
 
Moose::FaceArg makeCDFace (const FaceInfo &fi, const bool correct_skewness=false) const
 
const DistributiongetDistribution (const std::string &name) const
 
const TgetDistribution (const std::string &name) const
 
const DistributiongetDistribution (const std::string &name) const
 
const TgetDistribution (const std::string &name) const
 
const DistributiongetDistributionByName (const DistributionName &name) const
 
const TgetDistributionByName (const std::string &name) const
 
const DistributiongetDistributionByName (const DistributionName &name) const
 
const TgetDistributionByName (const std::string &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 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 PostprocessorValuegetPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOld (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOld (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOlder (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOlder (const std::string &param_name, const unsigned int index=0) const
 
virtual const PostprocessorValuegetPostprocessorValueByName (const PostprocessorName &name) const
 
virtual const PostprocessorValuegetPostprocessorValueByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOldByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOldByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOlderByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOlderByName (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 Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Static Public Member Functions

static InputParameters validParams ()
 
static void callMooseError (MooseApp *const app, const InputParameters &params, std::string msg, const bool with_prefix, const hit::Node *node, const bool show_trace=true)
 
static bool restricted (const std::set< BoundaryID > &ids)
 
static std::string deduceFunctorName (const std::string &name, const InputParameters &params)
 

Public Attributes

 ALL
 
 ANY
 
 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
 

Protected Member Functions

Real computeRequiredPressureFlux () const
 Compute the required boundary pressure flux contribution. More...
 
Real computeBoundaryAinv () const
 Compute the scalar A^{-1} coefficient, which is zero before the first momentum assembly. More...
 
std::string deduceFunctorName (const std::string &name) const
 
Real computeCellToFaceDistance () const
 
RealVectorValue computeCellToFaceVector () const
 
Moose::FaceArg singleSidedFaceArg (const FaceInfo *fi, Moose::FV::LimiterType limiter_type=Moose::FV::LimiterType::CentralDifference, bool correct_skewness=false) const
 
Moose::FaceArg functorFaceArg (const FunctorType &functor, const FaceInfo *fi, Moose::FV::LimiterType limiter_type=Moose::FV::LimiterType::CentralDifference, bool correct_skewness=false) const
 
void flagInvalidSolutionInternal (const InvalidSolutionID invalid_solution_id) const
 
InvalidSolutionID registerInvalidSolutionInternal (const std::string &message, const bool warning) const
 
bool hasBoundaryMaterialPropertyHelper (const std::string &prop_name) const
 
KOKKOS_FUNCTION dof_id_type numKokkosBoundaryNodes () const
 
KOKKOS_FUNCTION dof_id_type numKokkosBoundarySides () const
 
KOKKOS_FUNCTION ContiguousNodeID kokkosBoundaryNodeID (Moose::Kokkos::ThreadID tid) const
 
KOKKOS_FUNCTION auto kokkosBoundaryElementSideID (Moose::Kokkos::ThreadID tid) const
 
virtual void addUserObjectDependencyHelper (const UserObjectBase &) const
 
virtual void addPostprocessorDependencyHelper (const PostprocessorName &) const
 
virtual void addVectorPostprocessorDependencyHelper (const VectorPostprocessorName &) const
 
void prepareVectorTag (Assembly &assembly, unsigned int ivar)
 
void prepareVectorTag (Assembly &assembly, unsigned int ivar, ResidualTagType tag_type)
 
void prepareVectorTag (Assembly &assembly, unsigned int ivar, ResidualTagType tag_type)
 
void prepareVectorTag (Assembly &assembly, unsigned int ivar, ResidualTagType tag_type)
 
void prepareVectorTagNeighbor (Assembly &assembly, unsigned int ivar)
 
void prepareVectorTagLower (Assembly &assembly, unsigned int ivar)
 
void prepareMatrixTag (Assembly &assembly, unsigned int ivar, unsigned int jvar)
 
void prepareMatrixTag (Assembly &assembly, unsigned int ivar, unsigned int jvar, DenseMatrix< Number > &k) const
 
void prepareMatrixTagNonlocal (Assembly &assembly, unsigned int ivar, unsigned int jvar)
 
void prepareMatrixTagNeighbor (Assembly &assembly, unsigned int ivar, unsigned int jvar, Moose::DGJacobianType type)
 
void prepareMatrixTagNeighbor (Assembly &assembly, unsigned int ivar, unsigned int jvar, Moose::DGJacobianType type, DenseMatrix< Number > &k) const
 
void prepareMatrixTagLower (Assembly &assembly, unsigned int ivar, unsigned int jvar, Moose::ConstraintJacobianType type)
 
void accumulateTaggedLocalResidual ()
 
void assignTaggedLocalResidual ()
 
void accumulateTaggedLocalMatrix ()
 
void accumulateTaggedLocalMatrix (Assembly &assembly, unsigned int ivar, unsigned int jvar, const DenseMatrix< Number > &k)
 
void accumulateTaggedLocalMatrix (Assembly &assembly, unsigned int ivar, unsigned int jvar, Moose::DGJacobianType type, const DenseMatrix< Number > &k)
 
void accumulateTaggedNonlocalMatrix ()
 
void assignTaggedLocalMatrix ()
 
void addResiduals (Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
 
void addResiduals (Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, const std::vector< Real > &scaling_factors)
 
void addResiduals (Assembly &assembly, const DenseVector< T > &residuals, const Indices &dof_indices, Real scaling_factor)
 
void addResiduals (Assembly &assembly, const ADResidualsPacket &packet)
 
void addResidualsAndJacobian (Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
 
void addResidualsAndJacobian (Assembly &assembly, const ADResidualsPacket &packet)
 
void addJacobian (Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
 
void addJacobian (Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, const std::vector< Real > &scaling_factors)
 
void addJacobian (Assembly &assembly, const ADResidualsPacket &packet)
 
void addJacobian (Assembly &assembly, const DenseMatrix< Real > &local_k, const std::vector< dof_id_type > &row_indices, const std::vector< dof_id_type > &column_indices, Real scaling_factor)
 
void addResidualsWithoutConstraints (Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
 
void addResidualsAndJacobianWithoutConstraints (Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
 
void addJacobianWithoutConstraints (Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
 
void addJacobianElement (Assembly &assembly, Real value, dof_id_type row_index, dof_id_type column_index, Real scaling_factor)
 
void setResidual (SystemBase &sys, const T &residual, MooseVariableFE< T > &var)
 
void setResidual (SystemBase &sys, Real residual, dof_id_type dof_index)
 
void setResidual (SystemBase &sys, SetResidualFunctor set_residual_functor)
 
virtual const OutputTools< Real >::VariableValuevalue ()
 
virtual const OutputTools< Real >::VariableValuevalueOld ()
 
virtual const OutputTools< Real >::VariableValuevalueOlder ()
 
virtual const OutputTools< Real >::VariableValuedot ()
 
virtual const OutputTools< Real >::VariableValuedotDot ()
 
virtual const OutputTools< Real >::VariableValuedotOld ()
 
virtual const OutputTools< Real >::VariableValuedotDotOld ()
 
virtual const VariableValuedotDu ()
 
virtual const VariableValuedotDotDu ()
 
virtual const OutputTools< Real >::VariableGradientgradient ()
 
virtual const OutputTools< Real >::VariableGradientgradientOld ()
 
virtual const OutputTools< Real >::VariableGradientgradientOlder ()
 
virtual const OutputTools< Real >::VariableSecondsecond ()
 
virtual const OutputTools< Real >::VariableSecondsecondOld ()
 
virtual const OutputTools< Real >::VariableSecondsecondOlder ()
 
virtual const OutputTools< Real >::VariableTestSecondsecondTest ()
 
virtual const OutputTools< Real >::VariableTestSecondsecondTestFace ()
 
virtual const OutputTools< Real >::VariablePhiSecondsecondPhi ()
 
virtual const OutputTools< Real >::VariablePhiSecondsecondPhiFace ()
 
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)
 

Protected Attributes

const Moose::Functor< Real > & _HbyA_flux
 The H/A flux functor for this BC (can be variable, function, etc) More...
 
const Moose::Functor< RealVectorValue > & _Ainv
 The functor for the 1/A tensor serving as a diffusion coefficient. More...
 
const unsigned short _dim
 Spatial dimension of the mesh. More...
 
const bool _two_term_expansion
 Whether to reconstruct the boundary pressure with the pressure flux and cell gradient. More...
 
const Moose::Functor< Real > & _u
 Velocity functors used to prescribe a boundary mass flux. More...
 
const Moose::Functor< Real > *const _v
 
const Moose::Functor< Real > *const _w
 
const Moose::Functor< Real > & _rho
 Density functor used with the prescribed boundary velocity. More...
 
const THREAD_ID _tid
 
SubProblem_subproblem
 
MooseMesh_mesh
 
FEProblemBase_fv_problem
 
MooseLinearVariableFV< Real > & _var
 
SystemBase_sys
 
const FaceInfo_current_face_info
 
FaceInfo::VarFaceNeighbors _current_face_type
 
const unsigned int _var_num
 
const unsigned int _sys_num
 
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
 
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
 
GeometricSearchData_geometric_search_data
 
bool _requires_geometric_search
 
FEProblemBase_mci_feproblem
 
DenseVector< Number_local_re
 
DenseMatrix< Number_local_ke
 
DenseMatrix< Number_nonlocal_ke
 
bool _nodal
 
MooseVariableFE< Real > * _variable
 
MooseVariableFV< Real > * _fv_variable
 
MooseLinearVariableFV< Real > * _linear_fv_variable
 
MooseVariableField< Real > * _field_variable
 
Assembly_mvi_assembly
 
const Parallel::Communicator & _communicator
 

Detailed Description

Class implementing a flux boundary condition for linear finite volume pressure variables used in the pressure corrector equation which is consistent with the H/A flux and a prescribed boundary velocity.

This allows the pressure boundary flux to be consistent with a non-zero boundary mass flux and the boundary pressure to be reconstructed for a diagonal anisotropic inverse momentum tensor.

Definition at line 21 of file LinearFVPressureFluxBC.h.

Constructor & Destructor Documentation

◆ LinearFVPressureFluxBC()

LinearFVPressureFluxBC::LinearFVPressureFluxBC ( const InputParameters parameters)

Class constructor.

Parameters
parametersThe InputParameters for the object

Definition at line 40 of file LinearFVPressureFluxBC.C.

42  _HbyA_flux(getFunctor<Real>("HbyA_flux")),
43  _Ainv(getFunctor<RealVectorValue>("Ainv")),
45  _two_term_expansion(getParam<bool>("use_two_term_expansion")),
46  _u(getFunctor<Real>("u")),
47  _v(parameters.isParamValid("v") ? &getFunctor<Real>("v") : nullptr),
48  _w(parameters.isParamValid("w") ? &getFunctor<Real>("w") : nullptr),
49  _rho(getFunctor<Real>(NS::density))
50 {
51  if (_dim >= 2 && !_v)
52  paramError("v", "The 'v' boundary velocity functor must be provided for 2D and 3D problems.");
53 
54  if (_dim >= 3 && !_w)
55  paramError("w", "The 'w' boundary velocity functor must be provided for 3D problems.");
56 
57  if (_dim < 2 && _v)
58  paramError("v", "The 'v' boundary velocity functor is only valid in 2D and 3D problems.");
59 
60  if (_dim < 3 && _w)
61  paramError("w", "The 'w' boundary velocity functor is only valid in 3D problems.");
62 
65 }
virtual MooseMesh & mesh()=0
void paramError(const std::string &param, Args... args) const
const Moose::Functor< Real > & _rho
Density functor used with the prescribed boundary velocity.
const InputParameters & parameters() const
static const std::string density
Definition: NS.h:34
LinearFVAdvectionDiffusionBC(const InputParameters &parameters)
const Moose::Functor< Real > *const _v
const bool _two_term_expansion
Whether to reconstruct the boundary pressure with the pressure flux and cell gradient.
const Moose::Functor< RealVectorValue > & _Ainv
The functor for the 1/A tensor serving as a diffusion coefficient.
virtual unsigned int dimension() const
MooseLinearVariableFV< Real > & _var
const unsigned short _dim
Spatial dimension of the mesh.
const Moose::Functor< Real > *const _w
const Moose::Functor< Real > & _u
Velocity functors used to prescribe a boundary mass flux.
const Moose::Functor< Real > & _HbyA_flux
The H/A flux functor for this BC (can be variable, function, etc)
bool isParamValid(const std::string &name) const

Member Function Documentation

◆ computeBoundaryAinv()

Real LinearFVPressureFluxBC::computeBoundaryAinv ( ) const
protected

Compute the scalar A^{-1} coefficient, which is zero before the first momentum assembly.

Definition at line 94 of file LinearFVPressureFluxBC.C.

Referenced by computeBoundaryNormalGradient(), and computeBoundaryValue().

95 {
96  const auto face_arg = singleSidedFaceArg(_current_face_info);
97  const auto face_ainv = _Ainv(face_arg, determineState());
98  const auto & normal = _current_face_info->normal();
99 
100  // Match the boundary-normal coefficient used by LinearFVAnisotropicDiffusion:
101  // for a diagonal tensor Ainv, the effective normal coefficient is n^T Ainv n.
102  Real normal_ainv = 0.0;
103  for (const auto i : make_range(_dim))
104  normal_ainv += normal(i) * normal(i) * face_ainv(i);
105 
106  if (normal_ainv < 0.0)
107  mooseError("The boundary-normal Ainv coefficient must be nonnegative, but its value is ",
108  normal_ainv,
109  ".");
110 
111  return normal_ainv;
112 }
Moose::StateArg determineState() const
const Moose::Functor< RealVectorValue > & _Ainv
The functor for the 1/A tensor serving as a diffusion coefficient.
const Point & normal() const
const unsigned short _dim
Spatial dimension of the mesh.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const FaceInfo * _current_face_info
IntRange< T > make_range(T beg, T end)
void mooseError(Args &&... args) const
Moose::FaceArg singleSidedFaceArg(const FaceInfo *fi, Moose::FV::LimiterType limiter_type=Moose::FV::LimiterType::CentralDifference, bool correct_skewness=false) const

◆ computeBoundaryGradientMatrixContribution()

Real LinearFVPressureFluxBC::computeBoundaryGradientMatrixContribution ( ) const
overridevirtual

Implements LinearFVAdvectionDiffusionBC.

Definition at line 190 of file LinearFVPressureFluxBC.C.

191 {
192  return 0.0;
193 }

◆ computeBoundaryGradientRHSContribution()

Real LinearFVPressureFluxBC::computeBoundaryGradientRHSContribution ( ) const
overridevirtual

Implements LinearFVAdvectionDiffusionBC.

Definition at line 196 of file LinearFVPressureFluxBC.C.

197 {
198  return -computeRequiredPressureFlux();
199 }
Real computeRequiredPressureFlux() const
Compute the required boundary pressure flux contribution.

◆ computeBoundaryNormalGradient()

Real LinearFVPressureFluxBC::computeBoundaryNormalGradient ( ) const
overridevirtual

Implements LinearFVAdvectionDiffusionBC.

Definition at line 144 of file LinearFVPressureFluxBC.C.

Referenced by computeBoundaryValue().

145 {
146  if (!_two_term_expansion)
147  return 0.0;
148 
149  const Real normal_ainv = computeBoundaryAinv();
150  if (normal_ainv == 0.0)
151  return 0.0;
152 
153  const auto state = determineState();
154  const auto face_ainv = _Ainv(singleSidedFaceArg(_current_face_info), state);
155  const auto elem_info = _current_face_type == FaceInfo::VarFaceNeighbors::ELEM
158  const Real boundary_normal_multiplier =
160  const auto boundary_normal = boundary_normal_multiplier * _current_face_info->normal();
161 
162  RealVectorValue normal_scaled_ainv;
163  for (const auto i : make_range(_dim))
164  normal_scaled_ainv(i) = boundary_normal(i) * face_ainv(i);
165 
166  // The prescribed pressure flux is the complete tensor-weighted flux. Subtract its tangential
167  // part only when inverting that flux to reconstruct the boundary-normal pressure gradient.
168  const auto tangential_ainv = normal_scaled_ainv - normal_ainv * boundary_normal;
169  const Real tangential_pressure_flux = tangential_ainv * _var.gradSln(*elem_info, state);
170 
171  return (-computeRequiredPressureFlux() - tangential_pressure_flux) / normal_ainv;
172 }
Moose::StateArg determineState() const
const ElemInfo * neighborInfo() const
const ElemInfo * elemInfo() const
VectorValue< Real > gradSln(const ElemInfo &elem_info, const StateArg &state) const
const bool _two_term_expansion
Whether to reconstruct the boundary pressure with the pressure flux and cell gradient.
const Moose::Functor< RealVectorValue > & _Ainv
The functor for the 1/A tensor serving as a diffusion coefficient.
FaceInfo::VarFaceNeighbors _current_face_type
const Point & normal() const
Real computeRequiredPressureFlux() const
Compute the required boundary pressure flux contribution.
Real computeBoundaryAinv() const
Compute the scalar A^{-1} coefficient, which is zero before the first momentum assembly.
MooseLinearVariableFV< Real > & _var
const unsigned short _dim
Spatial dimension of the mesh.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const FaceInfo * _current_face_info
IntRange< T > make_range(T beg, T end)
Moose::FaceArg singleSidedFaceArg(const FaceInfo *fi, Moose::FV::LimiterType limiter_type=Moose::FV::LimiterType::CentralDifference, bool correct_skewness=false) const

◆ computeBoundaryValue()

Real LinearFVPressureFluxBC::computeBoundaryValue ( ) const
overridevirtual

Implements LinearFVAdvectionDiffusionBC.

Definition at line 115 of file LinearFVPressureFluxBC.C.

Referenced by computeBoundaryValueRHSContribution().

116 {
117  const auto state = determineState();
118  const auto elem_info = _current_face_type == FaceInfo::VarFaceNeighbors::ELEM
121 
122  if (!_two_term_expansion)
123  return _var.getElemValue(*elem_info, state);
124 
125  const Real normal_ainv = computeBoundaryAinv();
126 
127  // Ainv is initialized to zero and is first populated by the momentum assembly. Until then, use
128  // the cell pressure (1 term expansion) for the initial pressure-gradient
129  // calculation.
130  if (normal_ainv == 0.0)
131  return _var.getElemValue(*elem_info, state);
132 
134  const auto d_cf = computeCellToFaceVector();
135  const auto & face_normal = _current_face_info->normal();
136  const auto tangential_cell_to_face = d_cf - (d_cf * face_normal) * face_normal;
137 
138  // Return the 2-term expansion for the boundary value
139  return _var.getElemValue(*elem_info, state) + computeBoundaryNormalGradient() * distance +
140  _var.gradSln(*elem_info, state) * tangential_cell_to_face;
141 }
RealVectorValue computeCellToFaceVector() const
Real computeCellToFaceDistance() const
Moose::StateArg determineState() const
const ElemInfo * neighborInfo() const
virtual Real computeBoundaryNormalGradient() const override
const ElemInfo * elemInfo() const
Real distance(const Point &p)
VectorValue< Real > gradSln(const ElemInfo &elem_info, const StateArg &state) const
const bool _two_term_expansion
Whether to reconstruct the boundary pressure with the pressure flux and cell gradient.
FaceInfo::VarFaceNeighbors _current_face_type
const Point & normal() const
Real computeBoundaryAinv() const
Compute the scalar A^{-1} coefficient, which is zero before the first momentum assembly.
MooseLinearVariableFV< Real > & _var
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const FaceInfo * _current_face_info
Real getElemValue(const ElemInfo &elem_info, const StateArg &state) const

◆ computeBoundaryValueMatrixContribution()

Real LinearFVPressureFluxBC::computeBoundaryValueMatrixContribution ( ) const
overridevirtual

Implements LinearFVAdvectionDiffusionBC.

Definition at line 175 of file LinearFVPressureFluxBC.C.

176 {
177  return 1.0;
178 }

◆ computeBoundaryValueRHSContribution()

Real LinearFVPressureFluxBC::computeBoundaryValueRHSContribution ( ) const
overridevirtual

Implements LinearFVAdvectionDiffusionBC.

Definition at line 181 of file LinearFVPressureFluxBC.C.

182 {
183  const auto elem_info = _current_face_type == FaceInfo::VarFaceNeighbors::ELEM
186  return computeBoundaryValue() - _var.getElemValue(*elem_info, determineState());
187 }
Moose::StateArg determineState() const
const ElemInfo * neighborInfo() const
const ElemInfo * elemInfo() const
FaceInfo::VarFaceNeighbors _current_face_type
MooseLinearVariableFV< Real > & _var
const FaceInfo * _current_face_info
Real getElemValue(const ElemInfo &elem_info, const StateArg &state) const
virtual Real computeBoundaryValue() const override

◆ computeRequiredPressureFlux()

Real LinearFVPressureFluxBC::computeRequiredPressureFlux ( ) const
protected

Compute the required boundary pressure flux contribution.

Definition at line 68 of file LinearFVPressureFluxBC.C.

Referenced by computeBoundaryGradientRHSContribution(), and computeBoundaryNormalGradient().

69 {
70  const auto face_arg = singleSidedFaceArg(_current_face_info);
71  const auto state = determineState();
72 
73  Real required_pressure_flux = _HbyA_flux(face_arg, state);
74  const auto & normal = _current_face_info->normal();
75  Real boundary_velocity_dot_normal = _u(face_arg, state) * normal(0);
76 
77  if (_dim >= 2)
78  boundary_velocity_dot_normal += (*_v)(face_arg, state) * normal(1);
79 
80  if (_dim >= 3)
81  boundary_velocity_dot_normal += (*_w)(face_arg, state) * normal(2);
82 
83  // FaceInfo normals point from element to neighbor, so reverse the prescribed velocity flux when
84  // this boundary condition acts on the neighbor side of an internal face.
85  const Real boundary_normal_multiplier =
87  required_pressure_flux +=
88  _rho(face_arg, state) * boundary_normal_multiplier * boundary_velocity_dot_normal;
89 
90  return required_pressure_flux;
91 }
const Moose::Functor< Real > & _rho
Density functor used with the prescribed boundary velocity.
Moose::StateArg determineState() const
FaceInfo::VarFaceNeighbors _current_face_type
const Point & normal() const
const unsigned short _dim
Spatial dimension of the mesh.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const FaceInfo * _current_face_info
const Moose::Functor< Real > & _u
Velocity functors used to prescribe a boundary mass flux.
Moose::FaceArg singleSidedFaceArg(const FaceInfo *fi, Moose::FV::LimiterType limiter_type=Moose::FV::LimiterType::CentralDifference, bool correct_skewness=false) const
const Moose::Functor< Real > & _HbyA_flux
The H/A flux functor for this BC (can be variable, function, etc)

◆ includesMaterialPropertyMultiplier()

virtual bool LinearFVPressureFluxBC::includesMaterialPropertyMultiplier ( ) const
inlineoverridevirtual

Reimplemented from LinearFVAdvectionDiffusionBC.

Definition at line 44 of file LinearFVPressureFluxBC.h.

44 { return true; }

◆ providesCompleteBoundaryFlux()

virtual bool LinearFVPressureFluxBC::providesCompleteBoundaryFlux ( ) const
inlineoverridevirtual

Reimplemented from LinearFVAdvectionDiffusionBC.

Definition at line 46 of file LinearFVPressureFluxBC.h.

46 { return true; }

◆ validParams()

InputParameters LinearFVPressureFluxBC::validParams ( )
static

Definition at line 16 of file LinearFVPressureFluxBC.C.

17 {
19  params.addClassDescription(
20  "Adds a fixed diffusive flux BC which can be used for the assembly of linear "
21  "finite volume system and whose normal face gradient values are determined "
22  "using the H/A flux and a prescribed boundary velocity. This boundary condition is only "
23  "designed to work with advection-diffusion problems.");
24  params.addRequiredParam<MooseFunctorName>("HbyA_flux", "The total HbyA face flux value.");
25  params.addRequiredParam<MooseFunctorName>(
26  "Ainv", "The 1/A where A is the momentum system diagonal vector.");
27  params.addParam<bool>(
28  "use_two_term_expansion",
29  true,
30  "Whether to reconstruct the boundary pressure using the pressure flux and cell gradient. If "
31  "false, the boundary pressure is approximated by the adjacent cell pressure.");
32  params.addRequiredParam<MooseFunctorName>("u", "The x-velocity functor on the boundary.");
33  params.addParam<MooseFunctorName>("v", "The y-velocity functor on the boundary.");
34  params.addParam<MooseFunctorName>("w", "The z-velocity functor on the boundary.");
35  params.addRequiredParam<MooseFunctorName>(
36  NS::density, "The density functor used together with the prescribed boundary velocity.");
37  return params;
38 }
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
static const std::string density
Definition: NS.h:34
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()

Member Data Documentation

◆ _Ainv

const Moose::Functor<RealVectorValue>& LinearFVPressureFluxBC::_Ainv
protected

The functor for the 1/A tensor serving as a diffusion coefficient.

Definition at line 59 of file LinearFVPressureFluxBC.h.

Referenced by computeBoundaryAinv(), and computeBoundaryNormalGradient().

◆ _dim

const unsigned short LinearFVPressureFluxBC::_dim
protected

Spatial dimension of the mesh.

Definition at line 62 of file LinearFVPressureFluxBC.h.

Referenced by computeBoundaryAinv(), computeBoundaryNormalGradient(), computeRequiredPressureFlux(), and LinearFVPressureFluxBC().

◆ _HbyA_flux

const Moose::Functor<Real>& LinearFVPressureFluxBC::_HbyA_flux
protected

The H/A flux functor for this BC (can be variable, function, etc)

Definition at line 56 of file LinearFVPressureFluxBC.h.

Referenced by computeRequiredPressureFlux().

◆ _rho

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

Density functor used with the prescribed boundary velocity.

Definition at line 73 of file LinearFVPressureFluxBC.h.

Referenced by computeRequiredPressureFlux().

◆ _two_term_expansion

const bool LinearFVPressureFluxBC::_two_term_expansion
protected

Whether to reconstruct the boundary pressure with the pressure flux and cell gradient.

Definition at line 65 of file LinearFVPressureFluxBC.h.

Referenced by computeBoundaryNormalGradient(), computeBoundaryValue(), and LinearFVPressureFluxBC().

◆ _u

const Moose::Functor<Real>& LinearFVPressureFluxBC::_u
protected

Velocity functors used to prescribe a boundary mass flux.

Definition at line 68 of file LinearFVPressureFluxBC.h.

Referenced by computeRequiredPressureFlux().

◆ _v

const Moose::Functor<Real>* const LinearFVPressureFluxBC::_v
protected

Definition at line 69 of file LinearFVPressureFluxBC.h.

Referenced by LinearFVPressureFluxBC().

◆ _w

const Moose::Functor<Real>* const LinearFVPressureFluxBC::_w
protected

Definition at line 70 of file LinearFVPressureFluxBC.h.

Referenced by LinearFVPressureFluxBC().


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