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 | Copyright (C) 2011-2013 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::regionModel1D
26 
27 Description
28  Base class for 1-D region models
29 
30 SourceFiles
31  regionModel1D.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef regionModel1D_H
36 #define regionModel1D_H
37 
38 #include "regionModel.H"
39 #include "surfaceFields.H"
40 #include "labelList.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 namespace regionModels
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class regionModel1D Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class regionModel1D
54 :
55  public regionModel
56 {
57 
58 private:
59 
60  // Private Member Functions
61 
62  //- Disallow default bitwise copy construct
64 
65  //- Disallow default bitwise assignment
66  void operator=(const regionModel1D&);
67 
68  //- Construct region mesh and fields
69  void constructMeshObjects();
70 
71  //- Initialise the region
72  void initialise();
73 
74 
75 protected:
76 
77  // Protected data
78 
79  // Region addressing - per internally coupled patch face walking out
80 
81  //- Global face IDs
83 
84  //- Global cell IDs
86 
87  //- Global boundary face IDs oppossite coupled patch
89 
90  //- Number of layers in the region
92 
93 
94  // Geometry
95 
96  //- Face area magnitude normal to patch
98 
99  //- Flag to allow mesh movement
101 
102 
103  // Protected member functions
104 
105  //- Read control parameters from dictionary
106  virtual bool read();
107 
108  //- Read control parameters from dictionary
109  virtual bool read(const dictionary& dict);
110 
111  //- Move mesh points according to change in cell volumes
112  // Returns map ordered by cell where 1 = cell moved, 0 = cell unchanged
114  (
115  const scalarList& deltaV,
116  const scalar minDelta = 0.0
117  );
118 
119 
120 public:
121 
122  //- Runtime type information
123  TypeName("regionModel1D");
124 
125 
126  // Constructors
127 
128  //- Construct null
130  (
131  const fvMesh& mesh,
132  const word& regionType
133  );
134 
135  //- Construct from mesh, region type and name
137  (
138  const fvMesh& mesh,
139  const word& regionType,
140  const word& modelName,
141  bool readFields = true
142  );
143 
144  //- Construct from mesh, region type and name and dict
146  (
147  const fvMesh& mesh,
148  const word& regionType,
149  const word& modelName,
150  const dictionary& dict,
151  bool readFields = true
152  );
153 
154 
155 
156  //- Destructor
157  virtual ~regionModel1D();
158 
159 
160  // Member Functions
161 
162  // Access
163 
164  // Addressing
165 
166  //- Return the global face IDs
167  inline const labelListList& boundaryFaceFaces() const;
168 
169  //- Return the global cell IDs
170  inline const labelListList& boundaryFaceCells() const;
171 
172  //- Return the global boundary face IDs oppossite coupled patch
173  inline const labelList& boundaryFaceOppositeFace() const;
174 
175 
176  // Geometry
177 
178  //- Return the face area magnitudes / [m2]
179  inline const surfaceScalarField& nMagSf() const;
180 
181  //- Return the number of layers in the region
182  inline label nLayers() const;
183 };
184 
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 } // End namespace regionModels
189 } // End namespace Foam
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 #include "regionModel1DI.H"
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 #endif
198 
199 // ************************************************************************* //
Foam::surfaceFields.
dictionary dict
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
const labelListList & boundaryFaceCells() const
Return the global cell IDs.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
const labelList & boundaryFaceOppositeFace() const
Return the global boundary face IDs oppossite coupled patch.
tmp< labelField > moveMesh(const scalarList &deltaV, const scalar minDelta=0.0)
Move mesh points according to change in cell volumes.
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none.
Definition: Switch.H:60
const labelListList & boundaryFaceFaces() const
Return the global face IDs.
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const HashSet< word > &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the specified type.
Definition: ReadFields.C:244
label nLayers() const
Return the number of layers in the region.
Switch moveMesh_
Flag to allow mesh movement.
Definition: regionModel1D.H:99
dynamicFvMesh & mesh
virtual ~regionModel1D()
Destructor.
A class for handling words, derived from string.
Definition: word.H:59
autoPtr< surfaceScalarField > nMagSfPtr_
Face area magnitude normal to patch.
Definition: regionModel1D.H:96
labelListList boundaryFaceCells_
Global cell IDs.
Definition: regionModel1D.H:84
const word & modelName() const
Return the model name.
Definition: regionModelI.H:55
labelListList boundaryFaceFaces_
Global face IDs.
Definition: regionModel1D.H:81
const surfaceScalarField & nMagSf() const
Return the face area magnitudes / [m2].
TypeName("regionModel1D")
Runtime type information.
virtual bool read()
Read control parameters from dictionary.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
label nLayers_
Number of layers in the region.
Definition: regionModel1D.H:90
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:53
A class for managing temporary objects.
Definition: PtrList.H:54
Namespace for OpenFOAM.
labelList boundaryFaceOppositeFace_
Global boundary face IDs oppossite coupled patch.
Definition: regionModel1D.H:87