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/>.
25 VenkatakrishnanLimiter
28 Venkatakrishnan differentiable limiter
32 Updated by Hrvoje Jasak
34 \*---------------------------------------------------------------------------*/
36 #ifndef VenkatakrishnanLimiter_H
37 #define VenkatakrishnanLimiter_H
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 /*---------------------------------------------------------------------------*\
47 Class VenkatakrishnanLimiter Declaration
48 \*---------------------------------------------------------------------------*/
50 class VenkatakrishnanLimiter
62 VenkatakrishnanLimiter()
70 const scalar& cellVolume,
71 const scalar& deltaOneMax,
72 const scalar& deltaOneMin,
73 const scalar& deltaTwo
76 scalar epsilonSquare = pow3(k_)*cellVolume;
85 (sqr(deltaOneMax) + epsilonSquare)*deltaTwo
86 + 2*sqr(deltaTwo)*deltaOneMax
94 + deltaOneMax*deltaTwo
104 else if (deltaTwo < 0)
111 (sqr(deltaOneMin) + epsilonSquare)*deltaTwo
112 + 2*sqr(deltaTwo)*deltaOneMin
119 + 2.0*sqr(deltaTwo) + deltaOneMin*deltaTwo
135 //- Return limiter for a scalar
136 inline scalar limiter
138 const scalar& cellVolume,
139 const scalar& faceFlux,
140 const scalar& deltaOneMax,
141 const scalar& deltaOneMin,
142 const vector& gradPhiP,
143 const vector& gradPhiN,
156 //- Return limiter for a vector
157 inline vector limiter
159 const scalar& cellVolume,
160 const scalar& faceFlux,
161 const vector& deltaOneMax,
162 const vector& deltaOneMin,
163 const tensor& gradPhiP,
164 const tensor& gradPhiN,
168 vector deltaTwo = d & gradPhiP;
175 deltaOneMax[vector::X],
176 deltaOneMin[vector::X],
182 deltaOneMax[vector::Y],
183 deltaOneMin[vector::Y],
189 deltaOneMax[vector::Z],
190 deltaOneMin[vector::Z],
196 //- Return limiter for a symmTensor
197 inline symmTensor limiter
199 const scalar& cellVolume,
200 const scalar& faceFlux,
201 const symmTensor& deltaOneMax,
202 const symmTensor& deltaOneMin,
203 const vector& gradPhiPXX,
204 const vector& gradPhiNXX,
205 const vector& gradPhiPXY,
206 const vector& gradPhiNXY,
207 const vector& gradPhiPXZ,
208 const vector& gradPhiNXZ,
209 const vector& gradPhiPYY,
210 const vector& gradPhiNYY,
211 const vector& gradPhiPYZ,
212 const vector& gradPhiNYZ,
213 const vector& gradPhiPZZ,
214 const vector& gradPhiNZZ,
267 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
269 } // End namespace Foam
273 // ************************************************************************* //