Classes | |
class | CentralDifferenceLimiter |
Implements a limiter which reproduces a central-differencing scheme, defined by $(r_f) = 1$. More... | |
class | Limiter |
Base class for defining slope limiters for finite volume or potentially reconstructed Discontinuous-Galerkin applications. More... | |
struct | LimiterValueType |
struct | LimiterValueType< ADReal > |
struct | LimiterValueType< Real > |
struct | LimiterValueType< T, typename std::enable_if< HasMemberType_value_type< T >::value >::type > |
class | MinModLimiter |
The Min-Mod limiter function $(r_f)$ is defined as: More... | |
class | QUICKLimiter |
The QUICK (Quadratic Upstream Interpolation for Convective Kinematics) limiter function is derived from the following equations: More... | |
class | SOULimiter |
The SOU limiter is used for reproducing the second-order-upwind scheme. More... | |
class | UpwindLimiter |
Implements a limiter which reproduces the upwind scheme, defined by $(r_f) = 0$. More... | |
class | VanLeerLimiter |
The Van Leer limiter limiter function $(r_f)$ is defined as: More... | |
class | VenkatakrishnanLimiter |
The Venkatakrishnan limiter is derived from the following equations: More... | |
Enumerations | |
enum | LimiterType : int { LimiterType::VanLeer = 0, 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 } |
This codifies a set of available ways to interpolate with elem+neighbor solution information to calculate values (e.g. More... | |
enum | LinearFVComputationMode { LinearFVComputationMode::RHS, LinearFVComputationMode::Matrix, LinearFVComputationMode::FullSystem } |
Functions | |
LimiterType | limiterType (InterpMethod interp_method) |
Return the limiter type associated with the supplied interpolation method. More... | |
bool | elemHasFaceInfo (const Elem &elem, const Elem *const neighbor) |
This function infers based on elements if the faceinfo between them belongs to the element or not. More... | |
template<typename ActionFunctor > | |
void | loopOverElemFaceInfo (const Elem &elem, const MooseMesh &mesh, ActionFunctor &act, const Moose::CoordinateSystemType coord_type, const unsigned int rz_radial_coord=libMesh::invalid_uint) |
template<typename FVVar > | |
std::tuple< const Elem *, const Elem *, bool > | determineElemOneAndTwo (const FaceInfo &fi, const FVVar &var) |
This utility determines element one and element two given a FaceInfo fi and variable var . More... | |
template<typename T , typename Enable = typename std::enable_if<libMesh::ScalarTraits<T>::value>::type> | |
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) |
Compute a cell gradient using the method of Green-Gauss. More... | |
template<typename T , typename Enable = typename std::enable_if<libMesh::ScalarTraits<T>::value>::type> | |
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) |
Compute a face gradient from Green-Gauss cell gradients, with orthogonality correction On the boundaries, the boundary element value is used. More... | |
template<typename T > | |
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) |
template<typename T > | |
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) |
template<typename T > | |
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) |
template<typename T > | |
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) |
template<typename T , std::size_t N> | |
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) |
template<typename T , std::size_t N> | |
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 () |
Returns an enum with all the currently supported interpolation methods and the current default for FV: first-order upwind. More... | |
InputParameters | advectedInterpolationParameter () |
InterpMethod | selectInterpolationMethod (const std::string &interp_method) |
bool | setInterpolationMethod (const MooseObject &obj, Moose::FV::InterpMethod &interp_method, const std::string ¶m_name) |
Sets one interpolation method. More... | |
template<typename T = Real> | |
std::pair< Real, Real > | interpCoeffs (const InterpMethod m, const FaceInfo &fi, const bool one_is_elem, const T &face_flux=0.0) |
Produce the interpolation coefficients in the equation: More... | |
template<typename T , typename T2 > | |
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) |
A simple linear interpolation of values between cell centers to a cell face. More... | |
template<typename T1 , typename T2 > | |
libMesh::CompareTypes< T1, T2 >::supertype | harmonicInterpolation (const T1 &value1, const T2 &value2, const FaceInfo &fi, const bool one_is_elem) |
Computes the harmonic mean (1/(gc/value1+(1-gc)/value2)) of Reals, RealVectorValues and RealTensorValues while accounting for the possibility that one or both of them are AD. More... | |
template<typename T , typename T2 , typename T3 > | |
libMesh::CompareTypes< T, T2 >::supertype | skewCorrectedLinearInterpolation (const T &value1, const T2 &value2, const T3 &face_gradient, const FaceInfo &fi, const bool one_is_elem) |
Linear interpolation with skewness correction using the face gradient. More... | |
template<typename T , typename T2 , typename T3 > | |
void | interpolate (InterpMethod m, T &result, const T2 &value1, const T3 &value2, const FaceInfo &fi, const bool one_is_elem) |
Provides interpolation of face values for non-advection-specific purposes (although it can/will still be used by advective kernels sometimes). More... | |
template<typename T , FunctorEvaluationKind FEK = FunctorEvaluationKind::Value> | |
T | linearInterpolation (const FunctorBase< T > &functor, const FaceArg &face, const StateArg &time) |
perform a possibly skew-corrected linear interpolation by evaluating the supplied functor with the provided functor face argument More... | |
template<typename T1 , typename T2 , typename T3 , template< typename > class Vector1, template< typename > class Vector2> | |
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) |
Computes the product of the advected and the advector based on the given interpolation method. More... | |
template<typename T , typename T2 , typename T3 , typename Vector > | |
void | interpolate (InterpMethod m, T &result, const T2 &value1, const T3 &value2, const Vector &advector, const FaceInfo &fi, const bool one_is_elem) |
Provides interpolation of face values for advective flux kernels. More... | |
ADReal | gradUDotNormal (const FaceInfo &face_info, const MooseVariableFV< Real > &fv_var, const Moose::StateArg &time, bool correct_skewness=false) |
Calculates and returns "grad_u dot normal" on the face to be used for diffusive terms. More... | |
template<typename Scalar , typename Vector > | |
Scalar | rF (const Scalar &phiC, const Scalar &phiD, const Vector &gradC, const RealVectorValue &dCD) |
From Moukalled 12.30. More... | |
template<typename T > | |
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) |
Produce the interpolation coefficients in the equation: More... | |
template<typename Scalar , typename Vector , typename Enable = typename std::enable_if<libMesh::ScalarTraits<Scalar>::value>::type> | |
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) |
Interpolates with a limiter. More... | |
template<typename Limiter , typename T , typename Tensor > | |
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) |
Vector overload. More... | |
template<typename T > | |
T | 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) |
This function performs a full limited interpolation of a variable, taking into account the values and gradients at both upwind and downwind locations, as well as geometric information and limits. More... | |
template<typename T , FunctorEvaluationKind FEK = FunctorEvaluationKind::Value, typename Enable = typename std::enable_if<ScalarTraits<T>::value>::type> | |
std::pair< Real, Real > | computeMinMaxValue (const FunctorBase< T > &functor, const FaceArg &face, const StateArg &time) |
This function calculates the minimum and maximum values within a two-cell stencil. More... | |
template<typename T > | |
std::pair< Real, Real > | computeMinMaxValue (const FunctorBase< VectorValue< T >> &functor, const FaceArg &face, const StateArg &time, const unsigned int &component) |
This function calculates the minimum and maximum values of a specified component within a two-cell stencil. More... | |
template<typename T , FunctorEvaluationKind FEK = FunctorEvaluationKind::Value, typename Enable = typename std::enable_if<libMesh::ScalarTraits<T>::value>::type> | |
std::pair< std::pair< T, T >, std::pair< T, T > > | interpCoeffsAndAdvected (const FunctorBase< T > &functor, const FaceArg &face, const StateArg &time) |
This function interpolates values using a specified limiter and face argument. More... | |
template<typename T , FunctorEvaluationKind FEK = FunctorEvaluationKind::Value, typename Enable = typename std::enable_if<libMesh::ScalarTraits<T>::value>::type> | |
T | interpolate (const FunctorBase< T > &functor, const FaceArg &face, const StateArg &time) |
This function interpolates values at faces in a computational grid using a specified functor, face argument, and evaluation kind. More... | |
template<typename T > | |
libMesh::VectorValue< T > | interpolate (const FunctorBase< libMesh::VectorValue< T >> &functor, const FaceArg &face, const StateArg &time) |
This function interpolates vector values at faces in a computational grid using a specified functor, face argument, and limiter type. More... | |
template<typename T > | |
T | containerInterpolate (const FunctorBase< T > &functor, const FaceArg &face, const StateArg &time) |
This function interpolates container values at faces in a computational grid using a specified functor, face argument, and limiter type. More... | |
template<typename T > | |
std::vector< T > | interpolate (const FunctorBase< std::vector< T >> &functor, const FaceArg &face, const StateArg &time) |
template<typename T , std::size_t N> | |
std::array< T, N > | interpolate (const FunctorBase< std::array< T, N >> &functor, const FaceArg &face, const StateArg &time) |
template<typename SubdomainRestrictable > | |
bool | onBoundary (const SubdomainRestrictable &obj, const FaceInfo &fi) |
Return whether the supplied face is on a boundary of the object's execution. More... | |
bool | onBoundary (const std::set< SubdomainID > &subs, const FaceInfo &fi) |
Determine whether the passed-in face is on the boundary of an object that lives on the provided subdomains. More... | |
const MooseEnum | moose_limiter_type ("vanLeer=0 upwind=1 central_difference=2 min_mod=3 sou=4 quick=5 venkatakrishnan=6", "upwind") |
Variables | |
const MooseEnum | moose_limiter_type |
|
strong |
This codifies a set of available ways to interpolate with elem+neighbor solution information to calculate values (e.g.
solution, material properties, etc.) at the face (centroid). These methods are used in the class's interpolate functions. Some interpolation methods are only meant to be used with advective terms (e.g. upwind), others are more generically applicable.
Definition at line 35 of file MathFVUtils.h.
|
strong |
Enumerator | |
---|---|
VanLeer | |
Upwind | |
CentralDifference | |
MinMod | |
SOU | |
QUICK | |
Venkatakrishnan |
Definition at line 26 of file Limiter.h.
|
strong |
Enumerator | |
---|---|
RHS | |
Matrix | |
FullSystem |
Definition at line 54 of file MathFVUtils.h.
InputParameters Moose::FV::advectedInterpolationParameter | ( | ) |
advected_interp_method
parameter, e.g. the interpolation method to use for an advected quantity Definition at line 68 of file MathFVUtils.C.
Referenced by FVAdvection::validParams(), and LinearFVAdvection::validParams().
std::pair<Real, Real> Moose::FV::computeMinMaxValue | ( | const FunctorBase< T > & | functor, |
const FaceArg & | face, | ||
const StateArg & | time | ||
) |
This function calculates the minimum and maximum values within a two-cell stencil.
The stencil includes the immediate neighboring elements of the face's associated element and the neighboring elements of those neighbors. It evaluates the values using a provided functor and accounts for the valid (non-null) neighbors.
T | The data type for the values being computed. This is typically a scalar type. |
FEK | Enumeration type FunctorEvaluationKind with a default value of FunctorEvaluationKind::Value. This determines the kind of evaluation the functor will perform. |
Enable | A type trait used for SFINAE (Substitution Failure Is Not An Error) to ensure that T is a valid scalar type as determined by ScalarTraits<T>. |
functor | An object of a functor class derived from FunctorBase<T>. This object provides the genericEvaluate method to compute the value at a given element and time. |
face | An argument representing the face in the computational domain. The face provides access to neighboring elements via neighbor_ptr_range(). |
time | An argument representing the state or time at which the evaluation is performed. |
Definition at line 645 of file MathFVUtils.h.
Referenced by interpCoeffsAndAdvected(), and interpolate().
std::pair<Real, Real> Moose::FV::computeMinMaxValue | ( | const FunctorBase< VectorValue< T >> & | functor, |
const FaceArg & | face, | ||
const StateArg & | time, | ||
const unsigned int & | component | ||
) |
This function calculates the minimum and maximum values of a specified component within a two-cell stencil.
The stencil includes the immediate neighboring elements of the face's associated element and the neighboring elements of those neighbors. It evaluates the values using a provided functor and accounts for the valid (non-null) neighbors.
T | The data type for the values being computed. This is typically a scalar type. |
functor | An object of a functor class derived from FunctorBase<VectorValue<T>>. This object provides the operator() method to compute the value at a given element and time. |
face | An argument representing the face in the computational domain. The face provides access to neighboring elements via neighbor_ptr_range(). |
time | An argument representing the state or time at which the evaluation is performed. |
component | An unsigned integer representing the specific component of the vector to be evaluated. |
Usage: This function is typically used in the finite volume methods for min-max computations over stencils (neighborhoods). It helps compute the limiting for limited second order upwind at the faces.
Definition at line 711 of file MathFVUtils.h.
T Moose::FV::containerInterpolate | ( | const FunctorBase< T > & | functor, |
const FaceArg & | face, | ||
const StateArg & | time | ||
) |
This function interpolates container values at faces in a computational grid using a specified functor, face argument, and limiter type.
It handles different limiter types and performs interpolation accordingly.
T | The data type for the container values being interpolated. This is typically a container type such as a vector or array. |
functor | An object of a functor class derived from FunctorBase<T>. This object provides the operator() method to compute the value at a given element and time. |
face | An argument representing the face in the computational domain. The face provides access to neighboring elements and limiter type. |
time | An argument representing the state or time at which the evaluation is performed. |
Usage: This function is used for interpolating container values at faces in a finite volume method, ensuring that the interpolation adheres to the constraints imposed by the limiter.
Definition at line 1087 of file MathFVUtils.h.
Referenced by interpolate().
std::tuple<const Elem *, const Elem *, bool> Moose::FV::determineElemOneAndTwo | ( | const FaceInfo & | fi, |
const FVVar & | var | ||
) |
This utility determines element one and element two given a FaceInfo
fi
and variable var
.
You may ask what in the world "element one" and "element two" means, and that would be a very good question. What it means is: a variable will always have degrees of freedom on element one. A variable may or may not have degrees of freedom on element two. So we are introducing a second terminology here. FaceInfo geometric objects have element-neighbor pairs. These element-neighbor pairs are purely geometric and have no relation to the algebraic system of variables. The elem1-elem2 notation introduced here is based on dof/algebraic information and may very well be different from variable to variable, e.g. elem1 may correspond to the FaceInfo elem for one variable (and correspondingly elem2 will be the FaceInfo neighbor), but elem1 may correspond to the FaceInfo neighbor for another variable (and correspondingly for that variable elem2 will be the FaceInfo elem).
Definition at line 130 of file FVUtils.h.
Referenced by MooseVariableFV< Real >::getExtrapolatedBoundaryFaceValue().
bool Moose::FV::elemHasFaceInfo | ( | const Elem & | elem, |
const Elem *const | neighbor | ||
) |
This function infers based on elements if the faceinfo between them belongs to the element or not.
elem | Reference to an element |
neighbor | Pointer to the neighbor of the element |
Definition at line 21 of file FVUtils.C.
Referenced by MooseMesh::buildFiniteVolumeInfo(), and loopOverElemFaceInfo().
T Moose::FV::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 | ||
) |
This function performs a full limited interpolation of a variable, taking into account the values and gradients at both upwind and downwind locations, as well as geometric information and limits.
It applies the specified limiter to ensure the interpolation adheres to the constraints imposed by the limiter.
T | The data type of the scalar values and the return type. |
limiter | The limiter object used to compute the flux limiting ratio. |
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_face | Pointer to the gradient at the face location. |
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. |
max_value | The maximum allowable value. |
min_value | The minimum allowable value. |
Definition at line 580 of file MathFVUtils.h.
Referenced by interpolate().
ADReal Moose::FV::gradUDotNormal | ( | const FaceInfo & | face_info, |
const MooseVariableFV< Real > & | fv_var, | ||
const Moose::StateArg & | time, | ||
bool | correct_skewness = false |
||
) |
Calculates and returns "grad_u dot normal" on the face to be used for diffusive terms.
If using any cross-diffusion corrections, etc. all those calculations should be handled appropriately by this function.
Definition at line 18 of file MathFVUtils.C.
Referenced by FVFluxKernel::gradUDotNormal().
libMesh::VectorValue<T> Moose::FV::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 |
||
) |
Compute a cell gradient using the method of Green-Gauss.
elem_arg | An element argument specifying the current element and whether to perform skew corrections |
state_arg | A state argument that indicates what temporal / solution iteration data to use when evaluating the provided functor |
functor | The functor that will provide information such as cell and face value evaluations necessary to construct the cell gradient |
two_term_boundary_expansion | Whether to perform a two-term expansion to compute extrapolated boundary face values. If this is true, then an implicit system has to be solved. If false, then the cell center value will be used as the extrapolated boundary face value |
mesh | The mesh on which we are computing the gradient |
Definition at line 41 of file GreenGaussGradient.h.
Referenced by MooseVariableFV< Real >::adGradSln(), PiecewiseByBlockLambdaFunctor< T >::evaluateGradient(), and greenGaussGradient().
libMesh::VectorValue<T> Moose::FV::greenGaussGradient | ( | const FaceArg & | face_arg, |
const StateArg & | state_arg, | ||
const FunctorBase< T > & | functor, | ||
const bool | two_term_boundary_expansion, | ||
const MooseMesh & | mesh | ||
) |
Compute a face gradient from Green-Gauss cell gradients, with orthogonality correction On the boundaries, the boundary element value is used.
face_arg | A face argument specifying the current faceand whether to perform skew corrections |
state_arg | A state argument that indicates what temporal / solution iteration data to use when evaluating the provided functor |
functor | The functor that will provide information such as cell and face value evaluations necessary to construct the cell gradient |
two_term_boundary_expansion | Whether to perform a two-term expansion to compute extrapolated boundary face values. If this is true, then an implicit system has to be solved. If false, then the cell center value will be used as the extrapolated boundary face value |
mesh | The mesh on which we are computing the gradient |
Definition at line 548 of file GreenGaussGradient.h.
TensorValue<T> Moose::FV::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 | ||
) |
Definition at line 606 of file GreenGaussGradient.h.
TensorValue<T> Moose::FV::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 | ||
) |
Definition at line 627 of file GreenGaussGradient.h.
Moose::FunctorBase<std::vector<T> >::GradientType Moose::FV::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 | ||
) |
Definition at line 648 of file GreenGaussGradient.h.
Moose::FunctorBase<std::vector<T> >::GradientType Moose::FV::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 | ||
) |
Definition at line 673 of file GreenGaussGradient.h.
Moose::FunctorBase<std::array<T, N> >::GradientType Moose::FV::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 | ||
) |
Definition at line 698 of file GreenGaussGradient.h.
Moose::FunctorBase<std::array<T, N> >::GradientType Moose::FV::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 | ||
) |
Definition at line 721 of file GreenGaussGradient.h.
libMesh::CompareTypes<T1, T2>::supertype Moose::FV::harmonicInterpolation | ( | const T1 & | value1, |
const T2 & | value2, | ||
const FaceInfo & | fi, | ||
const bool | one_is_elem | ||
) |
Computes the harmonic mean (1/(gc/value1+(1-gc)/value2)) of Reals, RealVectorValues and RealTensorValues while accounting for the possibility that one or both of them are AD.
For tensors, we use a component-wise mean instead of the matrix-inverse based option.
value1 | Reference to value1 in the (1/(gc/value1+(1-gc)/value2)) expression |
value2 | Reference to value2 in the (1/(gc/value1+(1-gc)/value2)) expression |
fi | Reference to the FaceInfo of the face on which the interpolation is requested |
one_is_elem | Boolean indicating if the interpolation weight on FaceInfo belongs to the element corresponding to value1 |
Definition at line 177 of file MathFVUtils.h.
Referenced by interpolate().
std::pair<Real, Real> Moose::FV::interpCoeffs | ( | const InterpMethod | m, |
const FaceInfo & | fi, | ||
const bool | one_is_elem, | ||
const T & | face_flux = 0.0 |
||
) |
Produce the interpolation coefficients in the equation:
= c_1 * {F1} + c_2 * {F2}
A couple of examples: if we are doing an average interpolation with an orthogonal regular grid, then the pair will be (0.5, 0.5). If we are doing an upwind interpolation with the velocity facing outward from the F1 element, then the pair will be (1.0, 0.0).
The template is needed in case the face flux carries derivatives in an AD setting.
m | The interpolation method |
fi | The face information |
one_is_elem | Whether fi.elem() == F1 |
face_flux | The advecting face flux. Not relevant for an Average interpolation |
Definition at line 114 of file MathFVUtils.h.
Referenced by LinearFVAdvection::computeElemMatrixContribution(), LinearFVAnisotropicDiffusion::computeFluxRHSContribution(), LinearFVDiffusion::computeFluxRHSContribution(), LinearFVAdvection::computeNeighborMatrixContribution(), containerInterpolate(), harmonicInterpolation(), interpCoeffsAndAdvected(), interpolate(), linearInterpolation(), and skewCorrectedLinearInterpolation().
std::pair<T, T> Moose::FV::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 | ||
) |
Produce the interpolation coefficients in the equation:
= c_upwind * {upwind} + c_downwind * {downwind}
A couple of examples: if we are doing an average interpolation with an orthogonal regular grid, then the pair will be (0.5, 0.5). If we are doing an upwind interpolation then the pair will be (1.0, 0.0).
Definition at line 472 of file MathFVUtils.h.
std::pair<std::pair<T, T>, std::pair<T, T> > Moose::FV::interpCoeffsAndAdvected | ( | const FunctorBase< T > & | functor, |
const FaceArg & | face, | ||
const StateArg & | time | ||
) |
This function interpolates values using a specified limiter and face argument.
It evaluates the values at upwind and downwind locations and computes interpolation coefficients and advected values.
T | The data type for the values being interpolated. This is typically a scalar type. |
FEK | Enumeration type FunctorEvaluationKind with a default value of FunctorEvaluationKind::Value. This determines the kind of evaluation the functor will perform. |
Enable | A type trait used for SFINAE (Substitution Failure Is Not An Error) to ensure that T is a valid scalar type as determined by ScalarTraits<T>. |
functor | An object of a functor class derived from FunctorBase<T>. This object provides the genericEvaluate method to compute the value at a given element and time. |
face | An argument representing the face in the computational domain. The face provides access to neighboring elements and limiter type. |
time | An argument representing the state or time at which the evaluation is performed. |
Usage: This function is used for interpolating values at faces in a finite volume method, ensuring that the interpolation adheres to the constraints imposed by the limiter.
Definition at line 785 of file MathFVUtils.h.
void Moose::FV::interpolate | ( | InterpMethod | m, |
T & | result, | ||
const T2 & | value1, | ||
const T3 & | value2, | ||
const FaceInfo & | fi, | ||
const bool | one_is_elem | ||
) |
Provides interpolation of face values for non-advection-specific purposes (although it can/will still be used by advective kernels sometimes).
The interpolated value is stored in result. This should be called when a face value needs to be computed from two neighboring cells/elements. value1 and value2 represent the cell property/values from which to compute the face value. The one_is_elem
parameter indicates whether value1 corresponds to the FaceInfo elem value; else it corresponds to the FaceInfo neighbor value
Definition at line 282 of file MathFVUtils.h.
Referenced by InterfaceDiffusiveFluxIntegralTempl< is_ad >::computeQpIntegral(), FVDiffusionInterface::computeQpResidual(), FVOneVarDiffusionInterface::computeQpResidual(), FVOrthogonalDiffusion::computeQpResidual(), FVAnisotropicDiffusion::computeQpResidual(), FVDiffusion::computeQpResidual(), PiecewiseByBlockLambdaFunctor< T >::evaluate(), MooseLinearVariableFV< Real >::evaluate(), MooseVariableFV< Real >::evaluate(), greenGaussGradient(), and interpolate().
void Moose::FV::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 | ||
) |
Computes the product of the advected and the advector based on the given interpolation method.
Definition at line 355 of file MathFVUtils.h.
void Moose::FV::interpolate | ( | InterpMethod | m, |
T & | result, | ||
const T2 & | value1, | ||
const T3 & | value2, | ||
const Vector & | advector, | ||
const FaceInfo & | fi, | ||
const bool | one_is_elem | ||
) |
Provides interpolation of face values for advective flux kernels.
This should be called by advective kernels when a face value is needed from two neighboring cells/elements. The interpolated value is stored in result. value1 and value2 represent the two neighboring advected cell property/values. advector represents the vector quantity at the face that is doing the advecting (e.g. the flow velocity at the face); this value often will have been computed using a call to the non-advective interpolate function. The one_is_elem
parameter indicates whether value1 corresponds to the FaceInfo elem value; else it corresponds to the FaceInfo neighbor value
Definition at line 402 of file MathFVUtils.h.
Scalar Moose::FV::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 | ||
) |
Interpolates with a limiter.
Definition at line 507 of file MathFVUtils.h.
libMesh::VectorValue<T> Moose::FV::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 | ||
) |
Vector overload.
Definition at line 532 of file MathFVUtils.h.
T Moose::FV::interpolate | ( | const FunctorBase< T > & | functor, |
const FaceArg & | face, | ||
const StateArg & | time | ||
) |
This function interpolates values at faces in a computational grid using a specified functor, face argument, and evaluation kind.
It handles different limiter types and performs interpolation accordingly.
T | The data type for the values being interpolated. This is typically a scalar type. |
FEK | Enumeration type FunctorEvaluationKind with a default value of FunctorEvaluationKind::Value. This determines the kind of evaluation the functor will perform. |
Enable | A type trait used for SFINAE (Substitution Failure Is Not An Error) to ensure that T is a valid scalar type as determined by ScalarTraits<T>. |
functor | An object of a functor class derived from FunctorBase<T>. This object provides the genericEvaluate method to compute the value at a given element and time. |
face | An argument representing the face in the computational domain. The face provides access to neighboring elements and limiter type. |
time | An argument representing the state or time at which the evaluation is performed. |
Usage: This function is used for interpolating values at faces in a finite volume method, ensuring that the interpolation adheres to the constraints imposed by the limiter.
Definition at line 893 of file MathFVUtils.h.
libMesh::VectorValue<T> Moose::FV::interpolate | ( | const FunctorBase< libMesh::VectorValue< T >> & | functor, |
const FaceArg & | face, | ||
const StateArg & | time | ||
) |
This function interpolates vector values at faces in a computational grid using a specified functor, face argument, and limiter type.
It handles different limiter types and performs interpolation accordingly.
T | The data type for the vector values being interpolated. This is typically a scalar type. |
functor | An object of a functor class derived from FunctorBase<VectorValue<T>>. This object provides the operator() method to compute the value at a given element and time. |
face | An argument representing the face in the computational domain. The face provides access to neighboring elements and limiter type. |
time | An argument representing the state or time at which the evaluation is performed. |
Usage: This function is used for interpolating vector values at faces in a finite volume method, ensuring that the interpolation adheres to the constraints imposed by the limiter.
Definition at line 978 of file MathFVUtils.h.
std::vector<T> Moose::FV::interpolate | ( | const FunctorBase< std::vector< T >> & | functor, |
const FaceArg & | face, | ||
const StateArg & | time | ||
) |
Definition at line 1148 of file MathFVUtils.h.
std::array<T, N> Moose::FV::interpolate | ( | const FunctorBase< std::array< T, N >> & | functor, |
const FaceArg & | face, | ||
const StateArg & | time | ||
) |
Definition at line 1157 of file MathFVUtils.h.
MooseEnum Moose::FV::interpolationMethods | ( | ) |
Returns an enum with all the currently supported interpolation methods and the current default for FV: first-order upwind.
Definition at line 61 of file MathFVUtils.C.
Referenced by advectedInterpolationParameter().
LimiterType Moose::FV::limiterType | ( | InterpMethod | interp_method | ) |
Return the limiter type associated with the supplied interpolation method.
Definition at line 63 of file Limiter.C.
Referenced by FVAdvection::computeQpResidual(), FVMatAdvection::computeQpResidual(), and FVDivergence::computeQpResidual().
libMesh::CompareTypes<T, T2>::supertype Moose::FV::linearInterpolation | ( | const T & | value1, |
const T2 & | value2, | ||
const FaceInfo & | fi, | ||
const bool | one_is_elem, | ||
const InterpMethod | interp_method = InterpMethod::Average |
||
) |
A simple linear interpolation of values between cell centers to a cell face.
The one_is_elem
parameter indicates whether value1 corresponds to the FaceInfo elem value; else it corresponds to the FaceInfo neighbor value
Definition at line 150 of file MathFVUtils.h.
Referenced by MooseLinearVariableFV< Real >::gradSln(), interpolate(), linearInterpolation(), ComputeLinearFVGreenGaussGradientFaceThread::operator()(), and MooseVariableFV< Real >::uncorrectedAdGradSln().
T Moose::FV::linearInterpolation | ( | const FunctorBase< T > & | functor, |
const FaceArg & | face, | ||
const StateArg & | time | ||
) |
perform a possibly skew-corrected linear interpolation by evaluating the supplied functor with the provided functor face argument
Definition at line 309 of file MathFVUtils.h.
void Moose::FV::loopOverElemFaceInfo | ( | const Elem & | elem, |
const MooseMesh & | mesh, | ||
ActionFunctor & | act, | ||
const Moose::CoordinateSystemType | coord_type, | ||
const unsigned int | rz_radial_coord = libMesh::invalid_uint |
||
) |
Definition at line 42 of file FVUtils.h.
Referenced by greenGaussGradient().
const MooseEnum Moose::FV::moose_limiter_type | ( | ) |
bool Moose::FV::onBoundary | ( | const SubdomainRestrictable & | obj, |
const FaceInfo & | fi | ||
) |
Return whether the supplied face is on a boundary of the object's
execution.
Definition at line 1169 of file MathFVUtils.h.
Referenced by FVFluxKernel::onBoundary(), ThreadedElementLoopBase< ConstElemPointerRange >::operator()(), and ThreadedFaceLoop< RangeType >::operator()().
bool Moose::FV::onBoundary | ( | const std::set< SubdomainID > & | subs, |
const FaceInfo & | fi | ||
) |
Determine whether the passed-in face is on the boundary of an object that lives on the provided subdomains.
Note that if the subdomain set is empty we consider that to mean that the object has no block restriction and lives on the entire mesh
Definition at line 28 of file MathFVUtils.C.
Scalar Moose::FV::rF | ( | const Scalar & | phiC, |
const Scalar & | phiD, | ||
const Vector & | gradC, | ||
const RealVectorValue & | dCD | ||
) |
From Moukalled 12.30.
r_f = (phiC - phiU) / (phiD - phiC)
However, this formula is only clear on grids where upwind locations can be readily determined, which is not the case for unstructured meshes. So we leverage a virtual upwind location and Moukalled 12.65
phiD - phiU = 2 * grad(phi)_C * dCD -> phiU = phiD - 2 * grad(phi)_C * dCD
Combining the two equations and performing some algebraic manipulation yields this equation for r_f:
r_f = 2 * grad(phi)_C * dCD / (phiD - phiC) - 1
This equation is clearly asymmetric considering the face between C and D because of the subscript on grad(phi). Hence this method can be thought of as constructing an r associated with the C side of the face
Definition at line 445 of file MathFVUtils.h.
Referenced by Moose::FV::MinModLimiter< T >::limit(), Moose::FV::VanLeerLimiter< T >::limit(), and Moose::FV::QUICKLimiter< T >::limit().
InterpMethod Moose::FV::selectInterpolationMethod | ( | const std::string & | interp_method | ) |
Definition at line 81 of file MathFVUtils.C.
Referenced by setInterpolationMethod(), FVRelationshipManagerInterface::setRMParamsAdvection(), and FVRelationshipManagerInterface::setRMParamsDiffusion().
bool Moose::FV::setInterpolationMethod | ( | const MooseObject & | obj, |
Moose::FV::InterpMethod & | interp_method, | ||
const std::string & | param_name | ||
) |
Sets one interpolation method.
obj | The MooseObject with input parameters to query |
interp_method | The interpolation method we will set |
param_name | The name of the parameter setting this interpolation method |
Definition at line 110 of file MathFVUtils.C.
Referenced by FVAdvection::FVAdvection(), and LinearFVAdvection::LinearFVAdvection().
libMesh::CompareTypes<T, T2>::supertype Moose::FV::skewCorrectedLinearInterpolation | ( | const T & | value1, |
const T2 & | value2, | ||
const T3 & | face_gradient, | ||
const FaceInfo & | fi, | ||
const bool | one_is_elem | ||
) |
Linear interpolation with skewness correction using the face gradient.
See more info in Moukalled Chapter 9. The correction involves a first order Taylor expansion around the intersection of the cell face and the line connecting the two cell centers.
Definition at line 261 of file MathFVUtils.h.
Referenced by linearInterpolation().
const MooseEnum Moose::FV::moose_limiter_type |