OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

blackBodyEmission.C

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 2008-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 \*---------------------------------------------------------------------------*/
00026 
00027 #include "blackBodyEmission.H"
00028 #include "dimensionedConstants.H"
00029 
00030 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
00031 
00032 const Foam::List<Foam::Tuple2<Foam::scalar, Foam::scalar> >
00033 Foam::radiation::blackBodyEmission::emissivePowerTable
00034 (
00035     IStringStream
00036     (
00037         "("
00038         "( 1000 0.00032)"
00039         "( 1100 0.00091)"
00040         "( 1200 0.00213)"
00041         "( 1300 0.00432)"
00042         "( 1400 0.00779)"
00043         "( 1500 0.01280)"
00044         "( 1600 0.01972)"
00045         "( 1700 0.02853)"
00046         "( 1800 0.03934)"
00047         "( 1900 0.05210)"
00048         "( 2000 0.06672)"
00049         "( 2100 0.08305)"
00050         "( 2200 0.10088)"
00051         "( 2300 0.12002)"
00052         "( 2400 0.14025)"
00053         "( 2500 0.16135)"
00054         "( 2600 0.18311)"
00055         "( 2700 0.20535)"
00056         "( 2800 0.22788)"
00057         "( 2900 0.25055)"
00058         "( 3000 0.27322)"
00059         "( 3100 0.29576)"
00060         "( 3200 0.31809)"
00061         "( 3300 0.34009)"
00062         "( 3400 0.36172)"
00063         "( 3500 0.38290)"
00064         "( 3600 0.40359)"
00065         "( 3700 0.42375)"
00066         "( 3800 0.44336)"
00067         "( 3900 0.46240)"
00068         "( 4000 0.48085)"
00069         "( 4100 0.49872)"
00070         "( 4200 0.51599)"
00071         "( 4300 0.53267)"
00072         "( 4400 0.54877)"
00073         "( 4500 0.56429)"
00074         "( 4600 0.57925)"
00075         "( 4700 0.59366)"
00076         "( 4800 0.60753)"
00077         "( 4900 0.62088)"
00078         "( 5000 0.63372)"
00079         "( 5100 0.64606)"
00080         "( 5200 0.65794)"
00081         "( 5300 0.66935)"
00082         "( 5400 0.68033)"
00083         "( 5500 0.69087)"
00084         "( 5600 0.70101)"
00085         "( 5700 0.71076)"
00086         "( 5800 0.72012)"
00087         "( 5900 0.72913)"
00088         "( 6000 0.73778)"
00089         "( 6100 0.74610)"
00090         "( 6200 0.75410)"
00091         "( 6300 0.76180)"
00092         "( 6400 0.76920)"
00093         "( 6500 0.77631)"
00094         "( 6600 0.78316)"
00095         "( 6700 0.78975)"
00096         "( 6800 0.79609)"
00097         "( 6900 0.80219)"
00098         "( 7000 0.80807)"
00099         "( 7100 0.81373)"
00100         "( 7200 0.81918)"
00101         "( 7300 0.82443)"
00102         "( 7400 0.82949)"
00103         "( 7500 0.83436)"
00104         "( 7600 0.83906)"
00105         "( 7700 0.84359)"
00106         "( 7800 0.84796)"
00107         "( 7900 0.85218)"
00108         "( 8000 0.85625)"
00109         "( 8100 0.86017)"
00110         "( 8200 0.86396)"
00111         "( 8300 0.86762)"
00112         "( 8400 0.87115)"
00113         "( 8500 0.87456)"
00114         "( 8600 0.87786)"
00115         "( 8700 0.88105)"
00116         "( 8800 0.88413)"
00117         "( 8900 0.88711)"
00118         "( 9000 0.88999)"
00119         "( 9100 0.89277)"
00120         "( 9200 0.89547)"
00121         "( 9300 0.89807)"
00122         "( 9400 0.90060)"
00123         "( 9500 0.90304)"
00124         "( 9600 0.90541)"
00125         "( 9700 0.90770)"
00126         "( 9800 0.90992)"
00127         "( 9900 0.91207)"
00128         "(10000 0.91415)"
00129         "(12000 0.94505)"
00130         "(15000 0.96893)"
00131         "(20000 0.98555)"
00132         "(30000 0.99529)"
00133         "(40000 0.99792)"
00134         "(50000 0.99890)"
00135         ")"
00136     )()
00137 );
00138 
00139 
00140 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00141 
00142 Foam::radiation::blackBodyEmission::blackBodyEmission
00143 (
00144     const label nLambda,
00145     const volScalarField& T
00146 )
00147 :
00148     table_
00149     (
00150         emissivePowerTable,
00151         interpolationTable<scalar>::CLAMP,
00152         "blackBodyEmissivePower"
00153     ),
00154     C1_("C1", dimensionSet(1, 4, 3, 0, 0, 0, 0), 3.7419e-16),
00155     C2_("C2", dimensionSet(0, 1, 0, 1, 0, 0, 0), 14.388e-6),
00156     bLambda_(nLambda),
00157     T_(T)
00158 {
00159     forAll(bLambda_, lambdaI)
00160     {
00161         bLambda_.set
00162         (
00163             lambdaI,
00164             new volScalarField
00165             (
00166                 IOobject
00167                 (
00168                     "bLambda_" + Foam::name(lambdaI) ,
00169                     T.mesh().time().timeName(),
00170                     T.mesh(),
00171                     IOobject::NO_READ,
00172                     IOobject::NO_WRITE
00173                 ),
00174                 radiation::sigmaSB*pow4(T)
00175             )
00176         );
00177 
00178     }
00179 }
00180 
00181 
00182 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
00183 
00184 Foam::radiation::blackBodyEmission::~blackBodyEmission()
00185 {}
00186 
00187 
00188 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00189 
00190 Foam::scalar Foam::radiation::blackBodyEmission::fLambdaT
00191 (
00192     const scalar lambdaT
00193 ) const
00194 {
00195     return  table_(lambdaT*1.0e6);
00196 }
00197 
00198 
00199 Foam::tmp<Foam::volScalarField>
00200 Foam::radiation::blackBodyEmission::EbDeltaLambdaT
00201 (
00202     const volScalarField& T,
00203     const Vector2D<scalar>& band
00204 ) const
00205 {
00206     tmp<volScalarField> Eb
00207     (
00208         new volScalarField
00209         (
00210             IOobject
00211             (
00212                 "Eb",
00213                 T.mesh().time().timeName(),
00214                 T.mesh(),
00215                 IOobject::NO_READ,
00216                 IOobject::NO_WRITE
00217             ),
00218             radiation::sigmaSB*pow4(T)
00219         )
00220     );
00221 
00222 
00223     if (band == Vector2D<scalar>::one)
00224     {
00225         return Eb;
00226     }
00227     else
00228     {
00229         forAll(T, i)
00230         {
00231             scalar T1 = fLambdaT(band[1]*T[i]);
00232             scalar T2 = fLambdaT(band[0]*T[i]);
00233             dimensionedScalar fLambdaDelta
00234             (
00235                 "fLambdaDelta",
00236                 dimless,
00237                 T1 - T2
00238             );
00239             Eb()[i] = Eb()[i]*fLambdaDelta.value();
00240         }
00241         return Eb;
00242     }
00243 }
00244 
00245 
00246 void Foam::radiation::blackBodyEmission::correct
00247 (
00248     const label lambdaI,
00249     const Vector2D<scalar>& band
00250 )
00251 {
00252     bLambda_[lambdaI] = EbDeltaLambdaT(T_, band);
00253 }
00254 
00255 
00256 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd