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 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::radiation::viewFactor
29 
30 Group
31  grpRadiationModels
32 
33 Description
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 
46 SourceFiles
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64 
65 namespace Foam
66 {
67 namespace radiation
68 {
69 
70 /*---------------------------------------------------------------------------*\
71  Class viewFactor Declaration
72 \*---------------------------------------------------------------------------*/
73 
74 class viewFactor
75 :
76  public radiationModel
77 {
78 private:
79 
80  // Private Member Functions
81 
82  //- No copy construct
83  viewFactor(const viewFactor&) = delete;
84 
85  //- No copy assignment
86  void operator=(const viewFactor&) = delete;
87 
88 
89 protected:
90 
91  // Static data
92 
93  //- Static name for view factor walls
94  static const word viewFactorWalls;
95 
96 
97  // Private data
98 
99  //- Agglomeration List
101 
102  //- Map distributed
104 
105  //- Coarse mesh
107 
108  //- Net radiative heat flux [W/m2]
110 
111  //- View factor matrix
113 
114  //- Inverse of C matrix
116 
117  //- Selected patches
119 
120  //- Total global coarse faces
121  label totalNCoarseFaces_;
122 
123  //- Total local coarse faces
124  label nLocalCoarseFaces_;
125 
126  //- Constant emissivity
127  bool constEmissivity_;
128 
129  //- Iterations Counter
130  label iterCounter_;
131 
132  //- Pivot Indices for LU decomposition
134 
135  //- Use Solar Load model
136  bool useSolarLoad_;
137 
138  //- Solar load radiation model
140 
141  //-Number of bands
142  label nBands_;
143 
144 
145  // Private Member Functions
146 
147  //- Initialise
148  void initialise();
149 
150  //- Insert view factors into main matrix
152  (
153  const globalIndex& index,
154  const label fromProci,
155  const labelListList& globalFaceFaces,
156  const scalarListList& viewFactors,
157  scalarSquareMatrix& matrix
158  );
159 
160 
161 public:
162 
163  //- Runtime type information
164  TypeName("viewFactor");
165 
166 
167  // Constructors
168 
169  //- Construct from components
170  viewFactor(const volScalarField& T);
171 
172  //- Construct from components
173  viewFactor(const dictionary& dict, const volScalarField& T);
174 
175 
176  //- Destructor
177  virtual ~viewFactor() = default;
178 
179 
180  // Member functions
181 
182  // Edit
183 
184  //- Solve system of equation(s)
185  void calculate();
186 
187  //- Read radiation properties dictionary
188  bool read();
189 
190  //- Source term component (for power of T^4)
191  virtual tmp<volScalarField> Rp() const;
192 
193  //- Source term component (constant)
194  virtual tmp<volScalarField::Internal> Ru() const;
195 
196 
197  // Access
198 
199  //- Const access to total radiative heat flux field
200  inline const volScalarField& qr() const;
201 
202  //- Use useSolarLoad
203  inline bool useSolarLoad() const;
204 
205  //- Number of bands
206  virtual label nBands() const;
207 };
208 
209 
210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211 
212 #include "viewFactorI.H"
213 
214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215 
216 } // End namespace radiation
217 } // End namespace Foam
218 
219 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220 
221 #endif
222 
223 // ************************************************************************* //
volFields.H
solarLoad.H
Foam::radiation::viewFactor::CLU_
autoPtr< scalarSquareMatrix > CLU_
Inverse of C matrix.
Definition: viewFactor.H:114
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::radiation::viewFactor::TypeName
TypeName("viewFactor")
Runtime type information.
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::radiation::viewFactor::useSolarLoad_
bool useSolarLoad_
Use Solar Load model.
Definition: viewFactor.H:135
globalIndex.H
Foam::radiation::viewFactor::Rp
virtual tmp< volScalarField > Rp() const
Source term component (for power of T^4)
Definition: viewFactor.C:665
Foam::radiation::viewFactor::nBands
virtual label nBands() const
Number of bands.
Definition: viewFactorI.H:41
Foam::radiation::viewFactor::solarLoad_
autoPtr< solarLoad > solarLoad_
Solar load radiation model.
Definition: viewFactor.H:138
Foam::radiation::viewFactor::insertMatrixElements
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:343
Foam::radiation::viewFactor::initialise
void initialise()
Initialise.
Definition: viewFactor.C:55
viewFactorI.H
Foam::singleCellFvMesh
fvMesh as subset of other mesh. Consists of one cell and all original bounday faces....
Definition: singleCellFvMesh.H:56
Foam::radiation::viewFactor::~viewFactor
virtual ~viewFactor()=default
Destructor.
Foam::radiation::viewFactor::selectedPatches_
labelList selectedPatches_
Selected patches.
Definition: viewFactor.H:117
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:58
Foam::radiation::viewFactor::qr
const volScalarField & qr() const
Const access to total radiative heat flux field.
Definition: viewFactorI.H:29
Foam::radiation::viewFactor::qr_
volScalarField qr_
Net radiative heat flux [W/m2].
Definition: viewFactor.H:108
Foam::radiation::viewFactor
View factor radiation model. The system solved is: C q = b where: Cij = deltaij/Ej - (1/Ej - 1)Fij q ...
Definition: viewFactor.H:73
Foam::radiation::viewFactor::coarseMesh_
singleCellFvMesh coarseMesh_
Coarse mesh.
Definition: viewFactor.H:105
singleCellFvMesh.H
radiation
autoPtr< radiation::radiationModel > radiation(radiation::radiationModel::New(T))
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::radiation::viewFactor::calculate
void calculate()
Solve system of equation(s)
Definition: viewFactor.C:365
Foam::radiation::viewFactor::nLocalCoarseFaces_
label nLocalCoarseFaces_
Total local coarse faces.
Definition: viewFactor.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::globalIndex
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
Definition: globalIndex.H:68
Foam::radiation::viewFactor::pivotIndices_
labelList pivotIndices_
Pivot Indices for LU decomposition.
Definition: viewFactor.H:132
Foam::radiation::viewFactor::map_
autoPtr< IOmapDistribute > map_
Map distributed.
Definition: viewFactor.H:102
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::SquareMatrix< scalar >
IOmapDistribute.H
Foam::radiation::viewFactor::totalNCoarseFaces_
label totalNCoarseFaces_
Total global coarse faces.
Definition: viewFactor.H:120
Foam::radiation::viewFactor::iterCounter_
label iterCounter_
Iterations Counter.
Definition: viewFactor.H:129
scalarListIOList.H
Foam::List< label >
Foam::radiation::radiationModel
Top level model for radiation modelling.
Definition: radiationModel.H:75
Foam::radiation::viewFactor::Fmatrix_
autoPtr< scalarSquareMatrix > Fmatrix_
View factor matrix.
Definition: viewFactor.H:111
Foam::IOList< labelList >
Foam::radiation::viewFactor::viewFactorWalls
static const word viewFactorWalls
Static name for view factor walls.
Definition: viewFactor.H:93
scalarMatrices.H
Foam::radiation::viewFactor::Ru
virtual tmp< volScalarField::Internal > Ru() const
Source term component (constant)
Definition: viewFactor.C:688
Foam::radiation::viewFactor::read
bool read()
Read radiation properties dictionary.
Definition: viewFactor.C:331
Foam::radiation::viewFactor::constEmissivity_
bool constEmissivity_
Constant emissivity.
Definition: viewFactor.H:126
Foam::radiation::viewFactor::finalAgglom_
labelListIOList finalAgglom_
Agglomeration List.
Definition: viewFactor.H:99
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::radiation::viewFactor::useSolarLoad
bool useSolarLoad() const
Use useSolarLoad.
Definition: viewFactorI.H:35
radiationModel.H
Foam::radiation::viewFactor::nBands_
label nBands_
Number of bands.
Definition: viewFactor.H:141