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

Kernel that implements the stress tensor and advection terms for the momentum equation. More...

#include <LinearWCNSFVMomentumFlux.h>

Inheritance diagram for LinearWCNSFVMomentumFlux:
[legend]

Public Types

enum  ResidualTagType
 
typedef DataFileName DataFileParameterType
 

Public Member Functions

 LinearWCNSFVMomentumFlux (const InputParameters &params)
 Class constructor.
 
virtual Real computeElemMatrixContribution () override
 
virtual Real computeNeighborMatrixContribution () override
 
virtual Real computeElemRightHandSideContribution () override
 
virtual Real computeNeighborRightHandSideContribution () override
 
virtual Real computeBoundaryMatrixContribution (const LinearFVBoundaryCondition &bc) override
 
virtual Real computeBoundaryRHSContribution (const LinearFVBoundaryCondition &bc) override
 
virtual void setupFaceData (const FaceInfo *face_info) override
 Set the current FaceInfo object.
 
virtual void addMatrixContribution () override
 
virtual void addRightHandSideContribution () override
 
virtual bool hasFaceSide (const FaceInfo &fi, bool fi_elem_side) const override
 
void setCurrentFaceArea (const Real area)
 
virtual Real computeBoundaryFlux (const LinearFVBoundaryCondition &bc)
 
virtual const MooseLinearVariableFV< Real > & variable () const override
 
void linkTaggedVectorsAndMatrices (const std::set< TagID > &vector_tags, const std::set< TagID > &matrix_tags)
 
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 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
 
void setRandomResetFrequency (ExecFlagType exec_flag)
 
unsigned long getRandomLong () const
 
Real getRandomReal () const
 
unsigned int getSeed (std::size_t id)
 
unsigned int getMasterSeed () const
 
bool isNodal () const
 
ExecFlagType getResetOnTime () const
 
void setRandomDataPointer (RandomData *random_data)
 
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
 
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 MooseVariableFieldBase &variable) const
 
const Moose::Functor< Real > * defaultFunctor (const std::string &name)
 
const Moose::Functor< ADReal > * defaultFunctor (const std::string &name)
 
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
 
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
 
const FVFaceInterpolationMethodgetFVFaceInterpolationMethod (const InterpolationMethodName &name) const
 
const FVAdvectedInterpolationMethodgetFVAdvectedInterpolationMethod (const InterpolationMethodName &name) const
 
bool hasFVInterpolationMethod (const InterpolationMethodName &name) 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 std::string deduceFunctorName (const std::string &name, const InputParameters &params)
 
static void setRMParamsAdvection (const InputParameters &obj_params, InputParameters &rm_params, const unsigned short conditional_extended_layers)
 
static void setRMParamsDiffusion (const InputParameters &obj_params, InputParameters &rm_params, const unsigned short conditional_extended_layers)
 

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
 

Protected Member Functions

Real computeInternalAdvectionElemMatrixContribution ()
 Computes the matrix contribution of the advective flux on the element side of current face when the face is an internal face (doesn't have associated boundary conditions).
 
Real computeInternalAdvectionNeighborMatrixContribution ()
 Computes the matrix contribution of the advective flux on the neighbor side of current face when the face is an internal face (doesn't have associated boundary conditions).
 
Real computeInternalStressMatrixContribution ()
 Computes the matrix contribution of the stress term on the current face when the face is an internal face (doesn't have associated boundary conditions).
 
Real computeInternalStressRHSContribution ()
 Computes the right hand side contribution of the stress term on the current face when the face is an internal face (doesn't have associated boundary conditions).
 
Real computeStressBoundaryMatrixContribution (const LinearFVAdvectionDiffusionBC *bc)
 Computes the matrix contributions of the boundary conditions resulting from the stress tensor.
 
Real computeStressBoundaryRHSContribution (const LinearFVAdvectionDiffusionBC *bc)
 Computes the right hand side contributions of the boundary conditions resulting from the stress tensor.
 
Real computeAdvectionBoundaryMatrixContribution (const LinearFVAdvectionDiffusionBC *bc)
 Computes the matrix contributions of the boundary conditions resulting from the advection term.
 
Real computeAdvectionBoundaryRHSContribution (const LinearFVAdvectionDiffusionBC *bc)
 Computes the right hand side contributions of the boundary conditions resulting from the advection term.
 
const MooseLinearVariableFVRealvelocityVar (unsigned int dir) const
 Helper to access the velocity variable for a given direction.
 
std::string deduceFunctorName (const std::string &name) const
 
Moose::FaceArg singleSidedFaceArg (const FaceInfo *fi, Moose::FV::LimiterType limiter_type=Moose::FV::LimiterType::CentralDifference, bool correct_skewness=false) const
 
void requestVariableCellGradient (const std::string &variable_name)
 
void flagInvalidSolutionInternal (const InvalidSolutionID invalid_solution_id) const
 
InvalidSolutionID registerInvalidSolutionInternal (const std::string &message, const bool warning) const
 
virtual void addUserObjectDependencyHelper (const UserObjectBase &) const
 
virtual void addPostprocessorDependencyHelper (const PostprocessorName &) const
 
virtual void addVectorPostprocessorDependencyHelper (const VectorPostprocessorName &) const
 
TdeclareRestartableData (const std::string &data_name, Args &&... args)
 
ManagedValue< TdeclareManagedRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
const TgetRestartableData (const std::string &data_name) const
 
TdeclareRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
TdeclareRecoverableData (const std::string &data_name, Args &&... args)
 
TdeclareRestartableDataWithObjectName (const std::string &data_name, const std::string &object_name, Args &&... args)
 
TdeclareRestartableDataWithObjectNameWithContext (const std::string &data_name, const std::string &object_name, void *context, Args &&... args)
 
std::string restartableName (const std::string &data_name) 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 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 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
 
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)
 
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 ()
 

Protected Attributes

const unsigned int _dim
 The dimension of the mesh.
 
const RhieChowMassFlux_mass_flux_provider
 The Rhie-Chow user object that provides us with the face velocity.
 
const Moose::Functor< Real > & _mu
 The functor for the dynamic viscosity.
 
const bool _use_nonorthogonal_correction
 Switch to enable/disable nonorthogonal correction in the stress term.
 
const bool _use_deviatoric_terms
 Switch to enable/disable deviatoric parts in the stress term.
 
const FVAdvectedInterpolationMethod_adv_interp_method
 The interpolation method to use for the advected quantity.
 
FVAdvectedInterpolationMethod::AdvectedSystemContribution _adv_interp_result
 Current advected interpolation contribution on the face.
 
VectorValue< Real > _elem_grad_storage
 Reusable gradient storage used when advected interpolation requires gradients.
 
VectorValue< Real > _neighbor_grad_storage
 
Real _face_mass_flux
 Container for the mass flux on the face which will be reused in the advection term's matrix and right hand side contribution.
 
Real _boundary_normal_factor
 Multiplier that ensures the normal of the boundary always points outwards, even in cases when the boundary is within the mesh.
 
Real _stress_matrix_contribution
 The cached matrix contribution.
 
Real _stress_rhs_contribution
 The cached right hand side contribution.
 
const unsigned int _index
 Index x|y|z, this is mainly to handle the deviatoric parts correctly in in the stress term.
 
std::array< const MooseLinearVariableFVReal *, 3 > _velocity_vars
 Velocity variables for each coordinate direction.
 
const Moose::CoordinateSystemType _coord_type
 Coordinate system of the blocks this kernel operates on.
 
const unsigned int _rz_radial_coord
 Axisymmetric radial coordinate index (only used when in RZ)
 
const FaceInfo_current_face_info
 
Real _current_face_area
 
FaceInfo::VarFaceNeighbors _current_face_type
 
bool _cached_matrix_contribution
 
bool _cached_rhs_contribution
 
const bool _force_boundary_execution
 
DenseVector< dof_id_type > _dof_indices
 
DenseMatrix< Real > _matrix_contribution
 
DenseVector< Real > _rhs_contribution
 
MooseLinearVariableFV< Real > & _var
 
const unsigned int _var_num
 
const unsigned int _sys_num
 
FEProblemBase_fe_problem
 
SystemBase_sys
 
libMesh::LinearImplicitSystem_linear_system
 
const THREAD_ID _tid
 
MooseMesh_mesh
 
std::vector< NumericVector< Number > * > _vectors
 
std::vector< SparseMatrix< Number > * > _matrices
 
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
 
MooseApp_restartable_app
 
const std::string _restartable_system_name
 
const THREAD_ID _restartable_tid
 
const bool _restartable_read_only
 
FEProblemBase_mci_feproblem
 
SubProblem_subproblem
 
DenseVector< Number > _local_re
 
DenseMatrix< Number > _local_ke
 
DenseMatrix< Number > _nonlocal_ke
 
const MaterialData_blk_material_data
 
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
 
const InputParameters_fvim_params
 
FEProblemBase_fvim_feproblem
 
const THREAD_ID _fvim_tid
 

Private Member Functions

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)
 
const Moose::FunctionBasegetKokkosFunctionByNameHelper (const FunctionName &name) const
 
const UserObjectBasegetUserObjectFromFEProblem (const UserObjectName &object_name, const THREAD_ID tid=0) const
 
const TcastUserObject (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 VectorPostprocessorValuegetVectorPostprocessorByNameHelper (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
 
RestartableDataValueregisterRestartableDataOnApp (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
 
void prepareVectorTagInternal (Assembly &assembly, unsigned int ivar, const std::set< TagID > &vector_tags, const std::set< TagID > &absolute_value_vector_tags)
 
void checkForNans () const
 
virtual bool isADObject () const override
 
std::set< MooseVariableFieldBase * > checkVariablesHelper (const DofObjectType &dof_object, const std::set< MooseVariableFieldBase * > &vars_to_check)
 
const PostprocessorValuegetPostprocessorValueInternal (const std::string &param_name, unsigned int index, std::size_t t_index) const
 
const PostprocessorValuegetPostprocessorValueInternal (const std::string &param_name, unsigned int index, std::size_t t_index) const
 
const PostprocessorValuegetPostprocessorValueByNameInternal (const PostprocessorName &name, std::size_t t_index) const
 
const PostprocessorValuegetPostprocessorValueByNameInternal (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
 

Static Private Member Functions

static const hit::Node * getHitNode (const InputParameters &params)
 
static std::string messagePrefix (const InputParameters &params, const bool hit_prefix)
 
static void setRMParams (const InputParameters &obj_params, InputParameters &rm_params, const unsigned short ghost_layers)
 
static void parameterError (const InputParameters &obj_params, const std::string &parameter_name, const std::string &function_name, const std::string &description)
 

Private Attributes

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 std::string _ti_name
 
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
 
RandomData_random_data
 
MooseRandom_generator
 
FEProblemBase_ri_problem
 
const std::string _ri_name
 
unsigned int _master_seed
 
bool _is_nodal
 
ExecFlagType _reset_on
 
const Node *const & _curr_node
 
const Elem *const & _curr_element
 
const RestartableDataMapName _metaname
 
std::string _restartable_name
 
std::set< TagID_vector_tags
 
std::set< TagID_abs_vector_tags
 
std::set< TagID_matrix_tags
 
std::set< TagID_non_ref_vector_tags
 
std::set< TagID_non_ref_abs_vector_tags
 
std::set< TagID_ref_vector_tags
 
std::set< TagID_ref_abs_vector_tags
 
const MooseObject_moose_object
 
const InputParameters_tag_params
 
std::vector< DenseVector< Number > * > _re_blocks
 
std::vector< DenseVector< Number > * > _absre_blocks
 
std::vector< DenseMatrix< Number > * > _ke_blocks
 
std::vector< Real > _absolute_residuals
 
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
 
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
 
std::set< MooseVariableFieldBase * > _moose_variable_dependencies
 

Detailed Description

Kernel that implements the stress tensor and advection terms for the momentum equation.

Definition at line 26 of file LinearWCNSFVMomentumFlux.h.

Constructor & Destructor Documentation

◆ LinearWCNSFVMomentumFlux()

LinearWCNSFVMomentumFlux::LinearWCNSFVMomentumFlux ( const InputParameters params)

Class constructor.

Parameters
paramsThe InputParameters for the kernel.

Definition at line 50 of file LinearWCNSFVMomentumFlux.C.

51 : LinearFVFluxKernel(params),
54 _mass_flux_provider(getUserObject<RhieChowMassFlux>("rhie_chow_user_object")),
55 _mu(getFunctor<Real>(getParam<MooseFunctorName>(NS::mu))),
56 _use_nonorthogonal_correction(getParam<bool>("use_nonorthogonal_correction")),
57 _use_deviatoric_terms(getParam<bool>("use_deviatoric_terms")),
59 getParam<InterpolationMethodName>("advected_interp_method_name"))),
60 _face_mass_flux(0.0),
64 _index(getParam<MooseEnum>("momentum_component")),
65 _velocity_vars{nullptr, nullptr, nullptr},
68{
69 // We only need gradients if the nonorthogonal correction is enabled or when we request the
70 // computation of the deviatoric parts of the stress tensor.
73
76
77 auto get_velocity_var = [&](const std::string & param_name)
78 {
79 return dynamic_cast<const MooseLinearVariableFVReal *>(
80 &_fe_problem.getVariable(_tid, getParam<SolverVariableName>(param_name)));
81 };
82
83 _velocity_vars[0] = get_velocity_var("u");
84 if (!_velocity_vars[0])
85 paramError("u", "the u velocity must be a MooseLinearVariableFVReal.");
86
87 if (_dim >= 2)
88 {
89 if (!params.isParamValid("v"))
90 paramError("v", "In two or more dimensions, the v velocity must be supplied.");
91 _velocity_vars[1] = get_velocity_var("v");
92 if (!_velocity_vars[1])
93 paramError("v",
94 "In two or more dimensions, the v velocity must be supplied and it must be a "
95 "MooseLinearVariableFVReal.");
96 }
97
98 if (_dim >= 3)
99 {
100 if (!params.isParamValid("w"))
101 paramError("w", "In three-dimensions, the w velocity must be supplied.");
102 _velocity_vars[2] = get_velocity_var("w");
103 if (!_velocity_vars[2])
104 paramError("w",
105 "In three-dimensions, the w velocity must be supplied and it must be a "
106 "MooseLinearVariableFVReal.");
107 }
108}
Moose::CoordinateSystemType getBlockCoordSystem()
virtual const MooseVariableFieldBase & getVariable(const THREAD_ID tid, const std::string &var_name, Moose::VarKindType expected_var_type=Moose::VarKindType::VAR_ANY, Moose::VarFieldType expected_var_field_type=Moose::VarFieldType::VAR_FIELD_ANY) const override
virtual MooseMesh & mesh() override
virtual Moose::FV::GradientLimiterType gradientLimiter() const
virtual bool needsGradients() const
const FVAdvectedInterpolationMethod & getFVAdvectedInterpolationMethod(const InterpolationMethodName &name) const
bool isParamValid(const std::string &name) const
MooseLinearVariableFV< Real > & _var
const THREAD_ID _tid
FEProblemBase & _fe_problem
Real _face_mass_flux
Container for the mass flux on the face which will be reused in the advection term's matrix and right...
const unsigned int _rz_radial_coord
Axisymmetric radial coordinate index (only used when in RZ)
const FVAdvectedInterpolationMethod & _adv_interp_method
The interpolation method to use for the advected quantity.
const Moose::CoordinateSystemType _coord_type
Coordinate system of the blocks this kernel operates on.
Real _stress_matrix_contribution
The cached matrix contribution.
const Moose::Functor< Real > & _mu
The functor for the dynamic viscosity.
Real _boundary_normal_factor
Multiplier that ensures the normal of the boundary always points outwards, even in cases when the bou...
Real _stress_rhs_contribution
The cached right hand side contribution.
const unsigned int _index
Index x|y|z, this is mainly to handle the deviatoric parts correctly in in the stress term.
const bool _use_deviatoric_terms
Switch to enable/disable deviatoric parts in the stress term.
std::array< const MooseLinearVariableFVReal *, 3 > _velocity_vars
Velocity variables for each coordinate direction.
const unsigned int _dim
The dimension of the mesh.
const bool _use_nonorthogonal_correction
Switch to enable/disable nonorthogonal correction in the stress term.
const RhieChowMassFlux & _mass_flux_provider
The Rhie-Chow user object that provides us with the face velocity.
void paramError(const std::string &param, Args... args) const
unsigned int getAxisymmetricRadialCoord() const
virtual unsigned int dimension() const
virtual MooseMesh & mesh()=0
SubProblem & _subproblem
static const std::string mu
Definition NS.h:127

Member Function Documentation

◆ computeAdvectionBoundaryMatrixContribution()

Real LinearWCNSFVMomentumFlux::computeAdvectionBoundaryMatrixContribution ( const LinearFVAdvectionDiffusionBC bc)
protected

Computes the matrix contributions of the boundary conditions resulting from the advection term.

Parameters
bcThe boundary condition whose contributions should be used

Definition at line 387 of file LinearWCNSFVMomentumFlux.C.

389{
390 const auto boundary_value_matrix_contrib = bc->computeBoundaryValueMatrixContribution();
391 return boundary_value_matrix_contrib * _face_mass_flux;
392}
virtual Real computeBoundaryValueMatrixContribution() const=0

Referenced by computeBoundaryMatrixContribution().

◆ computeAdvectionBoundaryRHSContribution()

Real LinearWCNSFVMomentumFlux::computeAdvectionBoundaryRHSContribution ( const LinearFVAdvectionDiffusionBC bc)
protected

Computes the right hand side contributions of the boundary conditions resulting from the advection term.

Parameters
bcThe boundary condition whose contributions should be used

Definition at line 395 of file LinearWCNSFVMomentumFlux.C.

397{
398 const auto boundary_value_rhs_contrib = bc->computeBoundaryValueRHSContribution();
399 return -boundary_value_rhs_contrib * _face_mass_flux;
400}
virtual Real computeBoundaryValueRHSContribution() const=0

Referenced by computeBoundaryRHSContribution().

◆ computeBoundaryMatrixContribution()

Real LinearWCNSFVMomentumFlux::computeBoundaryMatrixContribution ( const LinearFVBoundaryCondition bc)
overridevirtual

Implements LinearFVFluxKernel.

Definition at line 143 of file LinearWCNSFVMomentumFlux.C.

144{
145 const auto * const adv_diff_bc = static_cast<const LinearFVAdvectionDiffusionBC *>(&bc);
146
147 mooseAssert(adv_diff_bc, "This should be a valid BC!");
148 return (computeStressBoundaryMatrixContribution(adv_diff_bc) +
151}
Real computeAdvectionBoundaryMatrixContribution(const LinearFVAdvectionDiffusionBC *bc)
Computes the matrix contributions of the boundary conditions resulting from the advection term.
Real computeStressBoundaryMatrixContribution(const LinearFVAdvectionDiffusionBC *bc)
Computes the matrix contributions of the boundary conditions resulting from the stress tensor.

◆ computeBoundaryRHSContribution()

Real LinearWCNSFVMomentumFlux::computeBoundaryRHSContribution ( const LinearFVBoundaryCondition bc)
overridevirtual

Implements LinearFVFluxKernel.

Definition at line 154 of file LinearWCNSFVMomentumFlux.C.

155{
156 const auto * const adv_diff_bc = static_cast<const LinearFVAdvectionDiffusionBC *>(&bc);
157 mooseAssert(adv_diff_bc, "This should be a valid BC!");
158 return (computeStressBoundaryRHSContribution(adv_diff_bc) +
161}
Real computeAdvectionBoundaryRHSContribution(const LinearFVAdvectionDiffusionBC *bc)
Computes the right hand side contributions of the boundary conditions resulting from the advection te...
Real computeStressBoundaryRHSContribution(const LinearFVAdvectionDiffusionBC *bc)
Computes the right hand side contributions of the boundary conditions resulting from the stress tenso...

◆ computeElemMatrixContribution()

Real LinearWCNSFVMomentumFlux::computeElemMatrixContribution ( )
overridevirtual

Implements LinearFVFluxKernel.

Definition at line 111 of file LinearWCNSFVMomentumFlux.C.

112{
116}
Real computeInternalStressMatrixContribution()
Computes the matrix contribution of the stress term on the current face when the face is an internal ...
Real computeInternalAdvectionElemMatrixContribution()
Computes the matrix contribution of the advective flux on the element side of current face when the f...

◆ computeElemRightHandSideContribution()

Real LinearWCNSFVMomentumFlux::computeElemRightHandSideContribution ( )
overridevirtual

Implements LinearFVFluxKernel.

Definition at line 127 of file LinearWCNSFVMomentumFlux.C.

128{
132}
FVAdvectedInterpolationMethod::AdvectedSystemContribution _adv_interp_result
Current advected interpolation contribution on the face.
Real computeInternalStressRHSContribution()
Computes the right hand side contribution of the stress term on the current face when the face is an ...

◆ computeInternalAdvectionElemMatrixContribution()

Real LinearWCNSFVMomentumFlux::computeInternalAdvectionElemMatrixContribution ( )
protected

Computes the matrix contribution of the advective flux on the element side of current face when the face is an internal face (doesn't have associated boundary conditions).

Definition at line 164 of file LinearWCNSFVMomentumFlux.C.

Referenced by computeElemMatrixContribution().

◆ computeInternalAdvectionNeighborMatrixContribution()

Real LinearWCNSFVMomentumFlux::computeInternalAdvectionNeighborMatrixContribution ( )
protected

Computes the matrix contribution of the advective flux on the neighbor side of current face when the face is an internal face (doesn't have associated boundary conditions).

Definition at line 170 of file LinearWCNSFVMomentumFlux.C.

171{
173}

Referenced by computeNeighborMatrixContribution().

◆ computeInternalStressMatrixContribution()

Real LinearWCNSFVMomentumFlux::computeInternalStressMatrixContribution ( )
protected

Computes the matrix contribution of the stress term on the current face when the face is an internal face (doesn't have associated boundary conditions).

Definition at line 176 of file LinearWCNSFVMomentumFlux.C.

177{
178 // If we don't have the value yet, we compute it
180 {
181 const auto face_arg = makeCDFace(*_current_face_info);
182
183 // If we requested nonorthogonal correction, we use the normal component of the
184 // cell to face vector.
187 : _current_face_info->dCNMag();
188
189 // Cache the matrix contribution
192 }
193
195}
Moose::FaceArg makeCDFace(const FaceInfo &fi, const bool correct_skewness=false) const
const Point & normal() const
const Point & dCN() const
bool _cached_matrix_contribution
const FaceInfo * _current_face_info
Moose::StateArg determineState() const

Referenced by computeElemMatrixContribution(), and computeNeighborMatrixContribution().

◆ computeInternalStressRHSContribution()

Real LinearWCNSFVMomentumFlux::computeInternalStressRHSContribution ( )
protected

Computes the right hand side contribution of the stress term on the current face when the face is an internal face (doesn't have associated boundary conditions).

Definition at line 198 of file LinearWCNSFVMomentumFlux.C.

199{
200 // We can have contributions to the right hand side in two occasions:
201 // (1) when we use nonorthogonal correction for the normal gradients
202 // (2) when we request the deviatoric parts of the stress tensor. (needed for space-dependent
203 // viscosities for example)
205 {
206 // scenario (1), we need to add the nonorthogonal correction. In 1D, we don't have
207 // any correction so we just skip this part
209 {
210 const auto face_arg = makeCDFace(*_current_face_info);
211 const auto state_arg = determineState();
212
213 // Get the gradients from the adjacent cells
214 const auto grad_elem = _var.gradSln(*_current_face_info->elemInfo(), state_arg);
215 const auto & grad_neighbor = _var.gradSln(*_current_face_info->neighborInfo(), state_arg);
216
217 // Interpolate the two gradients to the face
218 const auto interp_coeffs =
219 interpCoeffs(Moose::FV::InterpMethod::Average, *_current_face_info, true);
220
221 const auto correction_vector =
225
226 // Cache the matrix contribution
228 _mu(face_arg, state_arg) *
229 (interp_coeffs.first * grad_elem + interp_coeffs.second * grad_neighbor) *
230 correction_vector;
231 }
232 // scenario (2), we will have to account for the deviatoric parts of the stress tensor.
234 {
235 const auto state_arg = determineState();
236
237 // Interpolate the two gradients to the face
238 const auto interp_coeffs =
239 interpCoeffs(Moose::FV::InterpMethod::Average, *_current_face_info, true);
240
241 RealGradient grad_elem[3];
242 RealGradient grad_neighbor[3];
243 Real trace_elem = 0;
244 Real trace_neighbor = 0;
245 RealVectorValue deviatoric_vector_elem;
246 RealVectorValue deviatoric_vector_neighbor;
247
248 // Loop over every velocity component so we can form the symmetric gradient pieces
249 for (const auto dir : make_range(_dim))
250 {
251 grad_elem[dir] = velocityVar(dir).gradSln(*_current_face_info->elemInfo(), state_arg);
252 grad_neighbor[dir] =
254 trace_elem += grad_elem[dir](dir);
255 trace_neighbor += grad_neighbor[dir](dir);
256 }
257
258 const auto face_arg = makeCDFace(*_current_face_info);
259
260 if (_coord_type == Moose::CoordinateSystemType::COORD_RZ)
261 {
262 Real elem_value = 0.0;
263 Real neighbor_value = 0.0;
264 const auto & radial_var = velocityVar(_rz_radial_coord);
265 elem_value = radial_var.getElemValue(*_current_face_info->elemInfo(), state_arg) /
267 neighbor_value = radial_var.getElemValue(*_current_face_info->neighborInfo(), state_arg) /
269
270 trace_elem += elem_value;
271 trace_neighbor += neighbor_value;
272 }
273
274 // Assemble the explicit transpose/trace contribution component by component
275 for (const auto dir : make_range(_dim))
276 {
277 grad_elem[dir](dir) -= 2. / 3 * trace_elem;
278 grad_neighbor[dir](dir) -= 2. / 3 * trace_neighbor;
279
280 deviatoric_vector_elem(dir) = grad_elem[dir](_index);
281 deviatoric_vector_neighbor(dir) = grad_neighbor[dir](_index);
282 }
283
284 _stress_rhs_contribution += _mu(face_arg, state_arg) *
285 (interp_coeffs.first * deviatoric_vector_elem +
286 interp_coeffs.second * deviatoric_vector_neighbor) *
288 }
290 }
291
293}
const Point & centroid() const
const Point & eCN() const
const ElemInfo * elemInfo() const
const ElemInfo * neighborInfo() const
const MooseLinearVariableFVReal & velocityVar(unsigned int dir) const
Helper to access the velocity variable for a given direction.
VectorValue< Real > gradSln(const ElemInfo &elem_info, const StateArg &state) const
std::pair< Real, Real > interpCoeffs(const InterpMethod m, const FaceInfo &fi, const bool one_is_elem, const T &face_flux=0.0)
VectorValue< Real > RealVectorValue
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
IntRange< T > make_range(T beg, T end)

Referenced by computeElemRightHandSideContribution(), and computeNeighborRightHandSideContribution().

◆ computeNeighborMatrixContribution()

Real LinearWCNSFVMomentumFlux::computeNeighborMatrixContribution ( )
overridevirtual

Implements LinearFVFluxKernel.

Definition at line 119 of file LinearWCNSFVMomentumFlux.C.

120{
124}
Real computeInternalAdvectionNeighborMatrixContribution()
Computes the matrix contribution of the advective flux on the neighbor side of current face when the ...

◆ computeNeighborRightHandSideContribution()

Real LinearWCNSFVMomentumFlux::computeNeighborRightHandSideContribution ( )
overridevirtual

◆ computeStressBoundaryMatrixContribution()

Real LinearWCNSFVMomentumFlux::computeStressBoundaryMatrixContribution ( const LinearFVAdvectionDiffusionBC bc)
protected

Computes the matrix contributions of the boundary conditions resulting from the stress tensor.

Parameters
bcThe boundary condition whose contributions should be used

Definition at line 296 of file LinearWCNSFVMomentumFlux.C.

298{
299 auto grad_contrib = bc->computeBoundaryGradientMatrixContribution();
300 // If the boundary condition does not include the diffusivity contribution then
301 // add it here.
303 {
304 const auto face_arg = singleSidedFaceArg(_current_face_info);
305 grad_contrib *= _mu(face_arg, determineState());
306 }
307
308 return grad_contrib;
309}
virtual Real computeBoundaryGradientMatrixContribution() const=0
virtual bool includesMaterialPropertyMultiplier() const
Moose::FaceArg singleSidedFaceArg(const FaceInfo *fi, Moose::FV::LimiterType limiter_type=Moose::FV::LimiterType::CentralDifference, bool correct_skewness=false) const

Referenced by computeBoundaryMatrixContribution().

◆ computeStressBoundaryRHSContribution()

Real LinearWCNSFVMomentumFlux::computeStressBoundaryRHSContribution ( const LinearFVAdvectionDiffusionBC bc)
protected

Computes the right hand side contributions of the boundary conditions resulting from the stress tensor.

Parameters
bcThe boundary condition whose contributions should be used

Definition at line 312 of file LinearWCNSFVMomentumFlux.C.

314{
315 const auto face_arg = singleSidedFaceArg(_current_face_info);
316 auto grad_contrib = bc->computeBoundaryGradientRHSContribution();
317 // If the boundary condition does not include the diffusivity contribution then
318 // add it here.
320 grad_contrib *= _mu(face_arg, determineState());
321
322 // We add the nonorthogonal corrector for the face here. Potential idea: we could do
323 // this in the boundary condition too. For now, however, we keep it like this.
325 {
326 // We support internal boundaries as well. In that case we have to decide on which side
327 // of the boundary we are on.
328 const auto elem_info = (_current_face_type == FaceInfo::VarFaceNeighbors::ELEM)
331
332 // Unit vector to the boundary. Unfortunately, we have to recompute it because the value
333 // stored in the face info is only correct for external boundaries
334 const auto e_Cf = _current_face_info->faceCentroid() - elem_info->centroid();
335 const auto correction_vector =
336 _current_face_info->normal() - 1 / (_current_face_info->normal() * e_Cf) * e_Cf;
337
338 const auto state_arg = determineState();
339 grad_contrib += _mu(face_arg, state_arg) * _var.gradSln(*elem_info, state_arg) *
340 _boundary_normal_factor * correction_vector;
341 }
342
343 // Complete prescribed fluxes already include all applicable stress contributions.
345 {
346 // We might be on a face which is an internal boundary so we want to make sure we
347 // get the gradient from the right side.
348 const auto elem_info = (_current_face_type == FaceInfo::VarFaceNeighbors::ELEM)
351
352 const auto state_arg = determineState();
353
354 RealGradient grad_elem[3];
355 Real trace_elem = 0;
356 RealVectorValue deviatoric_vector_elem;
357
358 for (const auto dir : make_range(_dim))
359 {
360 grad_elem[dir] = velocityVar(dir).gradSln(*elem_info, state_arg);
361 trace_elem += grad_elem[dir](dir);
362 }
363
364 if (_coord_type == Moose::CoordinateSystemType::COORD_RZ)
365 {
366 const auto & radial_var = velocityVar(_rz_radial_coord);
367 const Real elem_value =
368 radial_var.getElemValue(*elem_info, state_arg) / elem_info->centroid()(_rz_radial_coord);
369 trace_elem += elem_value;
370 }
371
372 for (const auto dir : make_range(_dim))
373 {
374 grad_elem[dir](dir) -= 2. / 3 * trace_elem;
375 deviatoric_vector_elem(dir) = grad_elem[dir](_index);
376 }
377
378 // We support internal boundaries too so we have to make sure the normal points always outward
379 grad_contrib += _mu(face_arg, state_arg) * deviatoric_vector_elem * _boundary_normal_factor *
381 }
382
383 return grad_contrib;
384}
const Point & faceCentroid() const
virtual bool providesCompleteBoundaryFlux() const
virtual Real computeBoundaryGradientRHSContribution() const=0
virtual bool needsBoundaryNonorthogonalCorrection() const
FaceInfo::VarFaceNeighbors _current_face_type

Referenced by computeBoundaryRHSContribution().

◆ setupFaceData()

void LinearWCNSFVMomentumFlux::setupFaceData ( const FaceInfo face_info)
overridevirtual

Set the current FaceInfo object.

We override this here to make sure the face velocity evaluation happens only once and that it can be reused for the matrix and right hand side contributions.

Parameters
face_infoThe face info which will be used as current face info

Reimplemented from LinearFVFluxKernel.

Definition at line 403 of file LinearWCNSFVMomentumFlux.C.

404{
406
407 // Multiplier that ensures the normal of the boundary always points outwards, even in cases
408 // when the boundary is within the mesh.
409 _boundary_normal_factor = (_current_face_type == FaceInfo::VarFaceNeighbors::ELEM) ? 1.0 : -1.0;
410
411 // Caching the mass flux on the face which will be reused in the advection term's matrix and
412 // right hand side contributions
414
415 if (_current_face_type == FaceInfo::VarFaceNeighbors::BOTH)
416 {
417 const auto state = determineState();
418 const auto & elem_info = *_current_face_info->elemInfo();
419 const auto & neighbor_info = *_current_face_info->neighborInfo();
420
421 const Real elem_value = _var.getElemValue(elem_info, state);
422 const Real neighbor_value = _var.getElemValue(neighbor_info, state);
423
425 {
426 const auto limiter_type = _adv_interp_method.gradientLimiter();
427 _elem_grad_storage = _var.gradSln(elem_info, state, limiter_type);
428 _neighbor_grad_storage = _var.gradSln(neighbor_info, state, limiter_type);
429 }
430
432 elem_value,
433 neighbor_value,
437 }
438
439 // We'll have to set this to zero to make sure that we don't accumulate values over multiple
440 // faces. The matrix contribution should be fine.
442}
virtual AdvectedSystemContribution advectedInterpolate(const FaceInfo &face, Real elem_value, Real neighbor_value, const VectorValue< Real > *elem_grad, const VectorValue< Real > *neighbor_grad, Real mass_flux) const=0
virtual void setupFaceData(const FaceInfo *face_info)
VectorValue< Real > _elem_grad_storage
Reusable gradient storage used when advected interpolation requires gradients.
VectorValue< Real > _neighbor_grad_storage
Real getElemValue(const ElemInfo &elem_info, const StateArg &state) const
Real getMassFlux(const FaceInfo &fi) const
Get the face velocity times density (used in advection terms)

◆ validParams()

InputParameters LinearWCNSFVMomentumFlux::validParams ( )
static

Definition at line 20 of file LinearWCNSFVMomentumFlux.C.

21{
23 params.addClassDescription("Represents the matrix and right hand side contributions of the "
24 "stress and advection terms of the momentum equation.");
25 params.addRequiredParam<SolverVariableName>("u", "The velocity in the x direction.");
26 params.addParam<SolverVariableName>("v", "The velocity in the y direction.");
27 params.addParam<SolverVariableName>("w", "The velocity in the z direction.");
28 params.addRequiredParam<UserObjectName>(
29 "rhie_chow_user_object",
30 "The rhie-chow user-object which is used to determine the face velocity.");
31 params.addRequiredParam<MooseFunctorName>(NS::mu, "The diffusion coefficient.");
32 MooseEnum momentum_component("x=0 y=1 z=2");
34 "momentum_component",
35 momentum_component,
36 "The component of the momentum equation that this kernel applies to.");
37 params.addParam<bool>(
38 "use_nonorthogonal_correction",
39 true,
40 "If the nonorthogonal correction should be used when computing the normal gradient.");
41 params.addParam<bool>(
42 "use_deviatoric_terms", false, "If deviatoric terms in the stress terms need to be used.");
43
44 params.addRequiredParam<InterpolationMethodName>(
45 "advected_interp_method_name",
46 "Name of the FVInterpolationMethod to use for the advected velocity.");
47 return params;
48}
void addRequiredParam(const std::string &name, const std::string &doc_string)
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)
static InputParameters validParams()

◆ velocityVar()

const MooseLinearVariableFVReal & LinearWCNSFVMomentumFlux::velocityVar ( unsigned int  dir) const
protected

Helper to access the velocity variable for a given direction.

Definition at line 445 of file LinearWCNSFVMomentumFlux.C.

446{
447 mooseAssert(dir < _velocity_vars.size() && _velocity_vars[dir],
448 "Velocity variable for requested direction is not available.");
449 return *_velocity_vars[dir];
450}

Referenced by computeInternalStressRHSContribution(), and computeStressBoundaryRHSContribution().

Member Data Documentation

◆ _adv_interp_method

const FVAdvectedInterpolationMethod& LinearWCNSFVMomentumFlux::_adv_interp_method
protected

The interpolation method to use for the advected quantity.

Definition at line 109 of file LinearWCNSFVMomentumFlux.h.

Referenced by LinearWCNSFVMomentumFlux(), and setupFaceData().

◆ _adv_interp_result

FVAdvectedInterpolationMethod::AdvectedSystemContribution LinearWCNSFVMomentumFlux::_adv_interp_result
protected

◆ _boundary_normal_factor

Real LinearWCNSFVMomentumFlux::_boundary_normal_factor
protected

Multiplier that ensures the normal of the boundary always points outwards, even in cases when the boundary is within the mesh.

Definition at line 124 of file LinearWCNSFVMomentumFlux.h.

Referenced by computeStressBoundaryRHSContribution(), and setupFaceData().

◆ _coord_type

const Moose::CoordinateSystemType LinearWCNSFVMomentumFlux::_coord_type
protected

Coordinate system of the blocks this kernel operates on.

Definition at line 140 of file LinearWCNSFVMomentumFlux.h.

Referenced by computeInternalStressRHSContribution(), and computeStressBoundaryRHSContribution().

◆ _dim

const unsigned int LinearWCNSFVMomentumFlux::_dim
protected

◆ _elem_grad_storage

VectorValue<Real> LinearWCNSFVMomentumFlux::_elem_grad_storage
protected

Reusable gradient storage used when advected interpolation requires gradients.

Definition at line 115 of file LinearWCNSFVMomentumFlux.h.

Referenced by setupFaceData().

◆ _face_mass_flux

Real LinearWCNSFVMomentumFlux::_face_mass_flux
protected

◆ _index

const unsigned int LinearWCNSFVMomentumFlux::_index
protected

Index x|y|z, this is mainly to handle the deviatoric parts correctly in in the stress term.

Definition at line 134 of file LinearWCNSFVMomentumFlux.h.

Referenced by computeInternalStressRHSContribution(), and computeStressBoundaryRHSContribution().

◆ _mass_flux_provider

const RhieChowMassFlux& LinearWCNSFVMomentumFlux::_mass_flux_provider
protected

The Rhie-Chow user object that provides us with the face velocity.

Definition at line 97 of file LinearWCNSFVMomentumFlux.h.

Referenced by setupFaceData().

◆ _mu

const Moose::Functor<Real>& LinearWCNSFVMomentumFlux::_mu
protected

◆ _neighbor_grad_storage

VectorValue<Real> LinearWCNSFVMomentumFlux::_neighbor_grad_storage
protected

Definition at line 116 of file LinearWCNSFVMomentumFlux.h.

Referenced by setupFaceData().

◆ _rz_radial_coord

const unsigned int LinearWCNSFVMomentumFlux::_rz_radial_coord
protected

Axisymmetric radial coordinate index (only used when in RZ)

Definition at line 143 of file LinearWCNSFVMomentumFlux.h.

Referenced by computeInternalStressRHSContribution(), and computeStressBoundaryRHSContribution().

◆ _stress_matrix_contribution

Real LinearWCNSFVMomentumFlux::_stress_matrix_contribution
protected

The cached matrix contribution.

Definition at line 127 of file LinearWCNSFVMomentumFlux.h.

Referenced by computeInternalStressMatrixContribution().

◆ _stress_rhs_contribution

Real LinearWCNSFVMomentumFlux::_stress_rhs_contribution
protected

The cached right hand side contribution.

Definition at line 130 of file LinearWCNSFVMomentumFlux.h.

Referenced by computeInternalStressRHSContribution(), and setupFaceData().

◆ _use_deviatoric_terms

const bool LinearWCNSFVMomentumFlux::_use_deviatoric_terms
protected

Switch to enable/disable deviatoric parts in the stress term.

Definition at line 106 of file LinearWCNSFVMomentumFlux.h.

Referenced by computeInternalStressRHSContribution(), computeStressBoundaryRHSContribution(), and LinearWCNSFVMomentumFlux().

◆ _use_nonorthogonal_correction

const bool LinearWCNSFVMomentumFlux::_use_nonorthogonal_correction
protected

Switch to enable/disable nonorthogonal correction in the stress term.

Definition at line 103 of file LinearWCNSFVMomentumFlux.h.

Referenced by computeInternalStressMatrixContribution(), computeInternalStressRHSContribution(), computeStressBoundaryRHSContribution(), and LinearWCNSFVMomentumFlux().

◆ _velocity_vars

std::array<const MooseLinearVariableFVReal *, 3> LinearWCNSFVMomentumFlux::_velocity_vars
protected

Velocity variables for each coordinate direction.

Definition at line 137 of file LinearWCNSFVMomentumFlux.h.

Referenced by LinearWCNSFVMomentumFlux(), and velocityVar().


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