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

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