1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2010-2011 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/>.
25 Foam::singleStepReactingMixture
28 Single step reacting mixture
31 singleStepReactingMixture.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef singleStepReactingMixture_H
36 #define singleStepReactingMixture_H
38 #include "chemistryReader.H"
39 #include "reactingMixture.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 /*---------------------------------------------------------------------------*\
47 Class singleStepReactingMixture Declaration
48 \*---------------------------------------------------------------------------*/
50 template<class ThermoType>
51 class singleStepReactingMixture
53 public reactingMixture<ThermoType>
60 //- Stoichiometric air-fuel mass ratio
61 dimensionedScalar stoicRatio_;
63 //- Stoichiometric oxygen-fuel mass ratio
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.
75 //- List of components residual
76 PtrList<volScalarField> fres_;
78 //- Inert specie index
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&);
97 void calculateqFuel();
99 //- Calculate air/fuel and oxygen/fuel ratio
100 void massAndAirStoichRatios();
102 //- Calculate maximum products at stoichiometric mixture
103 void calculateMaxProducts();
108 //- The type of thermo package this mixture is instantiated for
109 typedef ThermoType thermoType;
114 //- Construct from dictionary and mesh
115 singleStepReactingMixture(const dictionary&, const fvMesh&);
119 virtual ~singleStepReactingMixture()
125 //- Calculates the residual for all components
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;
159 void read(const dictionary&);
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 } // End namespace Foam
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 #include "singleStepReactingMixtureI.H"
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 # include "singleStepReactingMixture.C"
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 // ************************************************************************* //