Improved and generalised the interface to the combustion model by having the
[OpenFOAM-1.6.x.git] / applications / solvers / combustion / fireFoam / combustionModels / combustionModel / combustionModel.H
blob19a3392bbb6ad05c6e00baf4ae9128da5055ef1b
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 Class
26     Foam::combustionModel
28 Description
29     Base class for all non-premixed combustion models.
31 SourceFiles
32     combustionModel.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef combustionModel_H
37 #define combustionModel_H
39 #include "IOdictionary.H"
40 #include "hsCombustionThermo.H"
41 #include "turbulenceModel.H"
42 #include "multivariateSurfaceInterpolationScheme.H"
43 #include "runTimeSelectionTables.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 namespace Foam
50 /*---------------------------------------------------------------------------*\
51                         Class combustionModel Declaration
52 \*---------------------------------------------------------------------------*/
54 class combustionModel
57 protected:
59     // Protected data
61         //- Dictionary of coefficients for the particular model
62         dictionary combustionModelCoeffs_;
64         //- Reference to the thermodynamic
65         const hsCombustionThermo& thermo_;
67         //- Reference to the turbulence model
68         const compressible::turbulenceModel& turbulence_;
70         //- Reference to the mesh database
71         const fvMesh& mesh_;
73         //- Reference to mass-flux field
74         const surfaceScalarField& phi_;
76         //- Reference to the density field
77         const volScalarField& rho_;
79         //- Stoichiometric air-fuel mass ratio
80         dimensionedScalar stoicRatio_;
82         //- Stoichiometric oxygen-fuel mass ratio
83         dimensionedScalar s_;
85         //- Heat of combustion (J/Kg)
86         dimensionedScalar qFuel_;
89 private:
91     // Private Member Functions
93         //- Disallow copy construct
94         combustionModel(const combustionModel&);
96         //- Disallow default bitwise assignment
97         void operator=(const combustionModel&);
99         const basicMultiComponentMixture& composition_;
102 public:
104     //- Runtime type information
105     TypeName("combustionModel");
108     // Declare run-time constructor selection table
110         declareRunTimeSelectionTable
111         (
112             autoPtr,
113             combustionModel,
114             dictionary,
115             (
116                 const dictionary& combustionProperties,
117                 const hsCombustionThermo& thermo,
118                 const compressible::turbulenceModel& turbulence,
119                 const surfaceScalarField& phi,
120                 const volScalarField& rho
121             ),
122             (
123                 combustionProperties,
124                 thermo,
125                 turbulence,
126                 phi,
127                 rho
128             )
129         );
132     // Selectors
134         //- Return a reference to the selected combustion model
135         static autoPtr<combustionModel> New
136         (
137             const dictionary& combustionProperties,
138             const hsCombustionThermo& thermo,
139             const compressible::turbulenceModel& turbulence,
140             const surfaceScalarField& phi,
141             const volScalarField& rho
142         );
145     // Constructors
147         //- Construct from components
148         combustionModel
149         (
150             const dictionary& combustionProperties,
151             const hsCombustionThermo& thermo,
152             const compressible::turbulenceModel& turbulence,
153             const surfaceScalarField& phi,
154             const volScalarField& rho
155         );
158     //- Destructor
159     virtual ~combustionModel();
162     // Member Functions
164         // Access functions
166             //- Access composition
167             const basicMultiComponentMixture& composition() const
168             {
169                 return composition_;
170             }
172             //- Access combustion dictionary
173             const dictionary combustionModelCoeffs() const
174             {
175                 return combustionModelCoeffs_;
176             }
178             //- Access heat of combustion
179             const dimensionedScalar qFuel() const
180             {
181                 return qFuel_;
182             }
184         //- Return normalised consumption rate of (fu - fres)
185         virtual tmp<volScalarField> wFuelNorm() const = 0;
187         //- Fuel consumption rate matrix i.e. source-term for the fuel equation
188         virtual tmp<fvScalarMatrix> R(volScalarField& fu) const;
190         //- Heat-release rate calculated from the given
191         //  fuel consumption rate matrix
192         virtual tmp<volScalarField> dQ(const fvScalarMatrix& Rfu) const;
194         //- Correct combustion rate
195         virtual void correct() = 0;
197         //- Update properties from given dictionary
198         virtual bool read(const dictionary& combustionProperties) = 0;
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 } // End namespace Foam
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 #endif
210 // ************************************************************************* //