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

Gulders.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 "Gulders.H"
00028 #include "addToRunTimeSelectionTable.H"
00029 
00030 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
00031 
00032 namespace Foam
00033 {
00034 namespace laminarFlameSpeedModels
00035 {
00036     defineTypeNameAndDebug(Gulders, 0);
00037 
00038     addToRunTimeSelectionTable
00039     (
00040         laminarFlameSpeed,
00041         Gulders,
00042         dictionary
00043     );
00044 }
00045 }
00046 
00047 
00048 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00049 
00050 Foam::laminarFlameSpeedModels::Gulders::Gulders
00051 (
00052     const dictionary& dict,
00053     const hhuCombustionThermo& ct
00054 )
00055 :
00056     laminarFlameSpeed(dict, ct),
00057 
00058     coeffsDict_(dict.subDict(typeName + "Coeffs").subDict(fuel_)),
00059     W_(readScalar(coeffsDict_.lookup("W"))),
00060     eta_(readScalar(coeffsDict_.lookup("eta"))),
00061     xi_(readScalar(coeffsDict_.lookup("xi"))),
00062     f_(readScalar(coeffsDict_.lookup("f"))),
00063     alpha_(readScalar(coeffsDict_.lookup("alpha"))),
00064     beta_(readScalar(coeffsDict_.lookup("beta")))
00065 {}
00066 
00067 
00068 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
00069 
00070 Foam::laminarFlameSpeedModels::Gulders::~Gulders()
00071 {}
00072 
00073 
00074 // * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * * //
00075 
00076 inline Foam::scalar Foam::laminarFlameSpeedModels::Gulders::SuRef
00077 (
00078     scalar phi
00079 ) const
00080 {
00081     if (phi > SMALL)
00082     {
00083         return W_*pow(phi, eta_)*exp(-xi_*sqr(phi - 1.075));
00084     }
00085     else
00086     {
00087         return 0.0;
00088     }
00089 }
00090 
00091 
00092 inline Foam::scalar Foam::laminarFlameSpeedModels::Gulders::Su0pTphi
00093 (
00094     scalar p,
00095     scalar Tu,
00096     scalar phi,
00097     scalar Yres
00098 ) const
00099 {
00100     static const scalar Tref = 300.0;
00101     static const scalar pRef = 1.013e5;
00102 
00103     return SuRef(phi)*pow((Tu/Tref), alpha_)*pow((p/pRef), beta_)*(1 - f_*Yres);
00104 }
00105 
00106 
00107 Foam::tmp<Foam::volScalarField> Foam::laminarFlameSpeedModels::Gulders::Su0pTphi
00108 (
00109     const volScalarField& p,
00110     const volScalarField& Tu,
00111     scalar phi
00112 ) const
00113 {
00114     tmp<volScalarField> tSu0
00115     (
00116         new volScalarField
00117         (
00118             IOobject
00119             (
00120                 "Su0",
00121                 p.time().timeName(),
00122                 p.db(),
00123                 IOobject::NO_READ,
00124                 IOobject::NO_WRITE
00125             ),
00126             p.mesh(),
00127             dimensionedScalar("Su0", dimVelocity, 0.0)
00128         )
00129     );
00130 
00131     volScalarField& Su0 = tSu0();
00132 
00133     forAll(Su0, celli)
00134     {
00135         Su0[celli] = Su0pTphi(p[celli], Tu[celli], phi, 0.0);
00136     }
00137 
00138     forAll(Su0.boundaryField(), patchi)
00139     {
00140         forAll(Su0.boundaryField()[patchi], facei)
00141         {
00142             Su0.boundaryField()[patchi][facei] =
00143                 Su0pTphi
00144                 (
00145                     p.boundaryField()[patchi][facei],
00146                     Tu.boundaryField()[patchi][facei],
00147                     phi,
00148                     0.0
00149                 );
00150         }
00151     }
00152 
00153     return tSu0;
00154 }
00155 
00156 
00157 Foam::tmp<Foam::volScalarField> Foam::laminarFlameSpeedModels::Gulders::Su0pTphi
00158 (
00159     const volScalarField& p,
00160     const volScalarField& Tu,
00161     const volScalarField& phi
00162 ) const
00163 {
00164     tmp<volScalarField> tSu0
00165     (
00166         new volScalarField
00167         (
00168             IOobject
00169             (
00170                 "Su0",
00171                 p.time().timeName(),
00172                 p.db(),
00173                 IOobject::NO_READ,
00174                 IOobject::NO_WRITE
00175             ),
00176             p.mesh(),
00177             dimensionedScalar("Su0", dimVelocity, 0.0)
00178         )
00179     );
00180 
00181     volScalarField& Su0 = tSu0();
00182 
00183     forAll(Su0, celli)
00184     {
00185         Su0[celli] = Su0pTphi(p[celli], Tu[celli], phi[celli], 0.0);
00186     }
00187 
00188     forAll(Su0.boundaryField(), patchi)
00189     {
00190         forAll(Su0.boundaryField()[patchi], facei)
00191         {
00192             Su0.boundaryField()[patchi][facei] =
00193                 Su0pTphi
00194                 (
00195                     p.boundaryField()[patchi][facei],
00196                     Tu.boundaryField()[patchi][facei],
00197                     phi.boundaryField()[patchi][facei],
00198                     0.0
00199                 );
00200         }
00201     }
00202 
00203     return tSu0;
00204 }
00205 
00206 
00207 Foam::tmp<Foam::volScalarField>
00208 Foam::laminarFlameSpeedModels::Gulders::operator()() const
00209 {
00210     if (hhuCombustionThermo_.composition().contains("ft"))
00211     {
00212         const volScalarField& ft = hhuCombustionThermo_.composition().Y("ft");
00213 
00214         return Su0pTphi
00215         (
00216             hhuCombustionThermo_.p(),
00217             hhuCombustionThermo_.Tu(),
00218             dimensionedScalar
00219             (
00220                 hhuCombustionThermo_.lookup("stoichiometricAirFuelMassRatio")
00221             )*ft/((1 + SMALL) - ft)
00222         );
00223     }
00224     else
00225     {
00226         return Su0pTphi
00227         (
00228             hhuCombustionThermo_.p(),
00229             hhuCombustionThermo_.Tu(),
00230             equivalenceRatio_
00231         );
00232     }
00233 }
00234 
00235 
00236 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd