FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

multiComponentMixture.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software: you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::multiComponentMixture
00026 
00027 Description
00028     Foam::multiComponentMixture
00029 
00030 SourceFiles
00031     multiComponentMixture.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef multiComponentMixture_H
00036 #define multiComponentMixture_H
00037 
00038 #include <reactionThermophysicalModels/basicMultiComponentMixture.H>
00039 #include <OpenFOAM/HashPtrTable.H>
00040 
00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00042 
00043 namespace Foam
00044 {
00045 
00046 /*---------------------------------------------------------------------------*\
00047                     Class multiComponentMixture Declaration
00048 \*---------------------------------------------------------------------------*/
00049 
00050 template<class ThermoType>
00051 class multiComponentMixture
00052 :
00053     public basicMultiComponentMixture
00054 {
00055     // Private data
00056 
00057         //- Species data
00058         PtrList<ThermoType> speciesData_;
00059 
00060         //- Temporary storage for the cell/face mixture thermo data
00061         mutable ThermoType mixture_;
00062 
00063 
00064     // Private member functions
00065 
00066         //- Construct the species data from the given dictionary and return the
00067         //  data for the first specie to initialise the mixture thermo data
00068         const ThermoType& constructSpeciesData(const dictionary& thermoDict);
00069 
00070         //- Correct the mass fractions to sum to 1
00071         void correctMassFractions();
00072 
00073         //- Construct as copy (not implemented)
00074         multiComponentMixture(const multiComponentMixture<ThermoType>&);
00075 
00076 
00077 public:
00078 
00079     //- The type of thermodynamics this mixture is instantiated for
00080     typedef ThermoType thermoType;
00081 
00082 
00083     // Constructors
00084 
00085         //- Construct from dictionary, specie names, thermo database and mesh
00086         multiComponentMixture
00087         (
00088             const dictionary&,
00089             const wordList& specieNames,
00090             const HashPtrTable<ThermoType>& specieThermoData,
00091             const fvMesh&
00092         );
00093 
00094         //- Construct from dictionary and mesh
00095         multiComponentMixture(const dictionary&, const fvMesh&);
00096 
00097 
00098     //- Destructor
00099     virtual ~multiComponentMixture()
00100     {}
00101 
00102 
00103     // Member functions
00104 
00105         const ThermoType& cellMixture(const label celli) const;
00106 
00107         const ThermoType& patchFaceMixture
00108         (
00109             const label patchi,
00110             const label facei
00111         ) const;
00112 
00113         //- Return the raw specie thermodynamic data
00114         const PtrList<ThermoType>& speciesData() const
00115         {
00116             return speciesData_;
00117         }
00118 
00119         //- Read dictionary
00120         void read(const dictionary&);
00121 };
00122 
00123 
00124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00125 
00126 } // End namespace Foam
00127 
00128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00129 
00130 #ifdef NoRepository
00131 #   include <reactionThermophysicalModels/multiComponentMixture.C>
00132 #endif
00133 
00134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00135 
00136 #endif
00137 
00138 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines