initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / thermophysicalModels / reactionThermo / mixtures / multiComponentMixture / multiComponentMixture.H
blobcb02f56683ee715c04e479cc988fc721b3685561
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::multiComponentMixture
28 Description
29     Foam::multiComponentMixture
31 SourceFiles
32     multiComponentMixture.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef multiComponentMixture_H
37 #define multiComponentMixture_H
39 #include "basicMultiComponentMixture.H"
40 #include "HashPtrTable.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 namespace Foam
47 /*---------------------------------------------------------------------------*\
48                     Class multiComponentMixture Declaration
49 \*---------------------------------------------------------------------------*/
51 template<class ThermoType>
52 class multiComponentMixture
54     public basicMultiComponentMixture
56     // Private data
58         //- Species data
59         PtrList<ThermoType> speciesData_;
61         //- Temporary storage for the cell/face mixture thermo data
62         mutable ThermoType mixture_;
65     // Private member functions
67         //- Construct the species data from the given dictionary and return the
68         //  data for the first specie to initialise the mixture thermo data
69         const ThermoType& constructSpeciesData(const dictionary& thermoDict);
71         //- Correct the mass fractions to sum to 1
72         void correctMassFractions();
74         //- Construct as copy (not implemented)
75         multiComponentMixture(const multiComponentMixture<ThermoType>&);
78 public:
80     //- The type of thermodynamics this mixture is instantiated for
81     typedef ThermoType thermoType;
84     // Constructors
86         //- Construct from dictionary, specie names, thermo database and mesh
87         multiComponentMixture
88         (
89             const dictionary&,
90             const wordList& specieNames,
91             const HashPtrTable<ThermoType>& specieThermoData,
92             const fvMesh&
93         );
95         //- Construct from dictionary and mesh
96         multiComponentMixture(const dictionary&, const fvMesh&);
99     //- Destructor
100     virtual ~multiComponentMixture()
101     {}
104     // Member functions
106         const ThermoType& cellMixture(const label celli) const;
108         const ThermoType& patchFaceMixture
109         (
110             const label patchi,
111             const label facei
112         ) const;
114         //- Return the raw specie thermodynamic data
115         const PtrList<ThermoType>& speciesData() const
116         {
117             return speciesData_;
118         }
120         //- Read dictionary
121         void read(const dictionary&);
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 } // End namespace Foam
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131 #ifdef NoRepository
132 #   include "multiComponentMixture.C"
133 #endif
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 #endif
139 // ************************************************************************* //