https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
15namespace Moose
16{
17namespace FV
18{
33template <typename T>
34class SOULimiter : public Limiter<T>
35{
36public:
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 using std::abs;
62 using std::min;
63
64 T delta_face = abs((*grad_phi_upwind) * dCD);
65 T delta_max = abs(max_value - min_value);
66
67 if (delta_face > 1e-10)
68 return min(1.0, delta_max / delta_face);
69 else
70 return T(1.0);
71 }
72
73 bool constant() const override final { return false; }
74
75 InterpMethod interpMethod() const override final { return InterpMethod::SOU; }
76
77 SOULimiter() = default;
78};
79}
80}
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 SOU limiter is used for reproducing the second-order-upwind scheme.
Definition SOULimiter.h:35
bool constant() const override final
Definition SOULimiter.h:73
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:75
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...