Loading...
Searching...
No Matches
PDRarrays.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) 2016 Shell Research Ltd.
9 Copyright (C) 2019 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::PDRarrays
29
30Description
31 Work array definitions for PDR fields
32
33SourceFiles
34 PDRarrays.C
35 PDRarraysCalc.C
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef PDRarrays_H
40#define PDRarrays_H
41
42#include "symmTensor.H"
43#include "symmTensor2D.H"
44#include "SquareMatrix.H"
45#include "IjkField.H"
46#include <functional>
47
48// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49
50namespace Foam
51{
52
53// Forward Declarations
54class PDRblock;
55class PDRmeshArrays;
56class PDRobstacle;
57class PDRpatchDef;
58
60/*---------------------------------------------------------------------------*\
61 Class PDRarrays Declaration
62\*---------------------------------------------------------------------------*/
63
64class PDRarrays
65{
66 //- Reference to PDRblock
67 std::reference_wrapper<const PDRblock> pdrBlock_;
68
69public:
70
71 // Data Members
72 // Entries used for analysis and when writing fields
73
74 //- Volume blockage
76
77 //- Surface area in cell
80 //- Obstacle size in cell
82
83 //- Summed area blockage (directional) from sharp obstacles
85
86 //- Summed area blockage (directional) from round obstacles
88
89 //- A total directional blockage in the cell
91
92 //- Face area blockage for face,
93 //- summed from cell centre-plane to cell centre-plane
95
96 //- Longitudinal area blockage from obstacles that extend all the way
97 //- through the cell in a given direction.
101
102 //- Number of obstacles in cell.
103 // Can be non-integer if an obstacle does not pass all way through cell
106 //- Number of obstacles parallel to specified direction
108
109 //- Addition to count to account for grating comprises many bars
110 //- (to get Lobs right)
112
113 //- Tensorial drag from sharp obstacles
115
116 //- Directional drag from round obstacles
118
119
120 // Next arrays are for 2D calculations of intersection
121
122 // One-dimensional scratch areas for cell overlaps
124
125 // In two dimensions, area of cell covered by circle
127
128 // In two dimensions, length of perimeter of circle witthin cell
130
131 // For offset cells, i.e. face blockage
133
134 // For centred cells
137 // The count in the cells
139
140 //- Cell-centred drag
142
143 //- Face field for (directional) for patch Id
145
146 //- Face field for (directional) hole in face
148
149
150 // Constructors
151
152 //- Construct null
154
155 //- Construct and reset
156 explicit PDRarrays(const PDRblock& pdrBlock);
157
158
159 //- Destructor
160 ~PDRarrays() = default;
161
163 // Member Functions
164
165 //- Reset PDRblock reference, resize and zero arrays
166 void reset(const PDRblock& pdrBlock);
168 //- Reference to PDRblock
169 const PDRblock& block() const
170 {
171 return pdrBlock_.get();
173
174 //- Summary of the blockages
175 // For diagnostics and general overview
176 void blockageSummary() const;
178 //- Add cylinder blockage
179 void addCylinder(const PDRobstacle& obs);
180
181 //- Add general (non-cylinder) blockage
182 void addBlockage
183 (
184 const PDRobstacle& obs,
186 const int volumeSign
187 );
188
189
191 (
192 PDRarrays& arr,
193 const PDRmeshArrays& meshIndexing,
194 const fileName& casepath,
196 );
197
199 (
200 const fileName& casepath,
201 const PDRmeshArrays& meshIndexing,
203 );
205
206
207// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208
209} // End namespace Foam
210
211// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212
213#endif
214
215// ************************************************************************* //
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition DynamicList.H:68
Generic templated field type with i-j-k addressing.
Definition IjkField.H:52
void calculateAndWrite(const fileName &casepath, const PDRmeshArrays &meshIndexing, const UList< PDRpatchDef > &patches)
void blockageSummary() const
Summary of the blockages.
IjkField< vector > drag_r
Directional drag from round obstacles.
Definition PDRarrays.H:141
IjkField< vector > betai_inv1
Definition PDRarrays.H:113
IjkField< vector > along_block
Longitudinal area blockage from obstacles that extend all the way through the cell in a given directi...
Definition PDRarrays.H:111
IjkField< scalar > v_block
Volume blockage.
Definition PDRarrays.H:74
SquareMatrix< scalar > ac_lblock
Definition PDRarrays.H:159
void addBlockage(const PDRobstacle &obs, DynamicList< PDRpatchDef > &patches, const int volumeSign)
Add general (non-cylinder) blockage.
IjkField< vector > area_block_r
Summed area blockage (directional) from round obstacles.
Definition PDRarrays.H:94
Vector< List< scalar > > overlap_1d
Definition PDRarrays.H:147
SquareMatrix< scalar > b_lblock
Definition PDRarrays.H:156
IjkField< vector > sub_count
Number of obstacles parallel to specified direction.
Definition PDRarrays.H:125
IjkField< Vector< bool > > hole_in_face
Face field for (directional) hole in face.
Definition PDRarrays.H:177
SquareMatrix< symmTensor2D > c_drag
Cell-centred drag.
Definition PDRarrays.H:167
~PDRarrays()=default
Destructor.
static void calculateAndWrite(PDRarrays &arr, const PDRmeshArrays &meshIndexing, const fileName &casepath, const UList< PDRpatchDef > &patches)
IjkField< vector > area_block_s
Summed area blockage (directional) from sharp obstacles.
Definition PDRarrays.H:89
SquareMatrix< scalar > abperim
Definition PDRarrays.H:153
SquareMatrix< scalar > bc_lblock
Definition PDRarrays.H:159
void addCylinder(const PDRobstacle &obs)
Add cylinder blockage.
const PDRblock & block() const
Reference to PDRblock.
Definition PDRarrays.H:209
IjkField< scalar > obs_size
Obstacle size in cell.
Definition PDRarrays.H:84
SquareMatrix< scalar > aboverlap
Definition PDRarrays.H:150
IjkField< Vector< bool > > dirn_block
A total directional blockage in the cell.
Definition PDRarrays.H:99
IjkField< scalar > obs_count
Number of obstacles in cell.
Definition PDRarrays.H:120
IjkField< vector > grating_count
Addition to count to account for grating comprises many bars (to get Lobs right).
Definition PDRarrays.H:131
IjkField< symmTensor > drag_s
Tensorial drag from sharp obstacles.
Definition PDRarrays.H:136
PDRarrays()
Construct null.
IjkField< vector > face_block
Face area blockage for face, summed from cell centre-plane to cell centre-plane.
Definition PDRarrays.H:105
void reset(const PDRblock &pdrBlock)
Reset PDRblock reference, resize and zero arrays.
IjkField< labelVector > face_patch
Face field for (directional) for patch Id.
Definition PDRarrays.H:172
SquareMatrix< scalar > a_lblock
Definition PDRarrays.H:156
IjkField< scalar > surf
Surface area in cell.
Definition PDRarrays.H:79
SquareMatrix< scalar > c_count
Definition PDRarrays.H:162
PDRarrays(const PDRblock &pdrBlock)
Construct and reset.
A single block x-y-z rectilinear mesh addressable as i,j,k with simplified creation....
Definition PDRblock.H:152
OpenFOAM/PDRblock addressing information.
Obstacle definitions for PDR.
Definition PDRobstacle.H:71
Bookkeeping for patch definitions.
Definition PDRpatchDef.H:50
A templated (N x N) square matrix of objects of <Type>, containing N*N elements, derived from Matrix.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition UList.H:89
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
Definition Vector.H:61
A class for handling file names.
Definition fileName.H:75
const polyBoundaryMesh & patches
Namespace for OpenFOAM.