https://mooseframework.inl.gov
SOULimiter.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 {
33 template <typename T>
34 class SOULimiter : public Limiter<T>
35 {
36 public:
50  T limit(const T & /* phi_upwind */,
51  const T & /* phi_downwind */,
52  const VectorValue<T> * grad_phi_upwind,
53  const VectorValue<T> * /* grad_phi_downwind */,
54  const RealVectorValue & dCD,
55  const Real & max_value,
56  const Real & min_value,
57  const FaceInfo * /* fi */,
58  const bool & /*fi_elem_is_upwind */) const override final
59  {
60  mooseAssert(grad_phi_upwind, "SOU limiter requires a gradient");
61 
62  T delta_face = std::abs((*grad_phi_upwind) * dCD);
63  T delta_max = std::abs(max_value - min_value);
64 
65  if (delta_face > 1e-10)
66  return std::min(1.0, delta_max / delta_face);
67  else
68  return T(1.0);
69  }
70 
71  bool constant() const override final { return false; }
72 
73  InterpMethod interpMethod() const override final { return InterpMethod::SOU; }
74 
75  SOULimiter() = default;
76 };
77 }
78 }
MetaPhysicL::DualNumber< V, D, asd > abs(const MetaPhysicL::DualNumber< V, D, asd > &a)
Definition: EigenADReal.h:42
bool constant() const override final
Definition: SOULimiter.h:71
Base class for defining slope limiters for finite volume or potentially reconstructed Discontinuous-G...
Definition: Limiter.h:62
The SOU limiter is used for reproducing the second-order-upwind scheme.
Definition: SOULimiter.h:34
This data structure is used to store geometric and variable related metadata about each cell face in ...
Definition: FaceInfo.h:36
T limit(const T &, const T &, const VectorValue< T > *grad_phi_upwind, const VectorValue< T > *, const RealVectorValue &dCD, const Real &max_value, const Real &min_value, const FaceInfo *, const bool &) const override final
This method overrides the pure virtual limit method in the base Limiter class.
Definition: SOULimiter.h:50
InterpMethod interpMethod() const override final
Definition: SOULimiter.h:73
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
auto min(const L &left, const R &right)