FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::inhomogeneousMixture
00026 
00027 Description
00028     Foam::inhomogeneousMixture
00029 
00030 SourceFiles
00031     inhomogeneousMixture.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef inhomogeneousMixture_H
00036 #define inhomogeneousMixture_H
00037 
00038 #include <reactionThermophysicalModels/basicMultiComponentMixture.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 basicMultiComponentMixture
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     //- Destructor
00090     virtual ~inhomogeneousMixture()
00091     {}
00092 
00093 
00094     // Member functions
00095 
00096         const dimensionedScalar& stoicRatio() const
00097         {
00098             return stoicRatio_;
00099         }
00100 
00101         const ThermoType& mixture(const scalar, const scalar) const;
00102 
00103         const ThermoType& cellMixture(const label celli) const
00104         {
00105             return mixture(ft_[celli], b_[celli]);
00106         }
00107 
00108         const ThermoType& patchFaceMixture
00109         (
00110             const label patchi,
00111             const label facei
00112         ) const
00113         {
00114             return mixture
00115             (
00116                 ft_.boundaryField()[patchi][facei],
00117                 b_.boundaryField()[patchi][facei]
00118             );
00119         }
00120 
00121         const ThermoType& cellReactants(const label celli) const
00122         {
00123             return mixture(ft_[celli], 1);
00124         }
00125 
00126         const ThermoType& patchFaceReactants
00127         (
00128             const label patchi,
00129             const label facei
00130         ) const
00131         {
00132             return mixture
00133             (
00134                 ft_.boundaryField()[patchi][facei],
00135                 1
00136             );
00137         }
00138 
00139         const ThermoType& cellProducts(const label celli) const
00140         {
00141             return mixture(ft_[celli], 0);
00142         }
00143 
00144         const ThermoType& patchFaceProducts
00145         (
00146             const label patchi,
00147             const label facei
00148         ) const
00149         {
00150             return mixture
00151             (
00152                 ft_.boundaryField()[patchi][facei],
00153                 0
00154             );
00155         }
00156 
00157         //- Read dictionary
00158         void read(const dictionary&);
00159 };
00160 
00161 
00162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00163 
00164 } // End namespace Foam
00165 
00166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
00167 
00168 #ifdef NoRepository
00169 #   include <reactionThermophysicalModels/inhomogeneousMixture.C>
00170 #endif
00171 
00172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00173 
00174 #endif
00175 
00176 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines