https://mooseframework.inl.gov
Classes | Public Member Functions | List of all members
FVAdvectedInterpolationMethod Class Referenceabstract

Interface for interpolation methods that provide matrix and RHS contributions for advected face values. More...

#include <FVAdvectedInterpolationMethod.h>

Inheritance diagram for FVAdvectedInterpolationMethod:
[legend]

Classes

struct  AdvectedSystemContribution
 Matrix/RHS contribution for an advected face interpolation. More...
 

Public Member Functions

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
 Compute the matrix weights for the advected face value. More...
 
AdvectedSystemContribution advectedInterpolate (const Moose::FunctorBase< Real > &functor, const FaceInfo &face, const Moose::StateArg &state, const Real mass_flux) const
 Convenience overload that evaluates a scalar Moose functor at the adjacent cell centers and, if needed, its cell gradients before applying this interpolation method. More...
 
virtual Real advectedInterpolateValue (const FaceInfo &face, Real elem_value, Real neighbor_value, const VectorValue< Real > *elem_grad, const VectorValue< Real > *neighbor_grad, Real mass_flux) const
 Compute the advected face value. More...
 
Real advectedInterpolateValue (const Moose::FunctorBase< Real > &functor, const FaceInfo &face, const Moose::StateArg &state, const Real mass_flux) const
 Convenience overload that evaluates a scalar Moose functor at the adjacent cell centers and, if needed, its cell gradients before applying this interpolation method. More...
 
virtual bool needsGradients () const
 Whether advected interpolation requires adjacent-cell gradients. More...
 
virtual Moose::FV::GradientLimiterType gradientLimiter () const
 Limiter used by interpolations that require limited gradients. More...
 

Detailed Description

Interface for interpolation methods that provide matrix and RHS contributions for advected face values.

Definition at line 22 of file FVAdvectedInterpolationMethod.h.

Member Function Documentation

◆ advectedInterpolate() [1/2]

virtual AdvectedSystemContribution FVAdvectedInterpolationMethod::advectedInterpolate ( const FaceInfo face,
Real  elem_value,
Real  neighbor_value,
const VectorValue< Real > *  elem_grad,
const VectorValue< Real > *  neighbor_grad,
Real  mass_flux 
) const
pure virtual

Compute the matrix weights for the advected face value.

Interpolation is used on internal faces, boundary treatment is localized to the boundary conditions.

Parameters
faceThe face being interpolated.
elem_valueElement-side scalar value.
neighbor_valueNeighbor-side scalar value.
elem_gradElement-side cell gradient (required).
neighbor_gradNeighbor-side cell gradient (required).
mass_fluxFace mass flux for determining upwind direction.

Implemented in FVAdvectedVenkatakrishnanDeferredCorrection, FVGeometricAverage, FVAdvectedMinmodWeightBased, FVAdvectedVanLeerWeightBased, and FVAdvectedUpwind.

Referenced by advectedInterpolate(), advectedInterpolateValue(), and LinearFVAdvection::setupFaceData().

◆ advectedInterpolate() [2/2]

FVAdvectedInterpolationMethod::AdvectedSystemContribution FVAdvectedInterpolationMethod::advectedInterpolate ( const Moose::FunctorBase< Real > &  functor,
const FaceInfo face,
const Moose::StateArg state,
const Real  mass_flux 
) const

Convenience overload that evaluates a scalar Moose functor at the adjacent cell centers and, if needed, its cell gradients before applying this interpolation method.

This will provide contributions to the matrix and right hand side of a linear system.

Parameters
functorThe function which will be interpolated onto the face.
faceThe face which will be use for interpolation.
stateThe state argument for which we are performing the interpolation.
mass_fluxThe mass flux which will be used for the interpolation.

Definition at line 13 of file FVAdvectedInterpolationMethod.C.

17 {
18  mooseAssert(face.neighborPtr(),
19  "Advected interpolation with a Moose functor requires a two-sided internal face.");
20 
21  const Moose::ElemArg elem_arg{face.elemPtr(), false};
22  const Moose::ElemArg neighbor_arg{face.neighborPtr(), false};
23  const Real elem_value = functor(elem_arg, state);
24  const Real neighbor_value = functor(neighbor_arg, state);
25 
26  if (!needsGradients())
27  return advectedInterpolate(face, elem_value, neighbor_value, nullptr, nullptr, mass_flux);
28 
29  const auto elem_grad = functor.gradient(elem_arg, state);
30  const auto neighbor_grad = functor.gradient(neighbor_arg, state);
31  return advectedInterpolate(
32  face, elem_value, neighbor_value, &elem_grad, &neighbor_grad, mass_flux);
33 }
const Elem * neighborPtr() const
Definition: FaceInfo.h:88
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
Compute the matrix weights for the advected face value.
A structure that is used to evaluate Moose functors logically at an element/cell center.
const Elem * elemPtr() const
Definition: FaceInfo.h:86
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual bool needsGradients() const
Whether advected interpolation requires adjacent-cell gradients.
GradientType gradient(const ElemArg &elem, const StateArg &state) const
Same as their evaluateGradient overloads with the same arguments but allows for caching implementatio...
Definition: MooseFunctor.h:853

◆ advectedInterpolateValue() [1/2]

Real FVAdvectedInterpolationMethod::advectedInterpolateValue ( const FaceInfo face,
Real  elem_value,
Real  neighbor_value,
const VectorValue< Real > *  elem_grad,
const VectorValue< Real > *  neighbor_grad,
Real  mass_flux 
) const
virtual

Compute the advected face value.

Interpolation is used on internal faces, boundary treatment is localized to the boundary conditions.

Parameters
faceThe face being interpolated.
elem_valueElement-side scalar value.
neighbor_valueNeighbor-side scalar value.
elem_gradElement-side cell gradient (required).
neighbor_gradNeighbor-side cell gradient (required).
mass_fluxFace mass flux for determining upwind direction.

Reimplemented in FVGeometricAverage, FVAdvectedMinmodWeightBased, FVAdvectedVanLeerWeightBased, and FVAdvectedUpwind.

Definition at line 36 of file FVAdvectedInterpolationMethod.C.

Referenced by advectedInterpolateValue().

42 {
43  const auto result =
44  advectedInterpolate(face, elem_value, neighbor_value, elem_grad, neighbor_grad, mass_flux);
45  return result.weights_matrix.first * elem_value + result.weights_matrix.second * neighbor_value -
46  result.rhs_face_value;
47 }
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
Compute the matrix weights for the advected face value.

◆ advectedInterpolateValue() [2/2]

Real FVAdvectedInterpolationMethod::advectedInterpolateValue ( const Moose::FunctorBase< Real > &  functor,
const FaceInfo face,
const Moose::StateArg state,
const Real  mass_flux 
) const

Convenience overload that evaluates a scalar Moose functor at the adjacent cell centers and, if needed, its cell gradients before applying this interpolation method.

This will return the interpolated face value.

Parameters
functorThe function which will be interpolated onto the face.
faceThe face which will be use for interpolation.
stateThe state argument for which we are performing the interpolation.
mass_fluxThe mass flux which will be used for the interpolation.

Definition at line 50 of file FVAdvectedInterpolationMethod.C.

54 {
55  mooseAssert(face.neighborPtr(),
56  "Advected interpolation with a Moose functor requires a two-sided internal face.");
57 
58  const Moose::ElemArg elem_arg{face.elemPtr(), false};
59  const Moose::ElemArg neighbor_arg{face.neighborPtr(), false};
60  const Real elem_value = functor(elem_arg, state);
61  const Real neighbor_value = functor(neighbor_arg, state);
62 
63  if (!needsGradients())
64  return advectedInterpolateValue(face, elem_value, neighbor_value, nullptr, nullptr, mass_flux);
65 
66  const auto elem_grad = functor.gradient(elem_arg, state);
67  const auto neighbor_grad = functor.gradient(neighbor_arg, state);
69  face, elem_value, neighbor_value, &elem_grad, &neighbor_grad, mass_flux);
70 }
virtual Real advectedInterpolateValue(const FaceInfo &face, Real elem_value, Real neighbor_value, const VectorValue< Real > *elem_grad, const VectorValue< Real > *neighbor_grad, Real mass_flux) const
Compute the advected face value.
const Elem * neighborPtr() const
Definition: FaceInfo.h:88
A structure that is used to evaluate Moose functors logically at an element/cell center.
const Elem * elemPtr() const
Definition: FaceInfo.h:86
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual bool needsGradients() const
Whether advected interpolation requires adjacent-cell gradients.
GradientType gradient(const ElemArg &elem, const StateArg &state) const
Same as their evaluateGradient overloads with the same arguments but allows for caching implementatio...
Definition: MooseFunctor.h:853

◆ gradientLimiter()

virtual Moose::FV::GradientLimiterType FVAdvectedInterpolationMethod::gradientLimiter ( ) const
inlinevirtual

Limiter used by interpolations that require limited gradients.

Reimplemented in FVAdvectedVenkatakrishnanDeferredCorrection.

Definition at line 102 of file FVAdvectedInterpolationMethod.h.

Referenced by LinearFVAdvection::LinearFVAdvection(), and LinearFVAdvection::setupFaceData().

103  {
105  }

◆ needsGradients()

virtual bool FVAdvectedInterpolationMethod::needsGradients ( ) const
inlinevirtual

Whether advected interpolation requires adjacent-cell gradients.

Reimplemented in FVAdvectedVenkatakrishnanDeferredCorrection, FVAdvectedMinmodWeightBased, and FVAdvectedVanLeerWeightBased.

Definition at line 97 of file FVAdvectedInterpolationMethod.h.

Referenced by advectedInterpolate(), advectedInterpolateValue(), LinearFVAdvection::LinearFVAdvection(), and LinearFVAdvection::setupFaceData().

97 { return false; }

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