viewFactor.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-2017 OpenFOAM Foundation
9 Copyright (C) 2018 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::radiation::viewFactor
29
30Group
31 grpRadiationModels
32
33Description
34 View factor radiation model. The system solved is: C q = b
35 where:
36 Cij = deltaij/Ej - (1/Ej - 1)Fij
37 q = heat flux
38 b = A eb - Ho
39 and:
40 eb = sigma*T^4
41 Ej = emissivity
42 Aij = deltaij - Fij
43 Fij = view factor matrix
44
45
46SourceFiles
47 viewFactor.C
48
49\*---------------------------------------------------------------------------*/
50
51#ifndef radiation_viewFactor_H
52#define radiation_viewFactor_H
53
54#include "radiationModel.H"
55#include "singleCellFvMesh.H"
56#include "scalarMatrices.H"
57#include "globalIndex.H"
58#include "scalarListIOList.H"
59#include "volFields.H"
60#include "IOmapDistribute.H"
61#include "solarLoad.H"
62
63#include "lduPrimitiveMesh.H"
65#include "lduMatrix.H"
66
67// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
68
69namespace Foam
70{
71namespace radiation
72{
73
74/*---------------------------------------------------------------------------*\
75 Class viewFactor Declaration
76\*---------------------------------------------------------------------------*/
78class viewFactor
79:
80 public radiationModel
81{
82private:
83
84 // Private Member Functions
85
86 //- No copy construct
87 viewFactor(const viewFactor&) = delete;
88
89 //- No copy assignment
90 void operator=(const viewFactor&) = delete;
91
92
93protected:
94
95 // Static data
96
97 //- Static name for view factor walls
98 static const word viewFactorWalls;
99
100
101 // Private data
102
103 //- Agglomeration List
105
106 //- Map distributed
108
109 //- Coarse mesh
111
112 //- Net radiative heat flux [W/m2]
114
115 //- Coarse radiative heat flux
117
118 //- View factor matrix
120
121 //- Inverse of C matrix
123
124 //- Visible global faces
126
127 //- Selected patches
129
130 //- Total global coarse faces
131 label totalNCoarseFaces_;
132
133 //- Total local coarse faces
134 label nLocalCoarseFaces_;
135
136 //- Constant emissivity
137 bool constEmissivity_;
138
139 //- Iterations Counter
140 label iterCounter_;
141
142 //- Pivot Indices for LU decomposition
144
145 //- Use Solar Load model
146 bool useSolarLoad_;
147
148 //- Solar load radiation model
150
151 //-Number of bands
152 label nBands_;
153
154 //- Primitive addressing for lduMatrix
156
157 //- Matrix formed from view factors
159
160 //- Boundary scalar field containing pseudo-matrix coeffs
161 //- for internal cells
163
164 //- Boundary scalar field containing pseudo-matrix coeffs
165 //- for boundary cells
167
168 //- Rays on local proc
170
171 //- Map local-ray to j-column for F
173
174 //- Local view factors
176
177 //- Map from proc to interafce
179
180 //- Use direct or iterative solver
181 bool useDirect_;
182
183
184 // Private Member Functions
185
186 //- Initialise
187 void initialise();
188
189 //- Insert view factors into main matrix
191 (
192 const globalIndex& index,
193 const label fromProci,
194 const labelListList& globalFaceFaces,
195 const scalarListList& viewFactors,
196 scalarSquareMatrix& matrix
197 );
198
199
200public:
201
202 //- Runtime type information
203 TypeName("viewFactor");
204
205
206 // Constructors
207
208 //- Construct from components
210
211 //- Construct from components
212 viewFactor(const dictionary& dict, const volScalarField& T);
213
214
215 //- Destructor
216 virtual ~viewFactor() = default;
217
218
219 // Member functions
220
221 // Edit
222
223 //- Solve system of equation(s)
224 void calculate();
225
226 //- Read radiation properties dictionary
227 bool read();
228
229 //- Source term component (for power of T^4)
230 virtual tmp<volScalarField> Rp() const;
231
232 //- Source term component (constant)
233 virtual tmp<volScalarField::Internal> Ru() const;
234
235
236 // Access
237
238 //- Const access to total radiative heat flux field
239 inline const volScalarField& qr() const;
240
241 //- Use useSolarLoad
242 inline bool useSolarLoad() const;
243
244 //- Number of bands
245 virtual label nBands() const;
246};
247
248
249// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
250
251#include "viewFactorI.H"
252
253// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
254
255} // End namespace radiation
256} // End namespace Foam
257
258// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
259
260#endif
261
262// ************************************************************************* //
A field of fields is a PtrList of fields with reference counting.
Definition: FieldField.H:80
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:77
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
Definition: globalIndex.H:68
Top level model for radiation modelling.
View factor radiation model. The system solved is: C q = b where: Cij = deltaij/Ej - (1/Ej - 1)Fij q ...
Definition: viewFactor.H:80
void initialise()
Initialise.
Definition: viewFactor.C:56
autoPtr< scalarSquareMatrix > Fmatrix_
View factor matrix.
Definition: viewFactor.H:118
autoPtr< lduMatrix > matrixPtr_
Matrix formed from view factors.
Definition: viewFactor.H:157
virtual tmp< volScalarField::Internal > Ru() const
Source term component (constant)
Definition: viewFactor.C:1133
singleCellFvMesh coarseMesh_
Coarse mesh.
Definition: viewFactor.H:109
TypeName("viewFactor")
Runtime type information.
bool useSolarLoad() const
Use useSolarLoad.
Definition: viewFactorI.H:35
autoPtr< scalarSquareMatrix > CLU_
Inverse of C matrix.
Definition: viewFactor.H:121
label nLocalCoarseFaces_
Total local coarse faces.
Definition: viewFactor.H:133
static const word viewFactorWalls
Static name for view factor walls.
Definition: viewFactor.H:97
label nBands_
Number of bands.
Definition: viewFactor.H:151
virtual tmp< volScalarField > Rp() const
Source term component (for power of T^4)
Definition: viewFactor.C:1110
autoPtr< solarLoad > solarLoad_
Solar load radiation model.
Definition: viewFactor.H:148
virtual label nBands() const
Number of bands.
Definition: viewFactorI.H:41
autoPtr< scalarListIOList > FmyProc_
Local view factors.
Definition: viewFactor.H:174
volScalarField qr_
Net radiative heat flux [W/m2].
Definition: viewFactor.H:112
autoPtr< IOmapDistribute > map_
Map distributed.
Definition: viewFactor.H:106
FieldField< Field, scalar > boundaryCoeffs_
Definition: viewFactor.H:165
labelList procToInterface_
Map from proc to interafce.
Definition: viewFactor.H:177
const volScalarField & qr() const
Const access to total radiative heat flux field.
Definition: viewFactorI.H:29
List< label > mapRayToFmy_
Map local-ray to j-column for F.
Definition: viewFactor.H:171
FieldField< Field, scalar > internalCoeffs_
Definition: viewFactor.H:161
labelList pivotIndices_
Pivot Indices for LU decomposition.
Definition: viewFactor.H:142
bool useDirect_
Use direct or iterative solver.
Definition: viewFactor.H:180
autoPtr< labelListIOList > globalFaceFaces_
Visible global faces.
Definition: viewFactor.H:124
labelListIOList finalAgglom_
Agglomeration List.
Definition: viewFactor.H:103
List< scalarField > qrBandI_
Coarse radiative heat flux.
Definition: viewFactor.H:115
label totalNCoarseFaces_
Total global coarse faces.
Definition: viewFactor.H:130
edgeHashSet rays_
Rays on local proc.
Definition: viewFactor.H:168
bool constEmissivity_
Constant emissivity.
Definition: viewFactor.H:136
autoPtr< lduPrimitiveMesh > lduPtr_
Primitive addressing for lduMatrix.
Definition: viewFactor.H:154
labelList selectedPatches_
Selected patches.
Definition: viewFactor.H:127
bool useSolarLoad_
Use Solar Load model.
Definition: viewFactor.H:145
void insertMatrixElements(const globalIndex &index, const label fromProci, const labelListList &globalFaceFaces, const scalarListList &viewFactors, scalarSquareMatrix &matrix)
Insert view factors into main matrix.
Definition: viewFactor.C:639
label iterCounter_
Iterations Counter.
Definition: viewFactor.H:139
bool read()
Read radiation properties dictionary.
Definition: viewFactor.C:627
virtual ~viewFactor()=default
Destructor.
void calculate()
Solve system of equation(s)
Definition: viewFactor.C:661
fvMesh as subset of other mesh. Consists of one cell and all original bounday faces....
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
const volScalarField & T
autoPtr< radiation::radiationModel > radiation(radiation::radiationModel::New(T))
Namespace for OpenFOAM.
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73