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

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