regionFaModel.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) 2019-2020 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::regionModels::regionFaModel
28
29Description
30 Base class for area region models.
31
32Usage
33 Example of the model specification:
34 \verbatim
35 <patchName>
36 {
37 // Mandatory entries (runtime modifiable)
38 region <regionName>;
39 active true;
40
41 // Optional entries (runtime modifiable)
42 infoOutput false;
43 <model>Coeffs
44 {
45 // subdictionary entries
46 }
47
48 // Mandatory/Optional (derived) entries
49 ...
50 }
51 \endverbatim
52
53 where the entries mean:
54 \table
55 Property | Description | Type | Reqd | Dflt
56 region | Name of operand region | word | yes | -
57 active | Flag to activate the model | bool | yes | -
58 infoOutput | Flag to activate information output | bool | no | false
59 \endtable
60
61SourceFiles
62 regionFaModelI.H
63 regionFaModel.C
64
65\*---------------------------------------------------------------------------*/
66
67#ifndef regionFaModel_H
68#define regionFaModel_H
69
70#include "volMesh.H"
71#include "IOdictionary.H"
72#include "Switch.H"
73#include "labelList.H"
74#include "areaFields.H"
75#include "faMesh.H"
76#include "volSurfaceMapping.H"
77
78// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
79
80namespace Foam
81{
82
83namespace regionModels
84{
85
86/*---------------------------------------------------------------------------*\
87 Class regionFaModel Declaration
88\*---------------------------------------------------------------------------*/
89
90class regionFaModel
91:
92 public IOdictionary
93{
94 // Private Member Functions
95
96 //- Construct region mesh and fields
97 void constructMeshObjects();
98
99 //- Initialise the region
100 void initialise();
101
102 //- Read control parameters from dictionary
103 bool init(const dictionary& dict);
104
105
106protected:
107
108 // Protected Data
109
110 //- Reference to the primary mesh database
111 const fvMesh& primaryMesh_;
112
113 //- Reference to fvPatch
114 const fvPatch& patch_;
115
116 //- Reference to the time database
117 const Time& time_;
118
119 //- Active flag
121
122 //- Active information output
124
125 //- Model name
126 const word modelName_;
127
128 //- Pointer to the region mesh database
130
131 //- Model coefficients dictionary
133
134 //- Dictionary of output properties
136
137 //-Volume-to surface mapping
139
141 // Addressing
142
143 //- Patch IDs on the primary region coupled to this region
144 label patchID_;
145
147 //- Region name
150
151public:
153 //- Runtime type information
154 TypeName("regionFaModel");
156
157 //- Default name regionFaModel
159
160 // Constructors
162 //- Construct from mesh and name and dict
164 (
165 const fvPatch& patch,
166 const word& regionType,
168 const dictionary& dict,
169 bool readFields = true
170 );
172 //- No copy construct
173 regionFaModel(const regionFaModel&) = delete;
174
175 //- No copy assignment
176 void operator=(const regionFaModel&) = delete;
178
179 //- Destructor
180 virtual ~regionFaModel() = default;
182
183 // Member Functions
184
185 // Access
186
187 //- Return the reference to the primary mesh database
188 inline const fvMesh& primaryMesh() const;
189
190 //- Return the reference to the time database
191 inline const Time& time() const;
192
193 //- Return the active flag
194 inline const Switch& active() const;
195
196 //- Return the information flag
197 inline const Switch& infoOutput() const;
198
199 //- Return the model name
200 inline const word& modelName() const;
201
202 //- Return the region mesh database
203 inline const faMesh& regionMesh() const;
204
205 //- Return the region mesh database for manipulation
206 inline faMesh& regionMesh();
207
208 //- Return the model coefficients dictionary
209 inline const dictionary& coeffs() const;
210
211 //- Return const access to the output properties dictionary
212 inline const IOdictionary& outputProperties() const;
213
214 //- Return output properties dictionary
216
217 //- Return the solution dictionary
218 inline const dictionary& solution() const;
219
220 //- Return patch ID
221 inline label patchID() const;
222
223
224 // Help Functions
225
226 //- Return mapping between surface and volume fields
227 const volSurfaceMapping& vsm() const;
228
229
230 // Evolution
231
232 //- Main driver routing to evolve the region - calls other evolves
233 virtual void evolve();
234
235 //- Pre-evolve region
236 virtual void preEvolveRegion();
237
238 //- Evolve the region
239 virtual void evolveRegion();
240
241 //- Post-evolve region
242 virtual void postEvolveRegion();
243
244 //- Courant number of the region
245 virtual scalar CourantNumber() const;
246
247
248 // IO
249
250 //- Provide some feedback
251 virtual void info() = 0;
252};
253
254
255// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
256
257} // End namespace regionFaModels
258} // End namespace Foam
259
260// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
261
262#include "regionFaModelI.H"
263
264// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
265
266
267#endif
268
269// ************************************************************************* //
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:57
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:78
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:80
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
dictionary()
Default construct, a top-level empty dictionary.
Definition: dictionary.C:75
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
Definition: faMesh.H:100
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
Base class for area region models.
autoPtr< IOdictionary > outputPropertiesPtr_
Dictionary of output properties.
virtual ~regionFaModel()=default
Destructor.
const Time & time_
Reference to the time database.
const word modelName_
Model name.
virtual void postEvolveRegion()
Post-evolve region.
const Time & time() const
Return the reference to the time database.
const dictionary & solution() const
Return the solution dictionary.
Switch infoOutput_
Active information output.
autoPtr< volSurfaceMapping > vsmPtr_
Volume-to surface mapping.
const dictionary & coeffs() const
Return the model coefficients dictionary.
const fvMesh & primaryMesh() const
Return the reference to the primary mesh database.
static const word regionFaModelName
Default name regionFaModel.
label patchID() const
Return patch ID.
virtual scalar CourantNumber() const
Courant number of the region.
dictionary coeffs_
Model coefficients dictionary.
void operator=(const regionFaModel &)=delete
No copy assignment.
autoPtr< faMesh > regionMeshPtr_
Pointer to the region mesh database.
virtual void preEvolveRegion()
Pre-evolve region.
const Switch & active() const
Return the active flag.
virtual void evolve()
Main driver routing to evolve the region - calls other evolves.
const fvMesh & primaryMesh_
Reference to the primary mesh database.
virtual void info()=0
Provide some feedback.
const fvPatch & patch_
Reference to fvPatch.
const word & modelName() const
Return the model name.
label patchID_
Patch IDs on the primary region coupled to this region.
const volSurfaceMapping & vsm() const
Return mapping between surface and volume fields.
const faMesh & regionMesh() const
Return the region mesh database.
const IOdictionary & outputProperties() const
Return const access to the output properties dictionary.
TypeName("regionFaModel")
Runtime type information.
regionFaModel(const regionFaModel &)=delete
No copy construct.
const Switch & infoOutput() const
Return the information flag.
virtual void evolveRegion()
Evolve the region.
Volume to surface and surface to volume mapping.
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type.
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73