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 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::regionModels::regionModel1D
28 
29 Description
30  Base class for 1-D region models
31 
32 SourceFiles
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 
46 namespace Foam
47 {
48 namespace regionModels
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class regionModel1D Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 class 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 
74 protected:
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 
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);
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 
119 public:
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 // ************************************************************************* //
Foam::surfaceFields.
dictionary dict
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
Base class for 1-D region models.
Definition: regionModel1D.H:50
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, any/none. Also accepts 0/1 as a string and shortcuts t/f, y/n.
Definition: Switch.H:77
const labelList & boundaryFaceOppositeFace() const
Return the global boundary face IDs oppositte coupled patch.
label nLayers() const
Return the number of layers in the region.
const word & modelName() const noexcept
Return the model name.
Definition: regionModel.H:259
const labelListList & boundaryFaceFaces() const
Return the global face IDs.
Switch moveMesh_
Flag to allow mesh movement.
dynamicFvMesh & mesh
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const NameMatchPredicate &selectedFields, DynamicList< regIOobject *> &storedObjects)
Read the selected GeometricFields of the templated type and store on the objectRegistry.
virtual ~regionModel1D()
Destructor.
A class for handling words, derived from Foam::string.
Definition: word.H:63
autoPtr< surfaceScalarField > nMagSfPtr_
Face area magnitude normal to patch.
labelListList boundaryFaceCells_
Global cell IDs.
Definition: regionModel1D.H:91
labelListList boundaryFaceFaces_
Global face IDs.
Definition: regionModel1D.H:86
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
Base class for region models.
Definition: regionModel.H:56
label nLayers_
Number of layers in the region.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
A class for managing temporary objects.
Definition: HashPtrTable.H:50
const labelListList & boundaryFaceCells() const
Return the global cell IDs.
Namespace for OpenFOAM.
labelList boundaryFaceOppositeFace_
Global boundary face IDs oppositte coupled patch.
Definition: regionModel1D.H:96