BUG: UListIO: byteSize overflowing on really big faceLists
[OpenFOAM-2.0.x.git] / src / thermophysicalModels / radiationModels / submodels / absorptionEmissionModel / wideBandAbsorptionEmission / wideBandAbsorptionEmission.H
blobae32678cc7ce8b663b94cdf86329e716bbf433c6
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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.
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.
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/>.
24 Class
25     Foam::radiation::wideBandAbsorptionEmission
27 Description
29     wideBandAbsorptionEmission radiation absorption and emission coefficients
30     for continuous phase.
32     All the bands should have the same number of species and have to be entered
33     in the same order.
35     There is no check of continuity of the bands. They should not ovelap or
36     have gaps.
38     The emission constant proportionality is specified per band (EhrrCoeff).
40     The coefficients for the species in the lookup table have to be specified
41     for use in moles x P [atm].i.e. (k[i] = species[i]*p*9.869231e-6).
43     The coefficients for CO and soot or any other added are multiplied by the
44     respective mass fraction being solved.
46     The look Up table file should be in the constant directory.
48     band dictionary:
49     \verbatim
50         band0
51         {
52             bandLimits (1.0e-6 2.63e-6);
53             EhrrCoeff       0.0;
54             species
55             {
56                 CH4
57                 {
58                     Tcommon         300.;
59                     Tlow            300.;
60                     Thigh           2500.;
61                     invTemp         false;
62                     loTcoeffs (0 0 0 0 0 0) ;
63                     hiTcoeffs (.1 0 0 0 0 0);
64                 }
65                 CO2
66                 {
67                     Tcommon         300.;
68                     Tlow            300.;
69                     Thigh           2500.;
70                     invTemp         false;
71                     loTcoeffs (0 0 0 0 0 0) ;
72                     hiTcoeffs (.1 0 0 0 0 0);
73                 }
74                 H2O
75                 {
76                     Tcommon         300.;
77                     Tlow            300.;
78                     Thigh           2500.;
79                     invTemp         false;
80                     loTcoeffs (0 0 0 0 0 0) ;
81                     hiTcoeffs (.1 0 0 0 0 0);
82                 }
83                 Ysoot
84                 {
85                     Tcommon         300.;
86                     Tlow            300.;
87                     Thigh           2500.;
88                     invTemp         false;
89                     loTcoeffs (0 0 0 0 0 0) ;
90                     hiTcoeffs (.1 0 0 0 0 0);
91                 }
92             }
93         }
94     \endverbatim
97 SourceFiles
98     wideBandAbsorptionEmission.C
100 \*---------------------------------------------------------------------------*/
102 #ifndef wideBandAbsorptionEmission_H
103 #define wideBandAbsorptionEmission_H
105 #include "interpolationLookUpTable.H"
106 #include "absorptionEmissionModel.H"
107 #include "HashTable.H"
108 #include "absorptionCoeffs.H"
109 #include "basicThermo.H"
111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113 namespace Foam
115 namespace radiation
118 /*---------------------------------------------------------------------------*\
119                   Class wideBandAbsorptionEmission Declaration
120 \*---------------------------------------------------------------------------*/
122 class wideBandAbsorptionEmission
124     public absorptionEmissionModel
126 public:
128     // Public data
130         //- Maximum number of species considered for absorptivity
131         static const int nSpecies_ = 5;
133         //- Maximum number of bands
134         static const int maxBands_ = 10;
136         //-  Absorption coefficients
137         FixedList<FixedList<absorptionCoeffs, nSpecies_>, maxBands_> coeffs_;
140 private:
142     // Private data
144         //- Absorption model dictionary
145         dictionary coeffsDict_;
147         //- Hash table with species names
148         HashTable<label> speciesNames_;
150         //- Indices of species in the look-up table
151         FixedList<label, nSpecies_> specieIndex_;
153         //- Bands
154         FixedList<Vector2D<scalar>, maxBands_> iBands_;
156         //- Proportion of the heat released rate emitted
157         FixedList<scalar, maxBands_> iEhrrCoeffs_;
159         //- Lookup table of species related to ft
160         mutable interpolationLookUpTable<scalar> lookUpTable_;
162         //- Thermo package
163         const basicThermo& thermo_;
165         //- Bands
166         label nBands_;
168         //- Pointer list of species being solved involved in the absorption
169         UPtrList<volScalarField> Yj_;
171         // Total wave length covered by the bands
172         scalar totalWaveLength_;
175 public:
177     //- Runtime type information
178     TypeName("wideBandAbsorptionEmission");
181     // Constructors
183         //- Construct from components
184         wideBandAbsorptionEmission
185         (
186             const dictionary& dict,
187             const fvMesh& mesh
188         );
191     //- Destructor
192     virtual ~wideBandAbsorptionEmission();
195     // Member Functions
197         // Access
199             // Absorption coefficient
201                 //- Absorption coefficient for continuous phase
202                 tmp<volScalarField> aCont(const label bandI = 0) const;
205             // Emission coefficient
207                 //- Emission coefficient for continuous phase
208                 tmp<volScalarField> eCont(const label bandI = 0) const;
211             // Emission contribution
213                 //- Emission contribution for continuous phase
214                 tmp<volScalarField> ECont(const label bandI = 0) const;
217         inline bool isGrey() const
218         {
219             return false;
220         }
222         //- Number of bands
223         inline label nBands() const
224         {
225             return nBands_;
226         }
228         //- Lower and upper limit of band i
229         inline const Vector2D<scalar>& bands(const label i) const
230         {
231             return iBands_[i];
232         }
234         //- Add contribution of ILambda to the total radiative intensity in
235         //  direction i
236         tmp<volScalarField> addIntensity
237         (
238             const label i,
239             const volScalarField& ILambda
240         ) const;
242         void correct
243         (
244             volScalarField& a_,
245             PtrList<volScalarField>& aLambda
246         ) const;
250 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
252 } // End namespace radiation
253 } // End namespace Foam
255 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
257 #endif
259 // ************************************************************************* //