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

combustionModel.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 "combustionModel.H"
00027 #include <finiteVolume/fvm.H>
00028 
00029 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
00030 
00031 namespace Foam
00032 {
00033     defineTypeNameAndDebug(combustionModel, 0);
00034     defineRunTimeSelectionTable(combustionModel, dictionary);
00035 };
00036 
00037 
00038 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00039 
00040 Foam::combustionModel::combustionModel
00041 (
00042     const dictionary& combustionProperties,
00043     const hsCombustionThermo& thermo,
00044     const compressible::turbulenceModel& turbulence,
00045     const surfaceScalarField& phi,
00046     const volScalarField& rho
00047 )
00048 :
00049     combustionModelCoeffs_
00050     (
00051         combustionProperties.subDict
00052         (
00053             word(combustionProperties.lookup("combustionModel")) + "Coeffs"
00054         )
00055     ),
00056     thermo_(thermo),
00057     turbulence_(turbulence),
00058     mesh_(phi.mesh()),
00059     phi_(phi),
00060     rho_(rho),
00061     stoicRatio_(thermo.lookup("stoichiometricAirFuelMassRatio")),
00062     s_(thermo.lookup("stoichiometricOxygenFuelMassRatio")),
00063     qFuel_(thermo_.lookup("qFuel")),
00064     composition_(thermo.composition())
00065 {}
00066 
00067 
00068 // * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
00069 
00070 Foam::combustionModel::~combustionModel()
00071 {}
00072 
00073 
00074 // * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * * //
00075 
00076 Foam::tmp<Foam::fvScalarMatrix>
00077 Foam::combustionModel::combustionModel::R(volScalarField& fu) const
00078 {
00079     const basicMultiComponentMixture& composition = thermo_.composition();
00080     const volScalarField& ft = composition.Y("ft");
00081     volScalarField fres = composition.fres(ft, stoicRatio_.value());
00082     volScalarField wFuelNorm = this->wFuelNorm()*pos(fu - fres);
00083 
00084     return wFuelNorm*fres - fvm::Sp(wFuelNorm, fu);
00085 }
00086 
00087 
00088 Foam::tmp<Foam::volScalarField> Foam::combustionModel::combustionModel::dQ
00089 (
00090     const fvScalarMatrix& Rfu
00091 ) const
00092 {
00093     const basicMultiComponentMixture& composition = thermo_.composition();
00094     const volScalarField& fu = composition.Y("fu");
00095 
00096     return (-qFuel_)*(Rfu & fu);
00097 }
00098 
00099 
00100 bool Foam::combustionModel::read(const dictionary& combustionProperties)
00101 {
00102     combustionModelCoeffs_ = combustionProperties.subDict(type() + "Coeffs");
00103 
00104     return true;
00105 }
00106 
00107 
00108 // ************************************************************************* //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines