initial commit for version 1.5.x patch release
[OpenFOAM-1.5.x.git] / src / lagrangian / intermediate / submodels / Reacting / CompositionModel / SingleMixtureFraction / SingleMixtureFraction.H
blobbd03d69456d0f86d63557a5841d7404954f34e84
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2008 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::SingleMixtureFraction
29 Description
30     Templated parcel single mixture fraction class
31     - Each phase sums to a mass fraction of 1
33 SourceFiles
34     SingleMixtureFraction.C
36 \*---------------------------------------------------------------------------*/
38 #ifndef SingleMixtureFraction_H
39 #define SingleMixtureFraction_H
41 #include "CompositionModel.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
48 /*---------------------------------------------------------------------------*\
49                       Class SingleMixtureFraction Declaration
50 \*---------------------------------------------------------------------------*/
52 template<class CloudType>
53 class SingleMixtureFraction
55     public CompositionModel<CloudType>
58     // Private data
60         //- Parcel properties
62             //- List of gas names
63             const wordList gasNames_;
65             //- Return local id of gas based on gasName
66             label gasLocalId(const word& gasName) const;
68             //- Return global id of gas based on gasName
69             label gasGlobalId(const word& gasName) const;
71             //- List of IDs of gases in global list
72             labelList gasGlobalIds_;
74             //- Initial mass fractions of gases
75             const scalarField YGas0_;
77             //- Initial total mass fractions of gases
78             const scalar YGasTot0_;
80             //- List of liquid names
81             const wordList liquidNames_;
83             //- Return local id of liquid based on liquidName
84             label liquidLocalId(const word& liquidName) const;
86             //- Return global id of liquid based on liquidName
87             label liquidGlobalId(const word& liquidName) const;
89             //- List of IDs of liquids in global list
90             labelList liquidGlobalIds_;
92             //- Initial mass fractions of liquids
93             const scalarField YLiquid0_;
95             //- Initial total mass fractions of liquids
96             const scalar YLiquidTot0_;
98             //- List of solids species
99             const wordList solidNames_;
101             //- Return local id of solid based on solidName
102             label solidLocalId(const word& solidName) const;
104             //- Return global id of solid based on solidName
105             label solidGlobalId(const word& solidName) const;
107             //- List of IDs of solids in global list
108             labelList solidGlobalIds_;
110             //- Initial mass fractions of solids
111             const scalarField YSolid0_;
113             //- Initial total mass fractions of solids
114             const scalar YSolidTot0_;
116             //- Initial total mass fractions of the mixture
117             //  Index 0 = gas, 1 = liquid, 2 = solid
118             scalarField YMixture0_;
121 public:
123     //- Runtime type information
124     TypeName("SingleMixtureFraction");
127     // Constructors
129         //- Construct from dictionary
130         SingleMixtureFraction
131         (
132             const dictionary& dict,
133             CloudType& owner
134         );
137     // Destructor
139         virtual ~SingleMixtureFraction();
142     // Member Functions
144         // Access
146             //- Return the list of composition names
147             const wordList compositionNames() const;
149             //- Return the list of gas names
150             const wordList& gasNames() const;
152             //- Return the list indices of gases in global thermo list
153             const labelList& gasGlobalIds() const;
155             //- Return the list of gas mass fractions
156             const scalarField& YGas0() const;
158             //- Return the total gas mass fraction
159             scalar YGasTot0() const;
161             //- Return the list of liquid names
162             const wordList& liquidNames() const;
164             //- Return the list indices of liquid in global thermo list
165             const labelList& liquidGlobalIds() const;
167             //- Return the list of liquid mass fractions
168             const scalarField& YLiquid0() const;
170             //- Return the total liquid mass fraction
171             scalar YLiquidTot0() const;
173              //- Return the list of solid names
174             const wordList& solidNames() const;
176             //- Return the list indices of solids in global thermo list
177             const labelList& solidGlobalIds() const;
179             //- Return the list of solid mass fractions
180             const scalarField& YSolid0() const;
182             //- Return the total solid mass fraction
183             scalar YSolidTot0() const;
185             //- Return the list of mixture mass fractions
186             const scalarField& YMixture0() const;
188             //- Return the gas constant for the gas mixture
189             scalar RGas(const scalarField& YGas) const;
191             //- Return enthalpy for the gas mixture
192             scalar HGas(const scalarField& YGas, const scalar T) const;
194             //- Return specific heat caparcity for the gas mixture
195             scalar cpGas(const scalarField& YGas, const scalar T) const;
197             //- Return specific heat caparcity for the liquid mixture
198             scalar cpLiquid
199             (
200                 const scalarField& YLiquid,
201                 const scalar p,
202                 const scalar T
203             ) const;
205             //- Return specific heat caparcity for the solid mixture
206             scalar cpSolid(const scalarField& YSolid) const;
210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 #ifdef NoRepository
213 #   include "SingleMixtureFraction.C"
214 #endif
216 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218 } // End namespace Foam
220 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
222 #endif
224 // ************************************************************************* //