Refresh

This website mooseframework.inl.gov/docs/doxygen/modules/namespaceMoose_1_1FV.html is currently offline. Cloudflare's Always Online™ shows a snapshot of this web page from the Internet Archive's Wayback Machine. To check for the live version, click Refresh.

https://mooseframework.inl.gov
Classes | Enumerations | Functions | Variables
Moose::FV Namespace Reference

Classes

class  CentralDifferenceLimiter
 
class  Limiter
 
struct  LimiterValueType
 
struct  LimiterValueType< ADReal >
 
struct  LimiterValueType< Real >
 
struct  LimiterValueType< T, typename std::enable_if< HasMemberType_value_type< T >::value >::type >
 
class  MinModLimiter
 
class  QUICKLimiter
 
class  SOULimiter
 
class  UpwindLimiter
 
class  VanLeerLimiter
 
class  VenkatakrishnanLimiter
 

Enumerations

enum  LimiterType {
  LimiterType::VanLeer, LimiterType::Upwind, LimiterType::CentralDifference, LimiterType::MinMod,
  LimiterType::SOU, LimiterType::QUICK, LimiterType::Venkatakrishnan
}
 
enum  InterpMethod {
  InterpMethod::Average, InterpMethod::HarmonicAverage, InterpMethod::SkewCorrectedAverage, InterpMethod::Upwind,
  InterpMethod::RhieChow, InterpMethod::VanLeer, InterpMethod::MinMod, InterpMethod::SOU,
  InterpMethod::QUICK, InterpMethod::Venkatakrishnan
}
 
enum  LinearFVComputationMode { LinearFVComputationMode::RHS, LinearFVComputationMode::Matrix, LinearFVComputationMode::FullSystem }
 

Functions

LimiterType limiterType (InterpMethod interp_method)
 
bool elemHasFaceInfo (const Elem &elem, const Elem *const neighbor)
 
void loopOverElemFaceInfo (const Elem &elem, const MooseMesh &mesh, ActionFunctor &act, const Moose::CoordinateSystemType coord_type, const unsigned int rz_radial_coord=libMesh::invalid_uint)
 
std::tuple< const Elem *, const Elem *, bool > determineElemOneAndTwo (const FaceInfo &fi, const FVVar &var)
 
libMesh::VectorValue< T > greenGaussGradient (const ElemArg &elem_arg, const StateArg &state_arg, const FunctorBase< T > &functor, const bool two_term_boundary_expansion, const MooseMesh &mesh, const bool force_green_gauss=false)
 
libMesh::VectorValue< T > greenGaussGradient (const FaceArg &face_arg, const StateArg &state_arg, const FunctorBase< T > &functor, const bool two_term_boundary_expansion, const MooseMesh &mesh)
 
TensorValue< T > greenGaussGradient (const ElemArg &elem_arg, const StateArg &state_arg, const Moose::FunctorBase< libMesh::VectorValue< T >> &functor, const bool two_term_boundary_expansion, const MooseMesh &mesh)
 
TensorValue< T > greenGaussGradient (const FaceArg &face_arg, const StateArg &state_arg, const Moose::FunctorBase< libMesh::VectorValue< T >> &functor, const bool two_term_boundary_expansion, const MooseMesh &mesh)
 
Moose::FunctorBase< std::vector< T > >::GradientType greenGaussGradient (const ElemArg &elem_arg, const StateArg &state_arg, const Moose::FunctorBase< std::vector< T >> &functor, const bool two_term_boundary_expansion, const MooseMesh &mesh)
 
Moose::FunctorBase< std::vector< T > >::GradientType greenGaussGradient (const FaceArg &face_arg, const StateArg &state_arg, const Moose::FunctorBase< std::vector< T >> &functor, const bool two_term_boundary_expansion, const MooseMesh &mesh)
 
Moose::FunctorBase< std::array< T, N > >::GradientType greenGaussGradient (const ElemArg &elem_arg, const StateArg &state_arg, const Moose::FunctorBase< std::array< T, N >> &functor, const bool two_term_boundary_expansion, const MooseMesh &mesh)
 
Moose::FunctorBase< std::array< T, N > >::GradientType greenGaussGradient (const FaceArg &face_arg, const StateArg &state_arg, const Moose::FunctorBase< std::array< T, N >> &functor, const bool two_term_boundary_expansion, const MooseMesh &mesh)
 
MooseEnum interpolationMethods ()
 
InputParameters advectedInterpolationParameter ()
 
InterpMethod selectInterpolationMethod (const std::string &interp_method)
 
bool setInterpolationMethod (const MooseObject &obj, Moose::FV::InterpMethod &interp_method, const std::string &param_name)
 
std::pair< Real, RealinterpCoeffs (const InterpMethod m, const FaceInfo &fi, const bool one_is_elem, const T &face_flux=0.0)
 
libMesh::CompareTypes< T, T2 >::supertype linearInterpolation (const T &value1, const T2 &value2, const FaceInfo &fi, const bool one_is_elem, const InterpMethod interp_method=InterpMethod::Average)
 
libMesh::CompareTypes< T1, T2 >::supertype harmonicInterpolation (const T1 &value1, const T2 &value2, const FaceInfo &fi, const bool one_is_elem)
 
libMesh::CompareTypes< T, T2 >::supertype skewCorrectedLinearInterpolation (const T &value1, const T2 &value2, const T3 &face_gradient, const FaceInfo &fi, const bool one_is_elem)
 
void interpolate (InterpMethod m, T &result, const T2 &value1, const T3 &value2, const FaceInfo &fi, const bool one_is_elem)
 
linearInterpolation (const FunctorBase< T > &functor, const FaceArg &face, const StateArg &time)
 
void interpolate (InterpMethod m, Vector1< T1 > &result, const T2 &fi_elem_advected, const T2 &fi_neighbor_advected, const Vector2< T3 > &fi_elem_advector, const Vector2< T3 > &fi_neighbor_advector, const FaceInfo &fi)
 
void interpolate (InterpMethod m, T &result, const T2 &value1, const T3 &value2, const Vector &advector, const FaceInfo &fi, const bool one_is_elem)
 
ADReal gradUDotNormal (const FaceInfo &face_info, const MooseVariableFV< Real > &fv_var, const Moose::StateArg &time, bool correct_skewness=false)
 
Scalar rF (const Scalar &phiC, const Scalar &phiD, const Vector &gradC, const RealVectorValue &dCD)
 
std::pair< T, T > interpCoeffs (const Limiter< T > &limiter, const T &phi_upwind, const T &phi_downwind, const libMesh::VectorValue< T > *const grad_phi_upwind, const libMesh::VectorValue< T > *const grad_phi_face, const Real &max_value, const Real &min_value, const FaceInfo &fi, const bool fi_elem_is_upwind)
 
Scalar interpolate (const Limiter< Scalar > &limiter, const Scalar &phi_upwind, const Scalar &phi_downwind, const Vector *const grad_phi_upwind, const FaceInfo &fi, const bool fi_elem_is_upwind)
 
libMesh::VectorValue< T > interpolate (const Limiter &limiter, const TypeVector< T > &phi_upwind, const TypeVector< T > &phi_downwind, const Tensor *const grad_phi_upwind, const FaceInfo &fi, const bool fi_elem_is_upwind)
 
fullLimitedInterpolation (const Limiter< T > &limiter, const T &phi_upwind, const T &phi_downwind, const VectorValue< T > *const grad_phi_upwind, const VectorValue< T > *const grad_phi_face, const Real &max_value, const Real &min_value, const FaceArg &face)
 
std::pair< Real, RealcomputeMinMaxValue (const FunctorBase< T > &functor, const FaceArg &face, const StateArg &time)
 
std::pair< Real, RealcomputeMinMaxValue (const FunctorBase< VectorValue< T >> &functor, const FaceArg &face, const StateArg &time, const unsigned int &component)
 
std::pair< std::pair< T, T >, std::pair< T, T > > interpCoeffsAndAdvected (const FunctorBase< T > &functor, const FaceArg &face, const StateArg &time)
 
interpolate (const FunctorBase< T > &functor, const FaceArg &face, const StateArg &time)
 
libMesh::VectorValue< T > interpolate (const FunctorBase< libMesh::VectorValue< T >> &functor, const FaceArg &face, const StateArg &time)
 
containerInterpolate (const FunctorBase< T > &functor, const FaceArg &face, const StateArg &time)
 
std::vector< T > interpolate (const FunctorBase< std::vector< T >> &functor, const FaceArg &face, const StateArg &time)
 
std::array< T, Ninterpolate (const FunctorBase< std::array< T, N >> &functor, const FaceArg &face, const StateArg &time)
 
bool onBoundary (const SubdomainRestrictable &obj, const FaceInfo &fi)
 
bool onBoundary (const std::set< SubdomainID > &subs, const FaceInfo &fi)
 
const MooseEnum moose_limiter_type ("vanLeer=0 upwind=1 central_difference=2 min_mod=3 sou=4 quick=5 venkatakrishnan=6", "upwind")
 
bool setInterpolationMethods (const MooseObject &obj, Moose::FV::InterpMethod &advected_interp_method, Moose::FV::InterpMethod &velocity_interp_method)
 Sets the advection and velocity interpolation methods. More...
 
InputParameters interpolationParameters ()
 
template<typename T , typename Map >
void interpolateReconstruct (CellCenteredMapFunctor< T, Map > &output_functor, const Moose::FunctorBase< T > &input_functor, const unsigned int num_int_recs, const bool weight_with_sf, const std::vector< const FaceInfo *> &faces, const Moose::StateArg &time)
 Takes an input functor that can be evaluated at faces, typically by linearly interpolating between adjacent cell center values, and then creates an output functor whose cell-center evaluations will correspond to weighted averages of the input functor's surrounding face evaluations. More...
 
template<typename ActionFunctor >
void loopOverElemFaceInfo (const Elem &elem, const MooseMesh &mesh, const SubProblem &subproblem, ActionFunctor &act)
 

Variables

const MooseEnum moose_limiter_type
 

Function Documentation

◆ interpolateReconstruct()

template<typename T , typename Map >
void Moose::FV::interpolateReconstruct ( CellCenteredMapFunctor< T, Map > &  output_functor,
const Moose::FunctorBase< T > &  input_functor,
const unsigned int  num_int_recs,
const bool  weight_with_sf,
const std::vector< const FaceInfo *> &  faces,
const Moose::StateArg time 
)

Takes an input functor that can be evaluated at faces, typically by linearly interpolating between adjacent cell center values, and then creates an output functor whose cell-center evaluations will correspond to weighted averages of the input functor's surrounding face evaluations.

Parameters
output_functorthe output functor
input_functorthe input functor
num_int_recsthe total number of interpolation and reconstruction operations to perform. If this number is greater than 1, then this function will recurse
weight_with_sfwhen reconstructing the cell center value, decides whether the face values (and maybe gradients) are weighted with the surface vector. If this is false, then the weights are simply unity
facesthe mesh faces we will be looping over for the interpolations and reconstructions

Definition at line 41 of file Reconstructions.h.

Referenced by PINSFVRhieChowInterpolator::pinsfvSetup(), and testReconstruction().

47 {
48  if (!num_int_recs)
49  return;
50 
51  std::unordered_map<dof_id_type, std::pair<T, Real>> elem_to_num_denom;
52 
53  for (const auto * const face : faces)
54  {
55  mooseAssert(face, "This must be non-null");
56  const Real weight = weight_with_sf ? face->faceArea() * face->faceCoord() : 1;
57  const Moose::FaceArg face_arg{
58  face,
60  true,
61  false,
62  input_functor.hasFaceSide(*face, true)
63  ? (input_functor.hasFaceSide(*face, false) ? nullptr : face->elemPtr())
64  : face->neighborPtr(),
65  nullptr};
66  auto face_value = input_functor(face_arg, time);
67  std::pair<T, Real> * neighbor_pair = nullptr;
68  if (face->neighborPtr() && face->neighborPtr() != libMesh::remote_elem)
69  {
70  neighbor_pair = &elem_to_num_denom[face->neighbor().id()];
71  neighbor_pair->first += face_value * weight;
72  neighbor_pair->second += weight;
73  }
74  auto & elem_pair = elem_to_num_denom[face->elem().id()];
75  elem_pair.first += std::move(face_value) * weight;
76  elem_pair.second += weight;
77  }
78 
79  for (const auto & pair_ : elem_to_num_denom)
80  {
81  const auto & data_pair = pair_.second;
82  output_functor[pair_.first] = data_pair.first / data_pair.second;
83  }
84 
86  output_functor, output_functor, num_int_recs - 1, weight_with_sf, faces, time);
87 }
void interpolateReconstruct(CellCenteredMapFunctor< T, Map > &output_functor, const Moose::FunctorBase< T > &input_functor, const unsigned int num_int_recs, const bool weight_with_sf, const std::vector< const FaceInfo *> &faces, const Moose::StateArg &time)
Takes an input functor that can be evaluated at faces, typically by linearly interpolating between ad...
dof_id_type weight(const MeshBase &mesh, const processor_id_type pid)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual bool hasFaceSide(const FaceInfo &fi, const bool fi_elem_side) const override
const RemoteElem * remote_elem

◆ interpolationParameters()

InputParameters Moose::FV::interpolationParameters ( )
Returns
interpolation parameters for use in advection object input parameters

Definition at line 41 of file NSFVUtils.C.

Referenced by INSFVAdvectionKernel::validParams(), and VolumetricFlowRate::validParams().

42 {
43  auto params = advectedInterpolationParameter();
44  MooseEnum velocity_interp_method("average rc", "rc");
45  params.addParam<MooseEnum>(
46  "velocity_interp_method",
47  velocity_interp_method,
48  "The interpolation to use for the velocity. Options are "
49  "'average' and 'rc' which stands for Rhie-Chow. The default is Rhie-Chow.");
50  return params;
51 }
InputParameters advectedInterpolationParameter()

◆ loopOverElemFaceInfo()

template<typename ActionFunctor >
void Moose::FV::loopOverElemFaceInfo ( const Elem &  elem,
const MooseMesh mesh,
const SubProblem subproblem,
ActionFunctor &  act 
)

Definition at line 39 of file INSFVVelocityVariable.C.

43 {
44  const auto coord_type = subproblem.getCoordSystem(elem.subdomain_id());
46  mesh,
47  act,
48  coord_type,
49  coord_type == Moose::COORD_RZ ? subproblem.getAxisymmetricRadialCoord()
51 }
void loopOverElemFaceInfo(const Elem &elem, const MooseMesh &mesh, ActionFunctor &act, const Moose::CoordinateSystemType coord_type, const unsigned int rz_radial_coord=libMesh::invalid_uint)
unsigned int getAxisymmetricRadialCoord() const
const unsigned int invalid_uint
Moose::CoordinateSystemType getCoordSystem(SubdomainID sid) const

◆ setInterpolationMethods()

bool Moose::FV::setInterpolationMethods ( const MooseObject obj,
Moose::FV::InterpMethod advected_interp_method,
Moose::FV::InterpMethod velocity_interp_method 
)

Sets the advection and velocity interpolation methods.

Parameters
objThe MooseObject with input parameters to query
advected_interp_methodThe advected interpolation method we will set
velocity_interp_methodThe velocity interpolation method we will set
Returns
Whether the interpolation methods have indicated that we will need more than the default level of ghosting

Definition at line 21 of file NSFVUtils.C.

Referenced by INSFVAdvectionKernel::INSFVAdvectionKernel(), and VolumetricFlowRate::VolumetricFlowRate().

24 {
25  const bool need_more_ghosting =
26  setInterpolationMethod(obj, advected_interp_method, "advected_interp_method");
27 
28  const auto & velocity_interp_method_in = obj.getParam<MooseEnum>("velocity_interp_method");
29  if (velocity_interp_method_in == "average")
30  velocity_interp_method = InterpMethod::Average;
31  else if (velocity_interp_method_in == "rc")
32  velocity_interp_method = InterpMethod::RhieChow;
33  else
34  obj.mooseError("Unrecognized interpolation type ",
35  static_cast<std::string>(velocity_interp_method_in));
36 
37  return need_more_ghosting;
38 }
const T & getParam(const std::string &name) const
void mooseError(Args &&... args) const
bool setInterpolationMethod(const MooseObject &obj, Moose::FV::InterpMethod &interp_method, const std::string &param_name)