1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
27 #include "radiationModel.H"
28 #include "absorptionEmissionModel.H"
29 #include "scatterModel.H"
32 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
38 defineTypeNameAndDebug(radiationModel, 0);
39 defineRunTimeSelectionTable(radiationModel, dictionary);
44 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
46 Foam::radiation::radiationModel::radiationModel(const volScalarField& T)
52 "radiationProperties",
63 coeffs_(dictionary::null),
65 absorptionEmission_(NULL),
70 Foam::radiation::radiationModel::radiationModel
73 const volScalarField& T
80 "radiationProperties",
90 radiation_(lookup("radiation")),
91 coeffs_(subDict(type + "Coeffs")),
92 solverFreq_(readLabel(lookup("solverFreq"))),
93 absorptionEmission_(absorptionEmissionModel::New(*this, mesh_)),
94 scatter_(scatterModel::New(*this, mesh_))
96 solverFreq_ = max(1, solverFreq_);
100 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
102 Foam::radiation::radiationModel::~radiationModel()
106 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
108 bool Foam::radiation::radiationModel::read()
110 if (regIOobject::read())
112 lookup("radiation") >> radiation_;
113 coeffs_ = subDict(type() + "Coeffs");
124 void Foam::radiation::radiationModel::correct()
131 if (time_.timeIndex() % solverFreq_ == 0)
138 Foam::tmp<Foam::fvScalarMatrix> Foam::radiation::radiationModel::Sh
143 volScalarField& h = thermo.h();
144 const volScalarField cp = thermo.Cp();
145 const volScalarField T3 = pow3(T_);
150 - fvm::Sp(4.0*Rp()*T3/cp, h)
151 - Rp()*T3*(T_ - 4.0*h/cp)
155 Foam::tmp<Foam::fvScalarMatrix> Foam::radiation::radiationModel::Shs
160 volScalarField& hs = thermo.hs();
161 const volScalarField cp = thermo.Cp();
162 const volScalarField T3 = pow3(T_);
167 - fvm::Sp(4.0*Rp()*T3/cp, hs)
168 - Rp()*T3*(T_ - 4.0*hs/cp)
172 // ************************************************************************* //