FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 \*---------------------------------------------------------------------------*/
00025 
00026 #include "blackBodyEmission.H"
00027 #include <OpenFOAM/dimensionedConstants.H>
00028 
00029 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
00030 
00031 const Foam::List<Foam::Tuple2<Foam::scalar, Foam::scalar> >
00032 Foam::radiation::blackBodyEmission::emissivePowerTable
00033 (
00034     IStringStream
00035     (
00036         "("
00037         "( 1000 0.00032)"
00038         "( 1100 0.00091)"
00039         "( 1200 0.00213)"
00040         "( 1300 0.00432)"
00041         "( 1400 0.00779)"
00042         "( 1500 0.01280)"
00043         "( 1600 0.01972)"
00044         "( 1700 0.02853)"
00045         "( 1800 0.03934)"
00046         "( 1900 0.05210)"
00047         "( 2000 0.06672)"
00048         "( 2100 0.08305)"
00049         "( 2200 0.10088)"
00050         "( 2300 0.12002)"
00051         "( 2400 0.14025)"
00052         "( 2500 0.16135)"
00053         "( 2600 0.18311)"
00054         "( 2700 0.20535)"
00055         "( 2800 0.22788)"
00056         "( 2900 0.25055)"
00057         "( 3000 0.27322)"
00058         "( 3100 0.29576)"
00059         "( 3200 0.31809)"
00060         "( 3300 0.34009)"
00061         "( 3400 0.36172)"
00062         "( 3500 0.38290)"
00063         "( 3600 0.40359)"
00064         "( 3700 0.42375)"
00065         "( 3800 0.44336)"
00066         "( 3900 0.46240)"
00067         "( 4000 0.48085)"
00068         "( 4100 0.49872)"
00069         "( 4200 0.51599)"
00070         "( 4300 0.53267)"
00071         "( 4400 0.54877)"
00072         "( 4500 0.56429)"
00073         "( 4600 0.57925)"
00074         "( 4700 0.59366)"
00075         "( 4800 0.60753)"
00076         "( 4900 0.62088)"
00077         "( 5000 0.63372)"
00078         "( 5100 0.64606)"
00079         "( 5200 0.65794)"
00080         "( 5300 0.66935)"
00081         "( 5400 0.68033)"
00082         "( 5500 0.69087)"
00083         "( 5600 0.70101)"
00084         "( 5700 0.71076)"
00085         "( 5800 0.72012)"
00086         "( 5900 0.72913)"
00087         "( 6000 0.73778)"
00088         "( 6100 0.74610)"
00089         "( 6200 0.75410)"
00090         "( 6300 0.76180)"
00091         "( 6400 0.76920)"
00092         "( 6500 0.77631)"
00093         "( 6600 0.78316)"
00094         "( 6700 0.78975)"
00095         "( 6800 0.79609)"
00096         "( 6900 0.80219)"
00097         "( 7000 0.80807)"
00098         "( 7100 0.81373)"
00099         "( 7200 0.81918)"
00100         "( 7300 0.82443)"
00101         "( 7400 0.82949)"
00102         "( 7500 0.83436)"
00103         "( 7600 0.83906)"
00104         "( 7700 0.84359)"
00105         "( 7800 0.84796)"
00106         "( 7900 0.85218)"
00107         "( 8000 0.85625)"
00108         "( 8100 0.86017)"
00109         "( 8200 0.86396)"
00110         "( 8300 0.86762)"
00111         "( 8400 0.87115)"
00112         "( 8500 0.87456)"
00113         "( 8600 0.87786)"
00114         "( 8700 0.88105)"
00115         "( 8800 0.88413)"
00116         "( 8900 0.88711)"
00117         "( 9000 0.88999)"
00118         "( 9100 0.89277)"
00119         "( 9200 0.89547)"
00120         "( 9300 0.89807)"
00121         "( 9400 0.90060)"
00122         "( 9500 0.90304)"
00123         "( 9600 0.90541)"
00124         "( 9700 0.90770)"
00125         "( 9800 0.90992)"
00126         "( 9900 0.91207)"
00127         "(10000 0.91415)"
00128         "(12000 0.94505)"
00129         "(15000 0.96893)"
00130         "(20000 0.98555)"
00131         "(30000 0.99529)"
00132         "(40000 0.99792)"
00133         "(50000 0.99890)"
00134         ")"
00135     )()
00136 );
00137 
00138 
00139 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00140 
00141 Foam::radiation::blackBodyEmission::blackBodyEmission
00142 (
00143     const label nLambda,
00144     const volScalarField& T
00145 )
00146 :
00147     table_
00148     (
00149         emissivePowerTable,
00150         interpolationTable<scalar>::CLAMP,
00151         "blackBodyEmissivePower"
00152     ),
00153     C1_("C1", dimensionSet(1, 4, 3, 0, 0, 0, 0), 3.7419e-16),
00154     C2_("C2", dimensionSet(0, 1, 0, 1, 0, 0, 0), 14.388e-6),
00155     bLambda_(nLambda),
00156     T_(T)
00157 {
00158     forAll(bLambda_, lambdaI)
00159     {
00160         bLambda_.set
00161         (
00162             lambdaI,
00163             new volScalarField
00164             (
00165                 IOobject
00166                 (
00167                     "bLambda_" + Foam::name(lambdaI) ,
00168                     T.mesh().time().timeName(),
00169                     T.mesh(),
00170                     IOobject::NO_READ,
00171                     IOobject::NO_WRITE
00172                 ),
00173                 radiation::sigmaSB*pow4(T)
00174             )
00175         );
00176 
00177     }
00178 }
00179 
00180 
00181 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
00182 
00183 Foam::radiation::blackBodyEmission::~blackBodyEmission()
00184 {}
00185 
00186 
00187 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00188 
00189 Foam::scalar Foam::radiation::blackBodyEmission::fLambdaT
00190 (
00191     const scalar lambdaT
00192 ) const
00193 {
00194     return  table_(lambdaT*1.0e6);
00195 }
00196 
00197 
00198 Foam::tmp<Foam::volScalarField>
00199 Foam::radiation::blackBodyEmission::EbDeltaLambdaT
00200 (
00201     const volScalarField& T,
00202     const Vector2D<scalar>& band
00203 ) const
00204 {
00205     tmp<volScalarField> Eb
00206     (
00207         new volScalarField
00208         (
00209             IOobject
00210             (
00211                 "Eb",
00212                 T.mesh().time().timeName(),
00213                 T.mesh(),
00214                 IOobject::NO_READ,
00215                 IOobject::NO_WRITE
00216             ),
00217             radiation::sigmaSB*pow4(T)
00218         )
00219     );
00220 
00221 
00222     if (band == Vector2D<scalar>::one)
00223     {
00224         return Eb;
00225     }
00226     else
00227     {
00228         forAll(T, i)
00229         {
00230             scalar T1 = fLambdaT(band[1]*T[i]);
00231             scalar T2 = fLambdaT(band[0]*T[i]);
00232             dimensionedScalar fLambdaDelta
00233             (
00234                 "fLambdaDelta",
00235                 dimless,
00236                 T1 - T2
00237             );
00238             Eb()[i] = Eb()[i]*fLambdaDelta.value();
00239         }
00240         return Eb;
00241     }
00242 }
00243 
00244 
00245 void Foam::radiation::blackBodyEmission::correct
00246 (
00247     const label lambdaI,
00248     const Vector2D<scalar>& band
00249 )
00250 {
00251     bLambda_[lambdaI] = EbDeltaLambdaT(T_, band);
00252 }
00253 
00254 
00255 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines