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

absorptionEmissionModel.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) 1991-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 "absorptionEmissionModel.H"
00028 
00029 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
00030 
00031 namespace Foam
00032 {
00033     namespace radiation
00034     {
00035         defineTypeNameAndDebug(absorptionEmissionModel, 0);
00036         defineRunTimeSelectionTable(absorptionEmissionModel, dictionary);
00037     }
00038 }
00039 
00040 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00041 
00042 Foam::radiation::absorptionEmissionModel::absorptionEmissionModel
00043 (
00044     const dictionary& dict,
00045     const fvMesh& mesh
00046 )
00047 :
00048     dict_(dict),
00049     mesh_(mesh)
00050 {}
00051 
00052 
00053 // * * * * * * * * * * * * * * * * Destructor    * * * * * * * * * * * * * * //
00054 
00055 Foam::radiation::absorptionEmissionModel::~absorptionEmissionModel()
00056 {}
00057 
00058 
00059 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00060 
00061 Foam::tmp<Foam::volScalarField>
00062 Foam::radiation::absorptionEmissionModel::a(const label bandI) const
00063 {
00064     return aDisp(bandI) + aCont(bandI);
00065 }
00066 
00067 
00068 Foam::tmp<Foam::volScalarField>
00069 Foam::radiation::absorptionEmissionModel::aCont(const label bandI) const
00070 {
00071     return tmp<volScalarField>
00072     (
00073         new volScalarField
00074         (
00075             IOobject
00076             (
00077                 "aCont",
00078                 mesh_.time().timeName(),
00079                 mesh_,
00080                 IOobject::NO_READ,
00081                 IOobject::NO_WRITE,
00082                 false
00083             ),
00084             mesh_,
00085             dimensionedScalar("zero", dimless/dimLength, 0.0)
00086         )
00087     );
00088 }
00089 
00090 
00091 Foam::tmp<Foam::volScalarField>
00092 Foam::radiation::absorptionEmissionModel::aDisp(const label bandI) const
00093 {
00094     return tmp<volScalarField>
00095     (
00096         new volScalarField
00097         (
00098             IOobject
00099             (
00100                 "aDisp",
00101                 mesh_.time().timeName(),
00102                 mesh_,
00103                 IOobject::NO_READ,
00104                 IOobject::NO_WRITE,
00105                 false
00106             ),
00107             mesh_,
00108             dimensionedScalar("zero", dimless/dimLength, 0.0)
00109         )
00110     );
00111 }
00112 
00113 
00114 Foam::tmp<Foam::volScalarField>
00115 Foam::radiation::absorptionEmissionModel::e(const label bandI) const
00116 {
00117     return eDisp(bandI) + eCont(bandI);
00118 }
00119 
00120 
00121 Foam::tmp<Foam::volScalarField>
00122 Foam::radiation::absorptionEmissionModel::eCont(const label bandI) const
00123 {
00124     return tmp<volScalarField>
00125     (
00126         new volScalarField
00127         (
00128             IOobject
00129             (
00130                 "eCont",
00131                 mesh_.time().timeName(),
00132                 mesh_,
00133                 IOobject::NO_READ,
00134                 IOobject::NO_WRITE,
00135                 false
00136             ),
00137             mesh_,
00138             dimensionedScalar("zero", dimless/dimLength, 0.0)
00139         )
00140     );
00141 }
00142 
00143 
00144 Foam::tmp<Foam::volScalarField>
00145 Foam::radiation::absorptionEmissionModel::eDisp(const label bandI) const
00146 {
00147     return tmp<volScalarField>
00148     (
00149         new volScalarField
00150         (
00151             IOobject
00152             (
00153                 "eDisp",
00154                 mesh_.time().timeName(),
00155                 mesh_,
00156                 IOobject::NO_READ,
00157                 IOobject::NO_WRITE,
00158                 false
00159             ),
00160             mesh_,
00161             dimensionedScalar("zero", dimless/dimLength, 0.0)
00162         )
00163     );
00164 }
00165 
00166 
00167 Foam::tmp<Foam::volScalarField>
00168 Foam::radiation::absorptionEmissionModel::E(const label bandI) const
00169 {
00170     return EDisp(bandI) + ECont(bandI);
00171 }
00172 
00173 
00174 Foam::tmp<Foam::volScalarField>
00175 Foam::radiation::absorptionEmissionModel::ECont(const label bandI) const
00176 {
00177     return tmp<volScalarField>
00178     (
00179         new volScalarField
00180         (
00181             IOobject
00182             (
00183                 "ECont",
00184                 mesh_.time().timeName(),
00185                 mesh_,
00186                 IOobject::NO_READ,
00187                 IOobject::NO_WRITE,
00188                 false
00189             ),
00190             mesh_,
00191             dimensionedScalar("zero", dimMass/dimLength/pow3(dimTime), 0.0)
00192         )
00193     );
00194 }
00195 
00196 
00197 Foam::tmp<Foam::volScalarField>
00198 Foam::radiation::absorptionEmissionModel::EDisp(const label bandI) const
00199 {
00200     return tmp<volScalarField>
00201     (
00202         new volScalarField
00203         (
00204             IOobject
00205             (
00206                 "EDisp",
00207                 mesh_.time().timeName(),
00208                 mesh_,
00209                 IOobject::NO_READ,
00210                 IOobject::NO_WRITE,
00211                 false
00212             ),
00213             mesh_,
00214             dimensionedScalar("zero", dimMass/dimLength/pow3(dimTime), 0.0)
00215         )
00216     );
00217 }
00218 
00219 
00220 Foam::label Foam::radiation::absorptionEmissionModel::nBands() const
00221 {
00222     return pTraits<label>::one;
00223 }
00224 
00225 
00226 const Foam::Vector2D<Foam::scalar>&
00227 Foam::radiation::absorptionEmissionModel::bands(const label n) const
00228 {
00229     return Vector2D<scalar>::one;
00230 }
00231 
00232 
00233 bool Foam::radiation::absorptionEmissionModel::isGrey() const
00234 {
00235     return false;
00236 }
00237 
00238 
00239 Foam::tmp<Foam::volScalarField>
00240 Foam::radiation::absorptionEmissionModel::addIntensity
00241 (
00242     const label rayI,
00243     const volScalarField& ILambda
00244 ) const
00245 {
00246     return ILambda;
00247 }
00248 
00249 
00250 void Foam::radiation::absorptionEmissionModel::correct
00251 (
00252     volScalarField& a,
00253     PtrList<volScalarField>& aj
00254 ) const
00255 {
00256     a.internalField() = this->a();
00257     aj[0].internalField() =  a.internalField();
00258 }
00259 
00260 
00261 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd