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

cloudAbsorptionEmission.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 Description
00026 
00027 \*---------------------------------------------------------------------------*/
00028 
00029 #include "cloudAbsorptionEmission.H"
00030 #include "addToRunTimeSelectionTable.H"
00031 
00032 #include "thermoCloud.H"
00033 
00034 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
00035 
00036 namespace Foam
00037 {
00038     namespace radiation
00039     {
00040         defineTypeNameAndDebug(cloudAbsorptionEmission, 0);
00041 
00042         addToRunTimeSelectionTable
00043         (
00044             absorptionEmissionModel,
00045             cloudAbsorptionEmission,
00046             dictionary
00047         );
00048     }
00049 }
00050 
00051 
00052 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00053 
00054 Foam::radiation::cloudAbsorptionEmission::cloudAbsorptionEmission
00055 (
00056     const dictionary& dict,
00057     const fvMesh& mesh
00058 )
00059 :
00060     absorptionEmissionModel(dict, mesh),
00061     coeffsDict_(dict.subDict(typeName + "Coeffs")),
00062     cloudNames_(coeffsDict_.lookup("cloudNames"))
00063 {}
00064 
00065 
00066 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
00067 
00068 Foam::radiation::cloudAbsorptionEmission::~cloudAbsorptionEmission()
00069 {}
00070 
00071 
00072 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00073 
00074 Foam::tmp<Foam::volScalarField>
00075 Foam::radiation::cloudAbsorptionEmission::aDisp(const label) const
00076 {
00077     tmp<volScalarField> ta
00078     (
00079         new volScalarField
00080         (
00081             IOobject
00082             (
00083                 "a",
00084                 mesh_.time().timeName(),
00085                 mesh_,
00086                 IOobject::NO_READ,
00087                 IOobject::NO_WRITE,
00088                 false
00089             ),
00090             mesh_,
00091             dimensionedScalar("a", dimless/dimLength, 0.0)
00092         )
00093     );
00094 
00095     forAll(cloudNames_, i)
00096     {
00097         const thermoCloud& tc
00098         (
00099             mesh_.objectRegistry::lookupObject<thermoCloud>(cloudNames_[i])
00100         );
00101 
00102         ta() += tc.ap();
00103     }
00104 
00105     return ta;
00106 }
00107 
00108 
00109 Foam::tmp<Foam::volScalarField>
00110 Foam::radiation::cloudAbsorptionEmission::eDisp(const label bandI) const
00111 {
00112     tmp<volScalarField> te
00113     (
00114         new volScalarField
00115         (
00116             IOobject
00117             (
00118                 "e",
00119                 mesh_.time().timeName(),
00120                 mesh_,
00121                 IOobject::NO_READ,
00122                 IOobject::NO_WRITE,
00123                 false
00124             ),
00125             mesh_,
00126             dimensionedScalar("e", dimless/dimLength, 0.0)
00127         )
00128     );
00129 
00130     return te;
00131 }
00132 
00133 
00134 Foam::tmp<Foam::volScalarField>
00135 Foam::radiation::cloudAbsorptionEmission::EDisp(const label bandI) const
00136 {
00137     tmp<volScalarField> tE
00138     (
00139         new volScalarField
00140         (
00141             IOobject
00142             (
00143                 "E",
00144                 mesh_.time().timeName(),
00145                 mesh_,
00146                 IOobject::NO_READ,
00147                 IOobject::NO_WRITE,
00148                 false
00149             ),
00150             mesh_,
00151             dimensionedScalar("E", dimMass/dimLength/pow3(dimTime), 0.0)
00152         )
00153     );
00154 
00155     forAll(cloudNames_, i)
00156     {
00157         const thermoCloud& tc
00158         (
00159             mesh_.objectRegistry::lookupObject<thermoCloud>(cloudNames_[i])
00160         );
00161 
00162         tE() += tc.Ep();
00163     }
00164 
00165     return tE;
00166 }
00167 
00168 
00169 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd