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

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