https://mooseframework.inl.gov
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 
15 namespace Moose
16 {
17 namespace FV
18 {
47 template <typename T>
49 {
50 public:
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 
76  const auto delta_face = (*grad_phi_upwind) * (face_centroid - cell_centroid);
77  const auto delta_max = std::abs(max_value - phi_upwind) + 1e-10;
78  const auto delta_min = std::abs(min_value - phi_upwind) + 1e-10;
79 
80  const auto rf =
81  delta_face >= 0 ? std::abs(delta_face) / delta_max : std::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 
90  VenkatakrishnanLimiter() = default;
91 };
92 }
93 }
MetaPhysicL::DualNumber< V, D, asd > abs(const MetaPhysicL::DualNumber< V, D, asd > &a)
Definition: EigenADReal.h:42
Base class for defining slope limiters for finite volume or potentially reconstructed Discontinuous-G...
Definition: Limiter.h:62
InterpMethod interpMethod() const override final
bool constant() const override final
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.
This data structure is used to store geometric and variable related metadata about each cell face in ...
Definition: FaceInfo.h:36
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
InterpMethod
This codifies a set of available ways to interpolate with elem+neighbor solution information to calcu...
Definition: MathFVUtils.h:35