1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2010 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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "combustionModel.H"
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33 defineTypeNameAndDebug(combustionModel, 0);
34 defineRunTimeSelectionTable(combustionModel, dictionary);
38 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
40 Foam::combustionModel::combustionModel
42 const dictionary& combustionProperties,
43 const hsCombustionThermo& thermo,
44 const compressible::turbulenceModel& turbulence,
45 const surfaceScalarField& phi,
46 const volScalarField& rho
49 combustionModelCoeffs_
51 combustionProperties.subDict
53 word(combustionProperties.lookup("combustionModel")) + "Coeffs"
57 turbulence_(turbulence),
61 stoicRatio_(thermo.lookup("stoichiometricAirFuelMassRatio")),
62 s_(thermo.lookup("stoichiometricOxygenFuelMassRatio")),
63 qFuel_(thermo_.lookup("qFuel")),
64 composition_(thermo.composition())
68 // * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
70 Foam::combustionModel::~combustionModel()
74 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
76 Foam::tmp<Foam::fvScalarMatrix>
77 Foam::combustionModel::combustionModel::R(volScalarField& fu) const
79 const basicMultiComponentMixture& composition = thermo_.composition();
80 const volScalarField& ft = composition.Y("ft");
81 volScalarField fres = composition.fres(ft, stoicRatio_.value());
82 volScalarField wFuelNorm = this->wFuelNorm()*pos(fu - fres);
84 return wFuelNorm*fres - fvm::Sp(wFuelNorm, fu);
88 Foam::tmp<Foam::volScalarField> Foam::combustionModel::combustionModel::dQ
90 const fvScalarMatrix& Rfu
93 const basicMultiComponentMixture& composition = thermo_.composition();
94 const volScalarField& fu = composition.Y("fu");
96 return (-qFuel_)*(Rfu & fu);
100 bool Foam::combustionModel::read(const dictionary& combustionProperties)
102 combustionModelCoeffs_ = combustionProperties.subDict(type() + "Coeffs");
108 // ************************************************************************* //