regionModel1D.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::regionModels::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  // Private Member Functions
58 
59  //- Disallow default bitwise copy construction
60  regionModel1D(const regionModel1D&) = delete;
61 
62  //- Disallow default bitwise assignment
63  void operator=(const regionModel1D&) = delete;
64 
65  //- Construct region mesh and fields
66  void constructMeshObjects();
67 
68  //- Initialise the region
69  void initialise();
70 
71 
72 protected:
73 
74  // Protected data
75 
76  // Region addressing - per internally coupled patch face walking out
77 
78  //- Global face IDs
80 
81  //- Global cell IDs
83 
84  //- Global boundary face IDs opposite coupled patch
86 
87  //- Number of layers in the region
89 
90 
91  // Geometry
92 
93  //- Face area magnitude normal to patch
95 
96  //- Flag to allow mesh movement
98 
99 
100  // Protected member functions
101 
102  //- Read control parameters from dictionary
103  virtual bool read();
104 
105  //- Read control parameters from dictionary
106  virtual bool read(const dictionary& dict);
107 
108  //- Move mesh points according to change in cell volumes
109  // Returns map ordered by cell where 1 = cell moved, 0 = cell unchanged
111  (
112  const scalarList& deltaV,
113  const scalar minDelta = 0.0
114  );
115 
116 
117 public:
118 
119  //- Runtime type information
120  TypeName("regionModel1D");
121 
122 
123  // Constructors
124 
125  //- Construct null
127  (
128  const fvMesh& mesh,
129  const word& regionType
130  );
131 
132  //- Construct from mesh, region type and name
134  (
135  const fvMesh& mesh,
136  const word& regionType,
137  const word& modelName,
138  bool readFields = true
139  );
140 
141  //- Construct from mesh, region type and name and dict
143  (
144  const fvMesh& mesh,
145  const word& regionType,
146  const word& modelName,
147  const dictionary& dict,
148  bool readFields = true
149  );
150 
151 
152 
153  //- Destructor
154  virtual ~regionModel1D();
155 
156 
157  // Member Functions
158 
159  // Access
160 
161  // Addressing
162 
163  //- Return the global face IDs
164  inline const labelListList& boundaryFaceFaces() const;
165 
166  //- Return the global cell IDs
167  inline const labelListList& boundaryFaceCells() const;
168 
169  //- Return the global boundary face IDs opposite coupled patch
170  inline const labelList& boundaryFaceOppositeFace() const;
171 
172 
173  // Geometry
174 
175  //- Return the face area magnitudes / [m^2]
176  inline const surfaceScalarField& nMagSf() const;
177 
178  //- Return the number of layers in the region
179  inline label nLayers() const;
180 };
181 
182 
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 
185 } // End namespace regionModels
186 } // End namespace Foam
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 #include "regionModel1DI.H"
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 #endif
195 
196 // ************************************************************************* //
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
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
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
Base class for 1-D region models.
Definition: regionModel1D.H:52
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/any.
Definition: Switch.H:60
const labelList & boundaryFaceOppositeFace() const
Return the global boundary face IDs opposite coupled patch.
label nLayers() const
Return the number of layers in the region.
const word & modelName() const
Return the model name.
Definition: regionModelI.H:49
const labelListList & boundaryFaceFaces() const
Return the global face IDs.
Switch moveMesh_
Flag to allow mesh movement.
Definition: regionModel1D.H:96
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:93
labelListList boundaryFaceCells_
Global cell IDs.
Definition: regionModel1D.H:81
labelListList boundaryFaceFaces_
Global face IDs.
Definition: regionModel1D.H:78
const surfaceScalarField & nMagSf() const
Return the face area magnitudes / [m^2].
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:55
label nLayers_
Number of layers in the region.
Definition: regionModel1D.H:87
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
A class for managing temporary objects.
Definition: PtrList.H:53
const labelListList & boundaryFaceCells() const
Return the global cell IDs.
Namespace for OpenFOAM.
labelList boundaryFaceOppositeFace_
Global boundary face IDs opposite coupled patch.
Definition: regionModel1D.H:84