regionModel1D.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-2016 OpenFOAM Foundation
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::regionModel1D
28
29Description
30 Base class for 1-D region models
31
32SourceFiles
33 regionModel1D.C
34
35\*---------------------------------------------------------------------------*/
36
37#ifndef regionModel1D_H
38#define regionModel1D_H
39
40#include "regionModel.H"
41#include "surfaceFields.H"
42#include "labelList.H"
43
44// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46namespace Foam
47{
48namespace regionModels
49{
50
51/*---------------------------------------------------------------------------*\
52 Class regionModel1D Declaration
53\*---------------------------------------------------------------------------*/
55class regionModel1D
56:
57 public regionModel
58{
59 // Private Member Functions
60
61 //- No copy construct
62 regionModel1D(const regionModel1D&) = delete;
63
64 //- No copy assignment
65 void operator=(const regionModel1D&) = delete;
66
67 //- Construct region mesh and fields
68 void constructMeshObjects();
69
70 //- Initialise the region
71 void initialise();
72
73
74protected:
75
76 // Protected data
77
78 // Region addressing - per internally coupled patch face walking out
79
80 //- Global face IDs
82
83 //- Global cell IDs
85
86 //- Global boundary face IDs oppositte coupled patch
88
89 //- Number of layers in the region
90 label nLayers_;
91
92
93 // Geometry
94
95 //- Face area magnitude normal to patch
97
98 //- Flag to allow mesh movement
100
101
102 // Protected member functions
103
104 //- Read control parameters from dictionary
105 virtual bool read();
106
107 //- Read control parameters from dictionary
108 virtual bool read(const dictionary& dict);
109
110 //- Move mesh points according to change in cell volumes
111 // Returns map ordered by cell where 1 = cell moved, 0 = cell unchanged
113 (
114 const scalarList& deltaV,
115 const scalar minDelta = 0.0
116 );
117
118
119public:
120
121 //- Runtime type information
122 TypeName("regionModel1D");
123
124
125 // Constructors
126
127 //- Construct null
129 (
130 const fvMesh& mesh,
131 const word& regionType
132 );
133
134 //- Construct from mesh, region type and name
136 (
137 const fvMesh& mesh,
138 const word& regionType,
139 const word& modelName,
140 bool readFields = true
141 );
142
143 //- Construct from mesh, region type and name and dict
145 (
146 const fvMesh& mesh,
147 const word& regionType,
148 const word& modelName,
149 const dictionary& dict,
150 bool readFields = true
151 );
152
153
154
155 //- Destructor
156 virtual ~regionModel1D();
157
158
159 // Member Functions
160
161 // Access
162
163 // Addressing
164
165 //- Return the global face IDs
166 inline const labelListList& boundaryFaceFaces() const;
167
168 //- Return the global cell IDs
169 inline const labelListList& boundaryFaceCells() const;
170
171 //- Return the global boundary face IDs oppositte coupled patch
172 inline const labelList& boundaryFaceOppositeFace() const;
173
174
175 // Geometry
176
177 //- Return the face area magnitudes / [m2]
178 inline const surfaceScalarField& nMagSf() const;
179
180 //- Return the number of layers in the region
181 inline label nLayers() const;
182};
183
184
185// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186
187} // End namespace regionModels
188} // End namespace Foam
189
190// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191
192#include "regionModel1DI.H"
193
194// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195
196#endif
197
198// ************************************************************************* //
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:78
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
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Base class for 1-D region models.
Definition: regionModel1D.H:57
TypeName("regionModel1D")
Runtime type information.
tmp< labelField > moveMesh(const scalarList &deltaV, const scalar minDelta=0.0)
Move mesh points according to change in cell volumes.
const surfaceScalarField & nMagSf() const
Return the face area magnitudes / [m2].
labelListList boundaryFaceFaces_
Global face IDs.
Definition: regionModel1D.H:80
labelList boundaryFaceOppositeFace_
Global boundary face IDs oppositte coupled patch.
Definition: regionModel1D.H:86
autoPtr< surfaceScalarField > nMagSfPtr_
Face area magnitude normal to patch.
Definition: regionModel1D.H:95
virtual ~regionModel1D()
Destructor.
Switch moveMesh_
Flag to allow mesh movement.
Definition: regionModel1D.H:98
const labelListList & boundaryFaceCells() const
Return the global cell IDs.
label nLayers() const
Return the number of layers in the region.
const labelListList & boundaryFaceFaces() const
Return the global face IDs.
const labelList & boundaryFaceOppositeFace() const
Return the global boundary face IDs oppositte coupled patch.
label nLayers_
Number of layers in the region.
Definition: regionModel1D.H:89
labelListList boundaryFaceCells_
Global cell IDs.
Definition: regionModel1D.H:83
virtual bool read()
Read control parameters from dictionary.
Base class for region models.
Definition: regionModel.H:63
const word & modelName() const
Return the model name.
Definition: regionModelI.H:58
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
dynamicFvMesh & mesh
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
Foam::surfaceFields.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73