https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
Moose::FV::UpwindLimiter< T > Class Template Referenceabstract

Implements a limiter which reproduces the upwind scheme, defined by $\beta(r_f) = 0$. More...

#include <UpwindLimiter.h>

Inheritance diagram for Moose::FV::UpwindLimiter< T >:
[legend]

Public Member Functions

limit (const T &, const T &, const VectorValue< T > *, const VectorValue< T > *, const RealVectorValue &, const Real &, const Real &, const FaceInfo *, const bool &) const override final
 
bool constant () const override final
 
InterpMethod interpMethod () const override final
 
 UpwindLimiter ()=default
 
virtual T limit (const T &phi_upwind, const T &phi_downwind, const libMesh::VectorValue< T > *grad_phi_upwind, const libMesh::VectorValue< T > *grad_phi_downwind, const RealVectorValue &dCD, const Real &max_value, const Real &min_value, const FaceInfo *fi, const bool &fi_elem_is_upwind) const =0
 This method computes the flux limiting ratio based on the provided scalar values, gradient vectors, direction vector, maximum and minimum allowable values, and geometric information from the face and cell centroids.
 
operator() (const T &phi_upwind, const T &phi_downwind, const libMesh::VectorValue< T > *grad_phi_upwind, const RealVectorValue &dCD) const
 
operator() (const T &phi_upwind, const T &phi_downwind, const VectorValue< T > *grad_phi_upwind, const VectorValue< T > *grad_phi_downwind, const RealVectorValue &dCD, const Real &max_value, const Real &min_value, const FaceInfo *fi, const bool &fi_elem_is_upwind) const
 
rf_grad (const VectorValue< T > *grad_phi_upwind, const VectorValue< T > *grad_phi_downwind, const RealVectorValue &dCD) const
 
rf_minmax (const T &phi_upwind, const VectorValue< T > *grad_phi_upwind, const Real &max_value, const Real &min_value, const FaceInfo *fi, const bool &fi_elem_is_upwind) const
 

Static Public Member Functions

static std::unique_ptr< Limiterbuild (LimiterType limiter)
 

Detailed Description

template<typename T>
class Moose::FV::UpwindLimiter< T >

Implements a limiter which reproduces the upwind scheme, defined by $\beta(r_f) = 0$.

Definition at line 24 of file UpwindLimiter.h.

Constructor & Destructor Documentation

◆ UpwindLimiter()

template<typename T >
Moose::FV::UpwindLimiter< T >::UpwindLimiter ( )
default

Member Function Documentation

◆ build()

template<typename T >
template std::unique_ptr< Limiter< ADReal > > Moose::FV::Limiter< T >::build ( LimiterType  limiter)
staticinherited

Definition at line 32 of file Limiter.C.

33{
34 switch (limiter)
35 {
37 return std::make_unique<VanLeerLimiter<T>>();
38
40 return std::make_unique<UpwindLimiter<T>>();
41
43 return std::make_unique<CentralDifferenceLimiter<T>>();
44
46 return std::make_unique<MinModLimiter<T>>();
47
49 return std::make_unique<SOULimiter<T>>();
50
52 return std::make_unique<QUICKLimiter<T>>();
53
55 return std::make_unique<VenkatakrishnanLimiter<T>>();
56
57 default:
58 mooseError("Unrecognized limiter type ", unsigned(limiter));
59 }
60}
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311

Referenced by Moose::FV::containerInterpolate().

◆ constant()

template<typename T >
bool Moose::FV::UpwindLimiter< T >::constant ( ) const
inlinefinaloverridevirtual

Implements Moose::FV::Limiter< T >.

Definition at line 39 of file UpwindLimiter.h.

39{ return true; }

◆ interpMethod()

template<typename T >
InterpMethod Moose::FV::UpwindLimiter< T >::interpMethod ( ) const
inlinefinaloverridevirtual

Implements Moose::FV::Limiter< T >.

Definition at line 40 of file UpwindLimiter.h.

◆ limit() [1/2]

template<typename T >
T Moose::FV::UpwindLimiter< T >::limit ( const T &  ,
const T &  ,
const VectorValue< T > *  ,
const VectorValue< T > *  ,
const RealVectorValue &  ,
const Real &  ,
const Real &  ,
const FaceInfo ,
const bool &   
) const
inlinefinaloverride

Definition at line 27 of file UpwindLimiter.h.

36 {
37 return 0;
38 }

◆ limit() [2/2]

template<typename T >
virtual T Moose::FV::Limiter< T >::limit ( const T &  phi_upwind,
const T &  phi_downwind,
const libMesh::VectorValue< T > *  grad_phi_upwind,
const libMesh::VectorValue< T > *  grad_phi_downwind,
const RealVectorValue &  dCD,
const Real &  max_value,
const Real &  min_value,
const FaceInfo fi,
const bool &  fi_elem_is_upwind 
) const
pure virtualinherited

This method computes the flux limiting ratio based on the provided scalar values, gradient vectors, direction vector, maximum and minimum allowable values, and geometric information from the face and cell centroids.

It must be overridden by any derived class implementing a specific limiting strategy.

Template Parameters
TThe data type of the field values and the return type.
Parameters
phi_upwindThe field value at the upwind location.
phi_downwindThe field value at the downwind location.
grad_phi_upwindPointer to the gradient of the field at the upwind location.
grad_phi_downwindPointer to the gradient of the field at the downwind location.
dCDA constant direction vector representing the direction of the cell face.
max_valueThe maximum allowable value.
min_valueThe minimum allowable value.
fiFaceInfo object containing geometric details such as face centroid and cell centroids.
fi_elem_is_upwindBoolean indicating if the face info element is upwind.
Returns
The computed flux limiting ratio.

This pure virtual function is intended to be defined in derived classes, which will implement the specific limiting algorithm. Derived classes will provide the actual logic for computing the flux limiting ratio, ensuring that the result adheres to the constraints and properties required by the specific limiting method.

Referenced by Moose::FV::Limiter< T >::operator()(), and Moose::FV::Limiter< T >::operator()().

◆ operator()() [1/2]

template<typename T >
T Moose::FV::Limiter< T >::operator() ( const T &  phi_upwind,
const T &  phi_downwind,
const libMesh::VectorValue< T > *  grad_phi_upwind,
const RealVectorValue &  dCD 
) const
inlineinherited
Template Parameters
TThe data type of the field values and the return type.
Parameters
phi_upwindThe field value at the upwind location.
phi_downwindThe field value at the downwind location.
grad_phi_upwindPointer to the gradient of the field value at the upwind location.
dCDA constant direction vector representing the direction of the cell face.
Returns
The computed limited value, ensuring it is within the range [0, 2].

Definition at line 109 of file Limiter.h.

113 {
114 return std::max(T(0),
115 std::min(T(2),
116 limit(phi_upwind,
117 phi_downwind,
118 grad_phi_upwind,
119 nullptr,
120 dCD,
121 T(0),
122 T(0),
123 nullptr,
124 false)));
125 }
virtual T limit(const T &phi_upwind, const T &phi_downwind, const libMesh::VectorValue< T > *grad_phi_upwind, const libMesh::VectorValue< T > *grad_phi_downwind, const RealVectorValue &dCD, const Real &max_value, const Real &min_value, const FaceInfo *fi, const bool &fi_elem_is_upwind) const =0
This method computes the flux limiting ratio based on the provided scalar values, gradient vectors,...

◆ operator()() [2/2]

template<typename T >
T Moose::FV::Limiter< T >::operator() ( const T &  phi_upwind,
const T &  phi_downwind,
const VectorValue< T > *  grad_phi_upwind,
const VectorValue< T > *  grad_phi_downwind,
const RealVectorValue &  dCD,
const Real &  max_value,
const Real &  min_value,
const FaceInfo fi,
const bool &  fi_elem_is_upwind 
) const
inlineinherited
Template Parameters
TThe data type of the field values and the return type.
Parameters
phi_upwindThe field value at the upwind location.
phi_downwindThe field value at the downwind location.
grad_phi_upwindPointer to the gradient at the upwind location.
grad_phi_downwindPointer to the gradient at the downwind location.
dCDA constant direction vector representing the direction of the cell face.
max_valueThe maximum allowable value.
min_valueThe minimum allowable value.
fiFaceInfo object containing geometric details such as face centroid and cell centroids.
fi_elem_is_upwindBoolean indicating if the face info element is upwind.
Returns
The result of the limit function applied to the provided parameters.

Definition at line 141 of file Limiter.h.

150 {
151 return limit(phi_upwind,
152 phi_downwind,
153 grad_phi_upwind,
154 grad_phi_downwind,
155 dCD,
156 max_value,
157 min_value,
158 fi,
159 fi_elem_is_upwind);
160 }

◆ rf_grad()

template<typename T >
T Moose::FV::Limiter< T >::rf_grad ( const VectorValue< T > *  grad_phi_upwind,
const VectorValue< T > *  grad_phi_downwind,
const RealVectorValue &  dCD 
) const
inlineinherited
Template Parameters
TThe data type of the gradient values and the return type.
Parameters
grad_phi_upwindPointer to the gradient at the upwind location.
grad_phi_downwindPointer to the gradient at the downwind location.
dCDA constant direction vector representing the direction of the cell face.
Returns
The computed flux limiting ratio.

Definition at line 169 of file Limiter.h.

172 {
173 using std::max;
174 const auto grad_elem = (*grad_phi_upwind) * dCD;
175 const auto grad_face = (*grad_phi_downwind) * dCD;
176 const auto grad_ratio = grad_elem / (grad_face + 1e-10);
177 return max(2.0 * grad_ratio - 1.0, 0.0);
178 };
auto max(const L &left, const R &right)

Referenced by Moose::FV::MinModLimiter< T >::limit(), Moose::FV::QUICKLimiter< T >::limit(), and Moose::FV::VanLeerLimiter< T >::limit().

◆ rf_minmax()

template<typename T >
T Moose::FV::Limiter< T >::rf_minmax ( const T &  phi_upwind,
const VectorValue< T > *  grad_phi_upwind,
const Real &  max_value,
const Real &  min_value,
const FaceInfo fi,
const bool &  fi_elem_is_upwind 
) const
inlineinherited
Template Parameters
TThe data type of the field values and the return type.
Parameters
phi_upwindThe field value at the upwind location.
grad_phi_upwindPointer to the gradient at the upwind location.
max_valueThe maximum allowable value.
min_valueThe minimum allowable value.
fiFaceInfo object containing geometric details such as face centroid and cell centroids.
fi_elem_is_upwindBoolean indicating if the face info element is upwind.
Returns
The computed flux limiting ratio.

Definition at line 191 of file Limiter.h.

197 {
198 const auto face_centroid = fi->faceCentroid();
199 const auto cell_centroid = fi_elem_is_upwind ? fi->elemCentroid() : fi->neighborCentroid();
200
201 const auto delta_face = (*grad_phi_upwind) * (face_centroid - cell_centroid);
202 const auto delta_max = max_value - phi_upwind + 1e-10;
203 const auto delta_min = min_value - phi_upwind + 1e-10;
204
205 return delta_face >= 0 ? delta_face / delta_max : delta_face / delta_min;
206 };
const Point & neighborCentroid() const
Definition FaceInfo.h:247
const Point & elemCentroid() const
Returns the element centroids of the elements on the elem and neighbor sides of the face.
Definition FaceInfo.h:99
const Point & faceCentroid() const
Returns the coordinates of the face centroid.
Definition FaceInfo.h:75

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