BUG: PointEdgeWave : n cyclics bool instead of label
[OpenFOAM-1.6.x.git] / applications / solvers / combustion / fireFoam / combustionModels / combustionModel / combustionModel.C
blob538d43073e63526057913e064e11ea093cd4039a
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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"
28 #include "fvm.H"
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 namespace Foam
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_
51     (
52         combustionProperties.subDict
53         (
54             word(combustionProperties.lookup("combustionModel")) + "Coeffs"
55         )
56     ),
57     thermo_(thermo),
58     turbulence_(turbulence),
59     mesh_(phi.mesh()),
60     phi_(phi),
61     rho_(rho),
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
92 ) const
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");
105     return true;
109 // ************************************************************************* //