Implements a limiter which reproduces the upwind scheme, defined by $(r_f) = 0$.
More...
#include <UpwindLimiter.h>
|
T | 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. More...
|
|
T | operator() (const T &phi_upwind, const T &phi_downwind, const libMesh::VectorValue< T > *grad_phi_upwind, const RealVectorValue &dCD) const |
|
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 |
|
T | rf_grad (const VectorValue< T > *grad_phi_upwind, const VectorValue< T > *grad_phi_downwind, const RealVectorValue &dCD) const |
|
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 |
|
template<typename T>
class Moose::FV::UpwindLimiter< T >
Implements a limiter which reproduces the upwind scheme, defined by $(r_f) = 0$.
Definition at line 24 of file UpwindLimiter.h.
◆ UpwindLimiter()
◆ build()
Definition at line 32 of file Limiter.C.
Referenced by Moose::FV::containerInterpolate().
37 return std::make_unique<VanLeerLimiter<T>>();
40 return std::make_unique<UpwindLimiter<T>>();
43 return std::make_unique<CentralDifferenceLimiter<T>>();
46 return std::make_unique<MinModLimiter<T>>();
49 return std::make_unique<SOULimiter<T>>();
52 return std::make_unique<QUICKLimiter<T>>();
55 return std::make_unique<VenkatakrishnanLimiter<T>>();
58 mooseError(
"Unrecognized limiter type ",
unsigned(limiter));
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
◆ constant()
template<typename T >
|
inlinefinaloverridevirtual |
◆ interpMethod()
template<typename T >
|
inlinefinaloverridevirtual |
◆ limit() [1/2]
◆ limit() [2/2]
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
-
T | The data type of the field values and the return type. |
- Parameters
-
phi_upwind | The field value at the upwind location. |
phi_downwind | The field value at the downwind location. |
grad_phi_upwind | Pointer to the gradient of the field at the upwind location. |
grad_phi_downwind | Pointer to the gradient of the field at the downwind location. |
dCD | A constant direction vector representing the direction of the cell face. |
max_value | The maximum allowable value. |
min_value | The minimum allowable value. |
fi | FaceInfo object containing geometric details such as face centroid and cell centroids. |
fi_elem_is_upwind | Boolean 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()().
◆ operator()() [1/2]
- Template Parameters
-
T | The data type of the field values and the return type. |
- Parameters
-
phi_upwind | The field value at the upwind location. |
phi_downwind | The field value at the downwind location. |
grad_phi_upwind | Pointer to the gradient of the field value at the upwind location. |
dCD | A 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.
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...
auto max(const L &left, const R &right)
auto min(const L &left, const R &right)
◆ 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
-
T | The data type of the field values and the return type. |
- Parameters
-
phi_upwind | The field value at the upwind location. |
phi_downwind | The field value at the downwind location. |
grad_phi_upwind | Pointer to the gradient at the upwind location. |
grad_phi_downwind | Pointer to the gradient at the downwind location. |
dCD | A constant direction vector representing the direction of the cell face. |
max_value | The maximum allowable value. |
min_value | The minimum allowable value. |
fi | FaceInfo object containing geometric details such as face centroid and cell centroids. |
fi_elem_is_upwind | Boolean 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.
151 return limit(phi_upwind,
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...
◆ rf_grad()
- Template Parameters
-
T | The data type of the gradient values and the return type. |
- Parameters
-
grad_phi_upwind | Pointer to the gradient at the upwind location. |
grad_phi_downwind | Pointer to the gradient at the downwind location. |
dCD | A constant direction vector representing the direction of the cell face. |
- Returns
- The computed flux limiting ratio.
Definition at line 169 of file Limiter.h.
Referenced by Moose::FV::MinModLimiter< T >::limit(), Moose::FV::VanLeerLimiter< T >::limit(), and Moose::FV::QUICKLimiter< T >::limit().
173 const auto grad_elem = (*grad_phi_upwind) * dCD;
174 const auto grad_face = (*grad_phi_downwind) * dCD;
175 const auto grad_ratio = grad_elem / (grad_face + 1e-10);
176 return std::max(2.0 * grad_ratio - 1.0, 0.0);
auto max(const L &left, const R &right)
◆ 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
-
T | The data type of the field values and the return type. |
- Parameters
-
phi_upwind | The field value at the upwind location. |
grad_phi_upwind | Pointer to the gradient at the upwind location. |
max_value | The maximum allowable value. |
min_value | The minimum allowable value. |
fi | FaceInfo object containing geometric details such as face centroid and cell centroids. |
fi_elem_is_upwind | Boolean indicating if the face info element is upwind. |
- Returns
- The computed flux limiting ratio.
Definition at line 190 of file Limiter.h.
200 const auto delta_face = (*grad_phi_upwind) * (face_centroid - cell_centroid);
201 const auto delta_max = max_value - phi_upwind + 1e-10;
202 const auto delta_min = min_value - phi_upwind + 1e-10;
204 return delta_face >= 0 ? delta_face / delta_max : delta_face / delta_min;
const Point & faceCentroid() const
Returns the coordinates of the face centroid.
const Point & neighborCentroid() const
const Point & elemCentroid() const
Returns the element centroids of the elements on the elem and neighbor sides of the face...
The documentation for this class was generated from the following file: