FreeFOAM The Cross-Platform CFD Toolkit
multiComponentMixture.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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.
20 
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/>.
23 
24 Class
25  Foam::multiComponentMixture
26 
27 Description
28  Foam::multiComponentMixture
29 
30 SourceFiles
31  multiComponentMixture.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef multiComponentMixture_H
36 #define multiComponentMixture_H
37 
39 #include <OpenFOAM/HashPtrTable.H>
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class multiComponentMixture Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 template<class ThermoType>
52 :
54 {
55  // Private data
56 
57  //- Species data
58  PtrList<ThermoType> speciesData_;
59 
60  //- Temporary storage for the cell/face mixture thermo data
61  mutable ThermoType mixture_;
62 
63 
64  // Private member functions
65 
66  //- Construct the species data from the given dictionary and return the
67  // data for the first specie to initialise the mixture thermo data
68  const ThermoType& constructSpeciesData(const dictionary& thermoDict);
69 
70  //- Correct the mass fractions to sum to 1
71  void correctMassFractions();
72 
73  //- Construct as copy (not implemented)
75 
76 
77 public:
78 
79  //- The type of thermodynamics this mixture is instantiated for
81 
82 
83  // Constructors
84 
85  //- Construct from dictionary, specie names, thermo database and mesh
87  (
88  const dictionary&,
89  const wordList& specieNames,
90  const HashPtrTable<ThermoType>& specieThermoData,
91  const fvMesh&
92  );
93 
94  //- Construct from dictionary and mesh
95  multiComponentMixture(const dictionary&, const fvMesh&);
96 
97 
98  //- Destructor
100  {}
101 
102 
103  // Member functions
104 
105  const ThermoType& cellMixture(const label celli) const;
106 
108  (
109  const label patchi,
110  const label facei
111  ) const;
112 
113  //- Return the raw specie thermodynamic data
115  {
116  return speciesData_;
117  }
118 
119  //- Read dictionary
120  void read(const dictionary&);
121 };
122 
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 } // End namespace Foam
127 
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 
130 #ifdef NoRepository
132 #endif
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 #endif
137 
138 // ************************ vim: set sw=4 sts=4 et: ************************ //