fvSchemes.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-2015 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::fvSchemes
28 
29 Description
30  Selector class for finite volume differencing schemes.
31  fvMesh is derived from fvShemes so that all fields have access to the
32  fvSchemes from the mesh reference they hold.
33 
34 SourceFiles
35  fvSchemes.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef fvSchemes_H
40 #define fvSchemes_H
41 
42 #include "IOdictionary.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class fvSchemes Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class fvSchemes
54 :
55  public IOdictionary
56 {
57  // Private data
58 
59  dictionary ddtSchemes_;
60  ITstream defaultDdtScheme_;
61 
62  dictionary d2dt2Schemes_;
63  ITstream defaultD2dt2Scheme_;
64 
65  dictionary interpolationSchemes_;
66  ITstream defaultInterpolationScheme_;
67 
68  dictionary divSchemes_;
69  ITstream defaultDivScheme_;
70 
71  dictionary gradSchemes_;
72  ITstream defaultGradScheme_;
73 
74  dictionary snGradSchemes_;
75  ITstream defaultSnGradScheme_;
76 
77  dictionary laplacianSchemes_;
78  ITstream defaultLaplacianScheme_;
79 
80  mutable dictionary fluxRequired_;
81  bool defaultFluxRequired_;
82 
83  //- Steady-state run indicator
84  // Set true if the default ddtScheme is steadyState
85  bool steady_;
86 
87 
88  // Private Member Functions
89 
90  //- Clear the dictionaries and streams before reading
91  void clear();
92 
93  //- Read settings from the dictionary
94  void read(const dictionary&);
95 
96  //- No copy construct
97  fvSchemes(const fvSchemes&) = delete;
98 
99  //- No copy assignment
100  void operator=(const fvSchemes&) = delete;
101 
102 
103 public:
104 
105  //- Debug switch
106  static int debug;
107 
108 
109  // Constructors
110 
111  //- Construct for objectRegistry
112  fvSchemes(const objectRegistry& obr);
113 
114 
115  // Member Functions
116 
117  // Access
118 
119  const dictionary& schemesDict() const;
120 
121  ITstream& ddtScheme(const word& name) const;
122 
123  ITstream& d2dt2Scheme(const word& name) const;
124 
125  ITstream& interpolationScheme(const word& name) const;
126 
127  ITstream& divScheme(const word& name) const;
128 
129  ITstream& gradScheme(const word& name) const;
130 
131  ITstream& snGradScheme(const word& name) const;
132 
133  ITstream& laplacianScheme(const word& name) const;
134 
135  void setFluxRequired(const word& name) const;
136 
137  bool fluxRequired(const word& name) const;
138 
139  //- Return true if the default ddtScheme is steadyState
140  bool steady() const
141  {
142  return steady_;
143  }
144 
145  //- Return true if the default ddtScheme is not steadyState
146  bool transient() const
147  {
148  return !steady_;
149  }
150 
151 
152  // Read
153 
154  //- Read the fvSchemes
155  bool read();
156 };
157 
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 } // End namespace Foam
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 #endif
166 
167 // ************************************************************************* //
Foam::IOdictionary
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:54
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::fvSchemes::ddtScheme
ITstream & ddtScheme(const word &name) const
Definition: fvSchemes.C:359
Foam::fvSchemes
Selector class for finite volume differencing schemes. fvMesh is derived from fvShemes so that all fi...
Definition: fvSchemes.H:52
Foam::fvSchemes::divScheme
ITstream & divScheme(const word &name) const
Definition: fvSchemes.C:420
Foam::baseIOdictionary::name
const word & name() const
Definition: baseIOdictionary.C:82
Foam::fvSchemes::read
bool read()
Read the fvSchemes.
Definition: fvSchemes.C:332
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:60
Foam::fvSchemes::debug
static int debug
Debug switch.
Definition: fvSchemes.H:105
Foam::fvSchemes::setFluxRequired
void setFluxRequired(const word &name) const
Definition: fvSchemes.C:496
Foam::ITstream
An input stream of tokens.
Definition: ITstream.H:55
Foam::fvSchemes::gradScheme
ITstream & gradScheme(const word &name) const
Definition: fvSchemes.C:439
Foam::fvSchemes::schemesDict
const dictionary & schemesDict() const
Definition: fvSchemes.C:348
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::fvSchemes::snGradScheme
ITstream & snGradScheme(const word &name) const
Definition: fvSchemes.C:458
Foam::fvSchemes::fluxRequired
bool fluxRequired(const word &name) const
Definition: fvSchemes.C:507
Foam::fvSchemes::steady
bool steady() const
Return true if the default ddtScheme is steadyState.
Definition: fvSchemes.H:139
IOdictionary.H
Foam::fvSchemes::interpolationScheme
ITstream & interpolationScheme(const word &name) const
Definition: fvSchemes.C:397
Foam::fvSchemes::d2dt2Scheme
ITstream & d2dt2Scheme(const word &name) const
Definition: fvSchemes.C:378
Foam::fvSchemes::laplacianScheme
ITstream & laplacianScheme(const word &name) const
Definition: fvSchemes.C:477