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 "combustionModel.H"
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34 defineTypeNameAndDebug(combustionModel, 0);
35 defineRunTimeSelectionTable(combustionModel, dictionary);
39 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
41 Foam::combustionModel::combustionModel
43 const dictionary& combustionProperties,
44 const hsCombustionThermo& thermo,
45 const compressible::turbulenceModel& turbulence,
46 const surfaceScalarField& phi,
47 const volScalarField& rho
50 combustionModelCoeffs_
52 combustionProperties.subDict
54 word(combustionProperties.lookup("combustionModel")) + "Coeffs"
58 turbulence_(turbulence),
62 stoicRatio_(thermo.lookup("stoichiometricAirFuelMassRatio")),
63 s_(thermo.lookup("stoichiometricOxygenFuelMassRatio")),
64 qFuel_(thermo_.lookup("qFuel")),
65 composition_(thermo.composition())
69 // * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
71 Foam::combustionModel::~combustionModel()
75 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
77 Foam::tmp<Foam::fvScalarMatrix>
78 Foam::combustionModel::combustionModel::R(volScalarField& fu) const
80 const basicMultiComponentMixture& composition = thermo_.composition();
81 const volScalarField& ft = composition.Y("ft");
82 volScalarField fres = composition.fres(ft, stoicRatio_.value());
83 volScalarField wFuelNorm = this->wFuelNorm()*pos(fu - fres);
85 return wFuelNorm*fres - fvm::Sp(wFuelNorm, fu);
89 Foam::tmp<Foam::volScalarField> Foam::combustionModel::combustionModel::dQ
91 const fvScalarMatrix& Rfu
94 const basicMultiComponentMixture& composition = thermo_.composition();
95 const volScalarField& fu = composition.Y("fu");
97 return (-qFuel_)*(Rfu & fu);
101 bool Foam::combustionModel::read(const dictionary& combustionProperties)
103 combustionModelCoeffs_ = combustionProperties.subDict(type() + "Coeffs");
109 // ************************************************************************* //