gaussConvectionScheme.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 | Copyright (C) 2011-2015 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::fv::gaussConvectionScheme
26 
27 Description
28  Basic second-order convection using face-gradients and Gauss' theorem.
29 
30 SourceFiles
31  gaussConvectionScheme.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef gaussConvectionScheme_H
36 #define gaussConvectionScheme_H
37 
38 #include "convectionScheme.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace fv
48 {
49 
50 //- Temporary debug switch to provide warning about backward-compatibility
51 // issue with setting div schemes for steady-state
52 extern int warnUnboundedGauss;
53 
54 /*---------------------------------------------------------------------------*\
55  Class gaussConvectionScheme Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 template<class Type>
60 :
61  public fv::convectionScheme<Type>
62 {
63  // Private data
64 
66 
67 
68  // Private Member Functions
69 
70  //- Disallow default bitwise copy construct
72 
73  //- Disallow default bitwise assignment
74  void operator=(const gaussConvectionScheme&);
75 
76 
77 public:
78 
79  //- Runtime type information
80  TypeName("Gauss");
81 
82 
83  // Constructors
84 
85  //- Construct from flux and interpolation scheme
87  (
88  const fvMesh& mesh,
89  const surfaceScalarField& faceFlux,
91  )
92  :
93  convectionScheme<Type>(mesh, faceFlux),
95  {}
96 
97  //- Construct from flux and Istream
99  (
100  const fvMesh& mesh,
101  const surfaceScalarField& faceFlux,
102  Istream& is
103  )
104  :
105  convectionScheme<Type>(mesh, faceFlux),
107  (
108  surfaceInterpolationScheme<Type>::New(mesh, faceFlux, is)
109  )
110  {
111  is.rewind();
112  word bounded(is);
113 
114  if
115  (
117  && word(mesh.ddtScheme("default")) == "steadyState"
118  && bounded != "bounded"
119  )
120  {
121  fileNameList controlDictFiles(findEtcFiles("controlDict"));
122 
124  << "Unbounded 'Gauss' div scheme used in "
125  "steady-state solver, use 'bounded Gauss' "
126  "to ensure boundedness.\n"
127  << " To remove this warning switch off "
128  << "'warnUnboundedGauss' in "
129  << controlDictFiles[controlDictFiles.size()-1]
130  << endl;
131  }
132  }
133 
134 
135  // Member Functions
136 
138 
140  (
141  const surfaceScalarField&,
143  ) const;
144 
146  (
147  const surfaceScalarField&,
149  ) const;
150 
152  (
153  const surfaceScalarField&,
155  ) const;
156 
158  (
159  const surfaceScalarField&,
161  ) const;
162 };
163 
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 } // End namespace fv
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 } // End namespace Foam
172 
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 
175 #ifdef NoRepository
176 # include "gaussConvectionScheme.C"
177 #endif
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 #endif
182 
183 // ************************************************************************* //
convectionScheme.H
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::fv::gaussConvectionScheme::interpScheme
const surfaceInterpolationScheme< Type > & interpScheme() const
Definition: gaussConvectionScheme.C:44
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::fvSchemes::ddtScheme
ITstream & ddtScheme(const word &name) const
Definition: fvSchemes.C:360
Foam::fv::convectionScheme::New
static tmp< convectionScheme< Type > > New(const fvMesh &mesh, const surfaceScalarField &faceFlux, Istream &schemeData)
Return a pointer to a new convectionScheme created on freestore.
Definition: convectionScheme.C:58
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::fv::gaussConvectionScheme::fvcDiv
tmp< GeometricField< Type, fvPatchField, volMesh > > fvcDiv(const surfaceScalarField &, const GeometricField< Type, fvPatchField, volMesh > &) const
Definition: gaussConvectionScheme.C:121
gaussConvectionScheme.C
Foam::fv::gaussConvectionScheme
Basic second-order convection using face-gradients and Gauss' theorem.
Definition: gaussConvectionScheme.H:58
Foam::fv::gaussConvectionScheme::tinterpScheme_
tmp< surfaceInterpolationScheme< Type > > tinterpScheme_
Definition: gaussConvectionScheme.H:64
Foam::Istream::rewind
virtual Istream & rewind()=0
Rewind and return the stream so that it may be read again.
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:57
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::fv::convectionScheme
Abstract base class for convection schemes.
Definition: convectionScheme.H:64
Foam::fv::gaussConvectionScheme::gaussConvectionScheme
gaussConvectionScheme(const gaussConvectionScheme &)
Disallow default bitwise copy construct.
fv
labelList fv(nPoints)
Foam::fv::gaussConvectionScheme::flux
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > flux(const surfaceScalarField &, const GeometricField< Type, fvPatchField, volMesh > &) const
Definition: gaussConvectionScheme.C:65
Foam::findEtcFiles
fileNameList findEtcFiles(const fileName &, bool mandatory=false, bool findFirst=false)
Search for files from user/group/shipped directories.
Definition: POSIX.C:271
Foam::fv::gaussConvectionScheme::operator=
void operator=(const gaussConvectionScheme &)
Disallow default bitwise assignment.
Foam::fv::gaussConvectionScheme::interpolate
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > interpolate(const surfaceScalarField &, const GeometricField< Type, fvPatchField, volMesh > &) const
Definition: gaussConvectionScheme.C:53
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::surfaceInterpolationScheme
Abstract base class for surface interpolation schemes.
Definition: surfaceInterpolationScheme.H:55
Foam::fv::convectionScheme::mesh
const fvMesh & mesh() const
Return mesh reference.
Definition: convectionScheme.H:156
Foam::List::size
void size(const label)
Override size to be inconsistent with allocated storage.
IOWarningInFunction
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
Definition: messageStream.H:271
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
Foam::fvc::scheme
tmp< surfaceInterpolationScheme< Type > > scheme(const surfaceScalarField &faceFlux, Istream &streamData)
Return weighting factors for scheme given from Istream.
Definition: surfaceInterpolate.C:43
Foam::fv::gaussConvectionScheme::fvmDiv
tmp< fvMatrix< Type > > fvmDiv(const surfaceScalarField &, const GeometricField< Type, fvPatchField, volMesh > &) const
Definition: gaussConvectionScheme.C:77
Foam::fv::warnUnboundedGauss
int warnUnboundedGauss
Temporary debug switch to provide warning about backward-compatibility.
Foam::fv::gaussConvectionScheme::TypeName
TypeName("Gauss")
Runtime type information.