1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation, either version 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
28 Barth-Jespersen limiter
31 Aleksandar Jemcov, Hrvoje Jasak
33 \*---------------------------------------------------------------------------*/
35 #ifndef BarthJespersenLimiter_H
36 #define BarthJespersenLimiter_H
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 /*---------------------------------------------------------------------------*\
46 Class BarthJespersenLimiter Declaration
47 \*---------------------------------------------------------------------------*/
49 class BarthJespersenLimiter
56 BarthJespersenLimiter()
60 // Desctructor - default
65 //- Return limiter value
68 const scalar& cellVolume,
69 const scalar& deltaOneMax,
70 const scalar& deltaOneMin,
71 const scalar& deltaTwo
74 if (mag(deltaTwo) < SMALL)
80 scalar deltaTwoStab = stabilise(deltaTwo, VSMALL);
86 max(deltaOneMax/deltaTwoStab, 0),
87 max(deltaOneMin/deltaTwoStab, 0)
94 //- Return scalar limiter
97 const scalar& cellVolume,
98 const scalar& faceFlux,
99 const scalar& deltaOneMax,
100 const scalar& deltaOneMin,
101 const vector& gradPhiP,
102 const vector& gradPhiN,
115 //- Return vector limiter
116 inline vector limiter
118 const scalar& cellVolume,
119 const scalar& faceFlux,
120 const vector& deltaOneMax,
121 const vector& deltaOneMin,
122 const tensor& gradPhiP,
123 const tensor& gradPhiN,
127 vector deltaTwo = d & gradPhiP;
134 deltaOneMax[vector::X],
135 deltaOneMin[vector::X],
141 deltaOneMax[vector::Y],
142 deltaOneMin[vector::Y],
148 deltaOneMax[vector::Z],
149 deltaOneMin[vector::Z],
155 //- Return limiter for a symmTensor
156 inline symmTensor limiter
158 const scalar& cellVolume,
159 const scalar& faceFlux,
160 const symmTensor& deltaOneMax,
161 const symmTensor& deltaOneMin,
162 const vector& gradPhiPXX,
163 const vector& gradPhiNXX,
164 const vector& gradPhiPXY,
165 const vector& gradPhiNXY,
166 const vector& gradPhiPXZ,
167 const vector& gradPhiNXZ,
168 const vector& gradPhiPYY,
169 const vector& gradPhiNYY,
170 const vector& gradPhiPYZ,
171 const vector& gradPhiNYZ,
172 const vector& gradPhiPZZ,
173 const vector& gradPhiNZZ,
226 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
228 } // End namespace Foam
232 // ************************************************************************* //