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