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

homogeneousMixture.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::homogeneousMixture
00027 
00028 Description
00029     Foam::homogeneousMixture
00030 
00031 SourceFiles
00032     homogeneousMixture.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef homogeneousMixture_H
00037 #define homogeneousMixture_H
00038 
00039 #include "basicMultiComponentMixture.H"
00040 
00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00042 
00043 namespace Foam
00044 {
00045 
00046 /*---------------------------------------------------------------------------*\
00047                      Class homogeneousMixture Declaration
00048 \*---------------------------------------------------------------------------*/
00049 
00050 template<class ThermoType>
00051 class homogeneousMixture
00052 :
00053     public basicMultiComponentMixture
00054 {
00055     // Private data
00056 
00057         static const int nSpecies_ = 1;
00058         static const char* specieNames_[1];
00059 
00060         ThermoType reactants_;
00061         ThermoType products_;
00062 
00063         mutable ThermoType mixture_;
00064 
00065         //- Construct as copy (not implemented)
00066         homogeneousMixture(const homogeneousMixture<ThermoType>&);
00067 
00068         //- Regress variable
00069         volScalarField& b_;
00070 
00071 
00072 public:
00073 
00074     //- The type of thermodynamics this mixture is instantiated for
00075     typedef ThermoType thermoType;
00076 
00077 
00078     // Constructors
00079 
00080         //- Construct from dictionary and mesh
00081         homogeneousMixture(const dictionary&, const fvMesh&);
00082 
00083 
00084     //- Destructor
00085     virtual ~homogeneousMixture()
00086     {}
00087 
00088 
00089     // Member functions
00090 
00091         const ThermoType& mixture(const scalar) const;
00092 
00093         const ThermoType& cellMixture(const label celli) const
00094         {
00095             return mixture(b_[celli]);
00096         }
00097 
00098         const ThermoType& patchFaceMixture
00099         (
00100             const label patchi,
00101             const label facei
00102         ) const
00103         {
00104             return mixture(b_.boundaryField()[patchi][facei]);
00105         }
00106 
00107         const ThermoType& cellReactants(const label) const
00108         {
00109             return reactants_;
00110         }
00111 
00112         const ThermoType& patchFaceReactants(const label, const label) const
00113         {
00114             return reactants_;
00115         }
00116 
00117         const ThermoType& cellProducts(const label) const
00118         {
00119             return products_;
00120         }
00121 
00122         const ThermoType& patchFaceProducts(const label, const label) const
00123         {
00124             return products_;
00125         }
00126 
00127         //- Read dictionary
00128         void read(const dictionary&);
00129 };
00130 
00131 
00132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00133 
00134 } // End namespace Foam
00135 
00136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
00137 
00138 #ifdef NoRepository
00139 #   include "homogeneousMixture.C"
00140 #endif
00141 
00142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00143 
00144 #endif
00145 
00146 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd