ENH: autoLayerDriver: better layering information message
[OpenFOAM-2.0.x.git] / src / combustionModels / combustionModel / combustionModel.C
blobec1d85d9e807e111f000d93e285a0c2720a9ec02
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
10     OpenFOAM is free software: you can redistribute it and/or modify it
11     under the terms of the GNU General Public License as published by
12     the Free Software Foundation, either version 3 of the License, or
13     (at your option) any later version.
15     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
16     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
18     for more details.
20     You should have received a copy of the GNU General Public License
21     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
23 \*---------------------------------------------------------------------------*/
25 #include "combustionModel.H"
26 #include "surfaceFields.H"
27 #include "fvScalarMatrix.H"
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
31 namespace Foam
33     defineTypeNameAndDebug(combustionModel, 0);
34     defineRunTimeSelectionTable(combustionModel, dictionary);
38 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
40 Foam::combustionModel::combustionModel
42     const dictionary& combustionProps,
43     hsCombustionThermo& thermo,
44     const compressible::turbulenceModel& turbulence,
45     const surfaceScalarField& phi,
46     const volScalarField& rho
49     coeffs_(dictionary::null),
50     thermo_(thermo),
51     turbulence_(turbulence),
52     mesh_(phi.mesh()),
53     phi_(phi),
54     rho_(rho)
58 Foam::combustionModel::combustionModel
60     const word& modelType,
61     const dictionary& combustionProps,
62     hsCombustionThermo& thermo,
63     const compressible::turbulenceModel& turbulence,
64     const surfaceScalarField& phi,
65     const volScalarField& rho
68     coeffs_(combustionProps.subDict(modelType + "Coeffs")),
69     thermo_(thermo),
70     turbulence_(turbulence),
71     mesh_(phi.mesh()),
72     phi_(phi),
73     rho_(rho)
77 // * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
79 Foam::combustionModel::~combustionModel()
83 // * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * * //
85 void Foam::combustionModel::correct()
87     // do nothing
91 Foam::tmp<Foam::fvScalarMatrix> Foam::combustionModel::R
93     volScalarField& Y
94 ) const
96     return tmp<fvScalarMatrix>
97     (
98         new fvScalarMatrix(Y, dimMass/dimTime*Y.dimensions())
99     );
103 Foam::tmp<Foam::volScalarField> Foam::combustionModel::dQ() const
105     return tmp<Foam::volScalarField>
106     (
107         new volScalarField
108         (
109             IOobject
110             (
111                 "dQ",
112                 mesh_.time().timeName(),
113                 mesh_,
114                 IOobject::NO_READ,
115                 IOobject::NO_WRITE
116             ),
117             mesh_,
118             dimensionedScalar("zero", dimEnergy/dimVolume/dimTime, 0.0)
119         )
120     );
124 Foam::tmp<Foam::volScalarField> Foam::combustionModel::wFuelNorm() const
126     return tmp<Foam::volScalarField>
127     (
128         new volScalarField
129         (
130             IOobject
131             (
132                 "wFuelNorm",
133                 mesh_.time().timeName(),
134                 mesh_,
135                 IOobject::NO_READ,
136                 IOobject::NO_WRITE
137             ),
138             mesh_,
139             dimensionedScalar("zero", dimMass/dimTime/pow3(dimLength), 0.0)
140         )
141     );
145 bool Foam::combustionModel::read(const dictionary& combustionProps)
147     coeffs_ = combustionProps.subDict(type() + "Coeffs");
149     return true;
153 // ************************************************************************* //