LimitFuncs.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-2016 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 Namespace
27  Foam::limitFuncs
28 
29 Description
30  Namespace for limiting functions
31 
32 
33 Class
34  Foam::limitFuncs::LimitFuncs
35 
36 Description
37  Class to create NVD/TVD limited weighting-factors.
38 
39  The particular differencing scheme class is supplied as a template
40  argument, the weight function of which is called by the weight function
41  of this class for the internal faces as well as faces of coupled
42  patches (e.g. processor-processor patches). The weight function is
43  supplied the central-differencing weighting factor, the face-flux, the
44  cell and face gradients (from which the normalised variable
45  distribution may be created) and the cell centre distance.
46 
47  This code organisation is both neat and efficient, allowing for
48  convenient implementation of new schemes to run on parallelised cases.
49 
50 SourceFiles
51  LimitFuncs.C
52 
53 \*---------------------------------------------------------------------------*/
54 
55 #ifndef LimitFuncs_H
56 #define LimitFuncs_H
57 
58 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
59 
60 namespace Foam
61 {
62 
63 namespace limitFuncs
64 {
65 
66 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
67 
68 template<class Type>
69 class null
70 {
71 public:
72 
73  null()
74  {}
75 
77  (
79  ) const
80  {
81  return phi;
82  }
83 };
84 
85 
86 template<class Type>
87 class magSqr
88 {
89 public:
90 
91  magSqr()
92  {}
93 
94  inline tmp<volScalarField> operator()
95  (
97  ) const;
98 };
99 
100 template<>
101 inline tmp<volScalarField> magSqr<scalar>::operator()
102 (
103  const volScalarField& phi
104 ) const;
105 
106 template<>
107 inline tmp<volScalarField> magSqr<symmTensor>::operator()
108 (
109  const volSymmTensorField& phi
110 ) const;
111 
112 template<>
113 inline tmp<volScalarField> magSqr<tensor>::operator()
114 (
115  const volTensorField& phi
116 ) const;
117 
118 
119 template<class Type>
120 class rhoMagSqr
121 {
122 public:
123 
124  rhoMagSqr()
125  {}
126 
127  inline tmp<volScalarField> operator()
128  (
130  ) const;
131 };
132 
133 template<>
134 inline tmp<volScalarField> rhoMagSqr<scalar>::operator()
135 (
136  const volScalarField& phi
137 ) const;
138 
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 } // End namespace limitFuncs
143 } // End namespace Foam
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 #ifdef NoRepository
148  #include "LimitFuncs.C"
149 #endif
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 #endif
154 
155 // ************************************************************************* //
Foam::limitFuncs::magSqr
Definition: LimitFuncs.H:86
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::limitFuncs::rhoMagSqr::rhoMagSqr
rhoMagSqr()
Definition: LimitFuncs.H:123
LimitFuncs.C
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::limitFuncs::rhoMagSqr
Definition: LimitFuncs.H:119
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::limitFuncs::magSqr::magSqr
magSqr()
Definition: LimitFuncs.H:90
Foam::GeometricField< Type, fvPatchField, volMesh >
Foam::limitFuncs::null
Definition: LimitFuncs.H:68