Initial commit for version 2.0.x patch release
[OpenFOAM-2.0.x.git] / src / thermophysicalModels / reactionThermo / mixtures / singleStepReactingMixture / singleStepReactingMixture.H
blob5f31f225eab6f374287c5c7d87ac7666e506af2f
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2010-2011 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
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
19     for more details.
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 Class
25     Foam::singleStepReactingMixture
27 Description
28     Single step reacting mixture
30 SourceFiles
31     singleStepReactingMixture.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef singleStepReactingMixture_H
36 #define singleStepReactingMixture_H
38 #include "chemistryReader.H"
39 #include "reactingMixture.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 namespace Foam
46 /*---------------------------------------------------------------------------*\
47                  Class singleStepReactingMixture Declaration
48 \*---------------------------------------------------------------------------*/
50 template<class ThermoType>
51 class singleStepReactingMixture
53     public reactingMixture<ThermoType>
56 protected:
58     // Protected data
60         //- Stoichiometric air-fuel mass ratio
61         dimensionedScalar stoicRatio_;
63         //- Stoichiometric oxygen-fuel mass ratio
64         dimensionedScalar s_;
66         //- Heat of combustion [J/Kg]
67         dimensionedScalar qFuel_;
69         //- Stoichiometric coefficient for the reaction.
70         scalarList specieStoichCoeffs_;
72         //- Mass concentrations at stoichiometric mixture for fres.
73         scalarList Yprod0_;
75         //- List of components residual
76         PtrList<volScalarField> fres_;
78         //- Inert specie index
79         label inertIndex_;
81         //- Fuel specie index
82         label fuelIndex_;
84         //- List to indicate if specie is produced/consumed
85         List<int> specieProd_;
88     // Protected member functions
90         //- Disallow default bitwise copy construct
91         singleStepReactingMixture(const singleStepReactingMixture&);
93         //- Disallow default bitwise assignment
94         void operator=(const singleStepReactingMixture&);
96         //- Calculate qFuel
97         void calculateqFuel();
99         //- Calculate air/fuel and oxygen/fuel ratio
100         void massAndAirStoichRatios();
102         //- Calculate maximum products at stoichiometric mixture
103         void calculateMaxProducts();
106 public:
108     //- The type of thermo package this mixture is instantiated for
109     typedef ThermoType thermoType;
112     // Constructors
114         //- Construct from dictionary and mesh
115         singleStepReactingMixture(const dictionary&, const fvMesh&);
118     //- Destructor
119     virtual ~singleStepReactingMixture()
120     {}
123     // Member functions
125         //- Calculates the residual for all components
126         void fresCorrect();
129         // Access functions
131             //- Return the stoichiometric air-fuel mass ratio
132             inline const dimensionedScalar stoicRatio() const;
134             //- Return the Stoichiometric oxygen-fuel mass ratio
135             inline const dimensionedScalar s() const;
137             //- Return the heat of combustion [J/Kg]
138             inline const dimensionedScalar qFuel() const;
140             //- Return the stoichiometric coefficient for the reaction
141             inline const List<scalar>& specieStoichCoeffs() const;
143             //- Return the list of components residual
144             inline tmp<volScalarField> fres(const label index) const;
146             //- Return the inert specie index
147             inline label inertIndex() const;
149             //- Return the fuel specie index
150             inline label fuelIndex() const;
152             //- Return the list to indicate if specie is produced/consumed
153             inline const List<int>& specieProd() const;
156         // I-O
158             //- Read dictionary
159             void read(const dictionary&);
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 } // End namespace Foam
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 #include "singleStepReactingMixtureI.H"
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 #ifdef NoRepository
174 #   include "singleStepReactingMixture.C"
175 #endif
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 #endif
181 // ************************************************************************* //