OpenFOAM logo
Open Source CFD Toolkit

inhomogeneousMixture.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-2005 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     inhomogeneousMixture
00027 
00028 Description
00029 
00030 SourceFiles
00031     inhomogeneousMixture.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef inhomogeneousMixture_H
00036 #define inhomogeneousMixture_H
00037 
00038 #include "combustionMixture.H"
00039 
00040 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00041 
00042 namespace Foam
00043 {
00044 
00045 /*---------------------------------------------------------------------------*\
00046                            Class inhomogeneousMixture Declaration
00047 \*---------------------------------------------------------------------------*/
00048 
00049 template<class ThermoType>
00050 class inhomogeneousMixture
00051 :
00052     public combustionMixture
00053 {
00054     // Private data
00055 
00056         static const int nSpecies_ = 2;
00057         static const char* specieNames_[2];
00058 
00059         dimensionedScalar stoicRatio_;
00060 
00061         ThermoType fuel_;
00062         ThermoType oxidant_;
00063         ThermoType products_;
00064 
00065         mutable ThermoType mixture_;
00066 
00067         //- Mixture fraction
00068         volScalarField& ft_;
00069 
00070         //- Regress variable
00071         volScalarField& b_;
00072 
00073         //- Construct as copy (not implemented)
00074         inhomogeneousMixture(const inhomogeneousMixture<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 and mesh
00086         inhomogeneousMixture(const dictionary&, const fvMesh&);
00087 
00088 
00089     // Member functions
00090 
00091         const dimensionedScalar& stoicRatio() const
00092         {
00093             return stoicRatio_;
00094         }
00095 
00096         const ThermoType& mixture(const scalar, const scalar) const;
00097 
00098         const ThermoType& cellMixture(const label celli) const
00099         {
00100             return mixture(ft_[celli], b_[celli]);
00101         }
00102 
00103         const ThermoType& patchFaceMixture
00104         (
00105             const label patchi,
00106             const label facei
00107         ) const
00108         {
00109             return mixture
00110             (
00111                 ft_.boundaryField()[patchi][facei],
00112                 b_.boundaryField()[patchi][facei]
00113             );
00114         }
00115 
00116         const ThermoType& cellReactants(const label celli) const
00117         {
00118             return mixture(ft_[celli], 1);
00119         }
00120 
00121         const ThermoType& patchFaceReactants
00122         (
00123             const label patchi,
00124             const label facei
00125         ) const
00126         {
00127             return mixture
00128             (
00129                 ft_.boundaryField()[patchi][facei],
00130                 1
00131             );
00132         }
00133 
00134         const ThermoType& cellProducts(const label celli) const
00135         {
00136             return mixture(ft_[celli], 0);
00137         }
00138 
00139         const ThermoType& patchFaceProducts
00140         (
00141             const label patchi,
00142             const label facei
00143         ) const
00144         {
00145             return mixture
00146             (
00147                 ft_.boundaryField()[patchi][facei],
00148                 0
00149             );
00150         }
00151 
00152         //- Read dictionary
00153         void read(const dictionary&);
00154 };
00155 
00156 
00157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00158 
00159 } // End namespace Foam
00160 
00161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
00162 
00163 #ifdef NoRepository
00164 #   include "inhomogeneousMixture.C"
00165 #endif
00166 
00167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00168 
00169 #endif
00170 
00171 // ************************************************************************* //
For further information go to www.openfoam.org