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 
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 
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::regionModels::regionModel1D::TypeName
TypeName("regionModel1D")
Runtime type information.
Foam::regionModels::regionModel1D::read
virtual bool read()
Read control parameters from dictionary.
Definition: regionModel1D.C:170
Foam::regionModels::regionModel1D::boundaryFaceOppositeFace_
labelList boundaryFaceOppositeFace_
Global boundary face IDs oppositte coupled patch.
Definition: regionModel1D.H:86
Foam::Switch
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:77
Foam::regionModels::regionModel1D::nMagSfPtr_
autoPtr< surfaceScalarField > nMagSfPtr_
Face area magnitude normal to patch.
Definition: regionModel1D.H:95
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
regionModel1DI.H
Foam::regionModels::regionModel1D::boundaryFaceOppositeFace
const labelList & boundaryFaceOppositeFace() const
Return the global boundary face IDs oppositte coupled patch.
Definition: regionModel1DI.H:48
surfaceFields.H
Foam::surfaceFields.
regionModel.H
Foam::regionModels::regionModel1D::nLayers
label nLayers() const
Return the number of layers in the region.
Definition: regionModel1DI.H:67
Foam::regionModels::regionModel1D::boundaryFaceFaces_
labelListList boundaryFaceFaces_
Global face IDs.
Definition: regionModel1D.H:80
Foam::regionModels::regionModel::modelName
const word & modelName() const
Return the model name.
Definition: regionModelI.H:58
Foam::regionModels::regionModel1D::boundaryFaceCells
const labelListList & boundaryFaceCells() const
Return the global cell IDs.
Definition: regionModel1DI.H:41
Foam::regionModels::regionModel
Base class for region models.
Definition: regionModel.H:60
Foam::regionModels::regionModel1D::boundaryFaceCells_
labelListList boundaryFaceCells_
Global cell IDs.
Definition: regionModel1D.H:83
Foam::regionModels::regionModel1D::~regionModel1D
virtual ~regionModel1D()
Destructor.
Definition: regionModel1D.C:378
labelList.H
Foam::regionModels::regionModel1D::moveMesh
tmp< labelField > moveMesh(const scalarList &deltaV, const scalar minDelta=0.0)
Move mesh points according to change in cell volumes.
Definition: regionModel1D.C:195
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::regionModels::regionModel1D::nMagSf
const surfaceScalarField & nMagSf() const
Return the face area magnitudes / [m2].
Definition: regionModel1DI.H:55
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::regionModels::regionModel1D::boundaryFaceFaces
const labelListList & boundaryFaceFaces() const
Return the global face IDs.
Definition: regionModel1DI.H:34
Foam::readFields
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type.
Definition: ReadFieldsTemplates.C:312
Foam::regionModels::regionModel1D::nLayers_
label nLayers_
Number of layers in the region.
Definition: regionModel1D.H:89
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::List< labelList >
Foam::regionModels::regionModel1D::moveMesh_
Switch moveMesh_
Flag to allow mesh movement.
Definition: regionModel1D.H:98
Foam::regionModels::regionModel1D
Base class for 1-D region models.
Definition: regionModel1D.H:54
Foam::GeometricField< scalar, fvsPatchField, surfaceMesh >