vanLeer.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::vanLeerLimiter
28 
29 Group
30  grpFvLimitedSurfaceInterpolationSchemes
31 
32 Description
33  Class with limiter function which returns the limiter for the
34  vanLeer differencing scheme based on r obtained from the LimiterFunc
35  class.
36 
37  Used in conjunction with the template class LimitedScheme.
38 
39 SourceFiles
40  vanLeer.C
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #ifndef vanLeer_H
45 #define vanLeer_H
46 
47 #include "vector.H"
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 namespace Foam
52 {
53 
54 /*---------------------------------------------------------------------------*\
55  Class vanLeerLimiter Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 template<class LimiterFunc>
59 class vanLeerLimiter
60 :
61  public LimiterFunc
62 {
63 
64 public:
65 
67  {}
68 
69  scalar limiter
70  (
71  const scalar,
72  const scalar faceFlux,
73  const typename LimiterFunc::phiType& phiP,
74  const typename LimiterFunc::phiType& phiN,
75  const typename LimiterFunc::gradPhiType& gradcP,
76  const typename LimiterFunc::gradPhiType& gradcN,
77  const vector& d
78  ) const
79  {
80  scalar r = LimiterFunc::r
81  (
82  faceFlux, phiP, phiN, gradcP, gradcN, d
83  );
84 
85  return (r + mag(r))/(1 + mag(r));
86  }
87 };
88 
89 
90 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
91 
92 } // End namespace Foam
93 
94 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
95 
96 #endif
97 
98 // ************************************************************************* //
Foam::vanLeerLimiter
Class with limiter function which returns the limiter for the vanLeer differencing scheme based on r ...
Definition: vanLeer.H:58
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::vanLeerLimiter::vanLeerLimiter
vanLeerLimiter(Istream &)
Definition: vanLeer.H:65
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::vanLeerLimiter::limiter
scalar limiter(const scalar, const scalar faceFlux, const typename LimiterFunc::phiType &phiP, const typename LimiterFunc::phiType &phiN, const typename LimiterFunc::gradPhiType &gradcP, const typename LimiterFunc::gradPhiType &gradcN, const vector &d) const
Definition: vanLeer.H:69
Foam::Vector< scalar >
Foam::mag
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
vector.H