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-2020 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 fvSchemes 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 
95 public:
96 
97  //- Type information
98  ClassName("fvSchemes");
99 
100 
101  // Constructors
102 
103  //- Construct for objectRegistry
104  fvSchemes(const objectRegistry& obr);
105 
106  //- Disallow default bitwise copy construction
107  fvSchemes(const fvSchemes&) = delete;
108 
109 
110  // Member Functions
111 
112  // Access
113 
114  const dictionary& schemesDict() const;
115 
116  ITstream& ddtScheme(const word& name) const;
117 
118  ITstream& d2dt2Scheme(const word& name) const;
119 
120  ITstream& interpolationScheme(const word& name) const;
121 
122  ITstream& divScheme(const word& name) const;
123 
124  ITstream& gradScheme(const word& name) const;
125 
126  ITstream& snGradScheme(const word& name) const;
127 
128  ITstream& laplacianScheme(const word& name) const;
129 
130  void setFluxRequired(const word& name) const;
131 
132  bool fluxRequired(const word& name) const;
133 
134  //- Return true if the default ddtScheme is steadyState
135  bool steady() const
136  {
137  return steady_;
138  }
139 
140  //- Return true if the default ddtScheme is not steadyState
141  bool transient() const
142  {
143  return !steady_;
144  }
145 
146 
147  // Read
148 
149  //- Read the fvSchemes
150  bool read();
151 
152 
153  // Member Operators
154 
155  //- Disallow default bitwise assignment
156  void operator=(const fvSchemes&) = delete;
157 };
158 
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 } // End namespace Foam
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 #endif
167 
168 // ************************************************************************* //
ITstream & laplacianScheme(const word &name) const
Definition: fvSchemes.C:481
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
fvSchemes(const objectRegistry &obr)
Construct for objectRegistry.
Definition: fvSchemes.C:198
bool read()
Read the fvSchemes.
Definition: fvSchemes.C:332
void setFluxRequired(const word &name) const
Definition: fvSchemes.C:500
ITstream & ddtScheme(const word &name) const
Definition: fvSchemes.C:363
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:53
ITstream & snGradScheme(const word &name) const
Definition: fvSchemes.C:462
const dictionary & schemesDict() const
Definition: fvSchemes.C:350
ITstream & divScheme(const word &name) const
Definition: fvSchemes.C:424
const fileName & name() const
Return the dictionary name.
Definition: dictionary.H:109
void operator=(const fvSchemes &)=delete
Disallow default bitwise assignment.
A class for handling words, derived from string.
Definition: word.H:59
ITstream & interpolationScheme(const word &name) const
Definition: fvSchemes.C:401
ITstream & d2dt2Scheme(const word &name) const
Definition: fvSchemes.C:382
ITstream & gradScheme(const word &name) const
Definition: fvSchemes.C:443
ClassName("fvSchemes")
Type information.
Selector class for finite volume differencing schemes. fvMesh is derived from fvSchemes so that all f...
Definition: fvSchemes.H:50
bool fluxRequired(const word &name) const
Definition: fvSchemes.C:511
bool steady() const
Return true if the default ddtScheme is steadyState.
Definition: fvSchemes.H:134
Registry of regIOobjects.
Input token stream.
Definition: ITstream.H:49
Namespace for OpenFOAM.