https://mooseframework.inl.gov
Loading...
Searching...
No Matches
VenkatakrishnanLimiter.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
12#include "Limiter.h"
13#include "MathFVUtils.h"
14
15namespace Moose
16{
17namespace FV
18{
47template <typename T>
49{
50public:
63 T limit(const T & phi_upwind,
64 const T & /* phi_downwind */,
65 const VectorValue<T> * grad_phi_upwind,
66 const VectorValue<T> * /* grad_phi_downwind */,
67 const RealVectorValue & /* dCD */,
68 const Real & max_value,
69 const Real & min_value,
70 const FaceInfo * fi,
71 const bool & fi_elem_is_upwind) const override final
72 {
73 const auto face_centroid = fi->faceCentroid();
74 const auto cell_centroid = fi_elem_is_upwind ? fi->elemCentroid() : fi->neighborCentroid();
75 using std::abs;
76
77 const auto delta_face = (*grad_phi_upwind) * (face_centroid - cell_centroid);
78 const auto delta_max = abs(max_value - phi_upwind) + 1e-10;
79 const auto delta_min = abs(min_value - phi_upwind) + 1e-10;
80
81 const auto rf = delta_face >= 0 ? abs(delta_face) / delta_max : abs(delta_face) / delta_min;
82
83 return (2 * rf + 1.0) / (rf * (2 * rf + 1.0) + 1.0);
84 }
85
86 bool constant() const override final { return false; }
87
88 InterpMethod interpMethod() const override final { return InterpMethod::Venkatakrishnan; }
89
91};
92}
93}
This data structure is used to store geometric and variable related metadata about each cell face in ...
Definition FaceInfo.h:38
Base class for defining slope limiters for finite volume or potentially reconstructed Discontinuous-G...
Definition Limiter.h:63
The Venkatakrishnan limiter is derived from the following equations:
T limit(const T &phi_upwind, const T &, const VectorValue< T > *grad_phi_upwind, const VectorValue< T > *, const RealVectorValue &, const Real &max_value, const Real &min_value, const FaceInfo *fi, const bool &fi_elem_is_upwind) const override final
This method overrides the pure virtual limit method in the base Limiter class.
InterpMethod interpMethod() const override final
bool constant() const override final
InterpMethod
This codifies a set of available ways to interpolate with elem+neighbor solution information to calcu...
Definition MathFVUtils.h:39
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...