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

veryInhomogeneousMixture.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::veryInhomogeneousMixture
00027 
00028 Description
00029     Foam::veryInhomogeneousMixture
00030 
00031 SourceFiles
00032     veryInhomogeneousMixture.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef veryInhomogeneousMixture_H
00037 #define veryInhomogeneousMixture_H
00038 
00039 #include "basicMultiComponentMixture.H"
00040 
00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00042 
00043 namespace Foam
00044 {
00045 
00046 /*---------------------------------------------------------------------------*\
00047                   Class veryInhomogeneousMixture Declaration
00048 \*---------------------------------------------------------------------------*/
00049 
00050 template<class ThermoType>
00051 class veryInhomogeneousMixture
00052 :
00053     public basicMultiComponentMixture
00054 {
00055     // Private data
00056 
00057         static const int nSpecies_ = 3;
00058         static const char* specieNames_[3];
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         //- Fuel mass fraction
00072         volScalarField& fu_;
00073 
00074         //- Regress variable
00075         volScalarField& b_;
00076 
00077         //- Construct as copy (not implemented)
00078         veryInhomogeneousMixture(const veryInhomogeneousMixture<ThermoType>&);
00079 
00080 
00081 public:
00082 
00083     //- The type of thermodynamics this mixture is instantiated for
00084     typedef ThermoType thermoType;
00085 
00086 
00087     // Constructors
00088 
00089         //- Construct from dictionary and mesh
00090         veryInhomogeneousMixture(const dictionary&, const fvMesh&);
00091 
00092 
00093     //- Destructor
00094     virtual ~veryInhomogeneousMixture()
00095     {}
00096 
00097 
00098     // Member functions
00099 
00100         const dimensionedScalar& stoicRatio() const
00101         {
00102             return stoicRatio_;
00103         }
00104 
00105         const ThermoType& mixture(const scalar, const scalar) const;
00106 
00107         const ThermoType& cellMixture(const label celli) const
00108         {
00109             return mixture(ft_[celli], fu_[celli]);
00110         }
00111 
00112         const ThermoType& patchFaceMixture
00113         (
00114             const label patchi,
00115             const label facei
00116         ) const
00117         {
00118             return mixture
00119             (
00120                 ft_.boundaryField()[patchi][facei],
00121                 fu_.boundaryField()[patchi][facei]
00122             );
00123         }
00124 
00125         const ThermoType& cellReactants(const label celli) const
00126         {
00127             return mixture(ft_[celli], ft_[celli]);
00128         }
00129 
00130         const ThermoType& patchFaceReactants
00131         (
00132             const label patchi,
00133             const label facei
00134         ) const
00135         {
00136             return mixture
00137             (
00138                 ft_.boundaryField()[patchi][facei],
00139                 ft_.boundaryField()[patchi][facei]
00140             );
00141         }
00142 
00143         const ThermoType& cellProducts(const label celli) const
00144         {
00145             scalar ft = ft_[celli];
00146             return mixture(ft, fres(ft, stoicRatio().value()));
00147         }
00148 
00149         const ThermoType& patchFaceProducts
00150         (
00151             const label patchi,
00152             const label facei
00153         ) const
00154         {
00155             scalar ft = ft_.boundaryField()[patchi][facei];
00156             return mixture(ft, fres(ft, stoicRatio().value()));
00157         }
00158 
00159         //- Read dictionary
00160         void read(const dictionary&);
00161 };
00162 
00163 
00164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00165 
00166 } // End namespace Foam
00167 
00168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
00169 
00170 #ifdef NoRepository
00171 #   include "veryInhomogeneousMixture.C"
00172 #endif
00173 
00174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00175 
00176 #endif
00177 
00178 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd