OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

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-2009 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 the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     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, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     Foam::multiComponentMixture
00027 
00028 Description
00029     Foam::multiComponentMixture
00030 
00031 SourceFiles
00032     multiComponentMixture.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef multiComponentMixture_H
00037 #define multiComponentMixture_H
00038 
00039 #include "basicMultiComponentMixture.H"
00040 #include "HashPtrTable.H"
00041 
00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00043 
00044 namespace Foam
00045 {
00046 
00047 /*---------------------------------------------------------------------------*\
00048                     Class multiComponentMixture Declaration
00049 \*---------------------------------------------------------------------------*/
00050 
00051 template<class ThermoType>
00052 class multiComponentMixture
00053 :
00054     public basicMultiComponentMixture
00055 {
00056     // Private data
00057 
00058         //- Species data
00059         PtrList<ThermoType> speciesData_;
00060 
00061         //- Temporary storage for the cell/face mixture thermo data
00062         mutable ThermoType mixture_;
00063 
00064 
00065     // Private member functions
00066 
00067         //- Construct the species data from the given dictionary and return the
00068         //  data for the first specie to initialise the mixture thermo data
00069         const ThermoType& constructSpeciesData(const dictionary& thermoDict);
00070 
00071         //- Correct the mass fractions to sum to 1
00072         void correctMassFractions();
00073 
00074         //- Construct as copy (not implemented)
00075         multiComponentMixture(const multiComponentMixture<ThermoType>&);
00076 
00077 
00078 public:
00079 
00080     //- The type of thermodynamics this mixture is instantiated for
00081     typedef ThermoType thermoType;
00082 
00083 
00084     // Constructors
00085 
00086         //- Construct from dictionary, specie names, thermo database and mesh
00087         multiComponentMixture
00088         (
00089             const dictionary&,
00090             const wordList& specieNames,
00091             const HashPtrTable<ThermoType>& specieThermoData,
00092             const fvMesh&
00093         );
00094 
00095         //- Construct from dictionary and mesh
00096         multiComponentMixture(const dictionary&, const fvMesh&);
00097 
00098 
00099     //- Destructor
00100     virtual ~multiComponentMixture()
00101     {}
00102 
00103 
00104     // Member functions
00105 
00106         const ThermoType& cellMixture(const label celli) const;
00107 
00108         const ThermoType& patchFaceMixture
00109         (
00110             const label patchi,
00111             const label facei
00112         ) const;
00113 
00114         //- Return the raw specie thermodynamic data
00115         const PtrList<ThermoType>& speciesData() const
00116         {
00117             return speciesData_;
00118         }
00119 
00120         //- Read dictionary
00121         void read(const dictionary&);
00122 };
00123 
00124 
00125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00126 
00127 } // End namespace Foam
00128 
00129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00130 
00131 #ifdef NoRepository
00132 #   include "multiComponentMixture.C"
00133 #endif
00134 
00135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00136 
00137 #endif
00138 
00139 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd