Skip to content
Snippets Groups Projects
Commit ab49eaf9 authored by Shannon Leakey's avatar Shannon Leakey Committed by Andrew Heather
Browse files

BUG: cellLimited<cubic>: ensure the limiter is differentiable (fixes #2113)

parent b4724c37
Branches
Tags
1 merge request!420BUG: fixing various bugs for v2106
...@@ -24,6 +24,7 @@ It is likely incomplete... ...@@ -24,6 +24,7 @@ It is likely incomplete...
- Hrvoje Jasak - Hrvoje Jasak
- Alexander Kabat vel Job - Alexander Kabat vel Job
- Thilo Knacke - Thilo Knacke
- Shannon Leakey
- Tommaso Lucchini - Tommaso Lucchini
- Graham Macpherson - Graham Macpherson
- Alexey Matveichev - Alexey Matveichev
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2018 OpenFOAM Foundation Copyright (C) 2018 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
...@@ -24,7 +25,7 @@ License ...@@ -24,7 +25,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::fv::gradientLimiters::minmod Foam::fv::gradientLimiters::cubic
Description Description
Cubic gradient limiter Cubic gradient limiter
...@@ -44,9 +45,11 @@ Description ...@@ -44,9 +45,11 @@ Description
Michalak, K., & Ollivier-Gooch, C. (2008). Michalak, K., & Ollivier-Gooch, C. (2008).
Limiters for unstructured higher-order accurate solutions Limiters for unstructured higher-order accurate solutions
of the Euler equations. of the Euler equations.
In 46th AIAA Aerospace Sciences Meeting and Exhibit (p. 776). In 46th AIAA Aerospace Sciences Meeting and Exhibition.
DOI:10.2514/6.2008-776
\endverbatim \endverbatim
Usage
Example: Example:
\verbatim \verbatim
gradSchemes gradSchemes
...@@ -57,8 +60,8 @@ Description ...@@ -57,8 +60,8 @@ Description
\endverbatim \endverbatim
See also See also
Foam::fv::cellLimitedGrad - Foam::fv::cellLimitedGrad
Foam::fv::gradientLimiters::Venkatakrishnan - Foam::fv::gradientLimiters::Venkatakrishnan
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
...@@ -102,8 +105,8 @@ public: ...@@ -102,8 +105,8 @@ public:
cubic(Istream& schemeData) cubic(Istream& schemeData)
: :
rt_(readScalar(schemeData)), rt_(readScalar(schemeData)),
a_(2.0/sqr(rt_) - 2.0/pow3(rt_)), a_((rt_ - 2)/pow3(rt_)),
b_(-(3.0/2.0)*a_*rt_) b_(-(3*a_*sqr(rt_) + 1)/(2*rt_))
{ {
if (rt_ < 1) if (rt_ < 1)
{ {
...@@ -123,10 +126,8 @@ public: ...@@ -123,10 +126,8 @@ public:
{ {
return ((a_*r + b_)*r + 1)*r; return ((a_*r + b_)*r + 1)*r;
} }
else
{ return 1;
return 1;
}
} }
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment