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

dieselMixture.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::dieselMixture
00026 
00027 Description
00028     Foam::dieselMixture
00029 
00030 SourceFiles
00031     dieselMixture.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef dieselMixture_H
00036 #define dieselMixture_H
00037 
00038 #include <reactionThermophysicalModels/basicMultiComponentMixture.H>
00039 
00040 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00041 
00042 namespace Foam
00043 {
00044 
00045 /*---------------------------------------------------------------------------*\
00046                          Class dieselMixture Declaration
00047 \*---------------------------------------------------------------------------*/
00048 
00049 template<class ThermoType>
00050 class dieselMixture
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         volScalarField& ft_;
00068         volScalarField& fu_;
00069 
00070         //- Construct as copy (not implemented)
00071         dieselMixture(const dieselMixture<ThermoType>&);
00072 
00073 
00074 public:
00075 
00076     //- The type of thermodynamics this mixture is instantiated for
00077     typedef ThermoType thermoType;
00078 
00079 
00080     // Constructors
00081 
00082         //- Construct from dictionary and mesh
00083         dieselMixture(const dictionary&, const fvMesh&);
00084 
00085 
00086     //- Destructor
00087     virtual ~dieselMixture()
00088     {}
00089 
00090 
00091     // Member functions
00092 
00093         const dimensionedScalar& stoicRatio() const
00094         {
00095             return stoicRatio_;
00096         }
00097 
00098         const ThermoType& mixture(const scalar, const scalar) const;
00099 
00100         const ThermoType& cellMixture(const label celli) const
00101         {
00102             return mixture(ft_[celli], fu_[celli]);
00103         }
00104 
00105         const ThermoType& patchFaceMixture
00106         (
00107             const label patchi,
00108             const label facei
00109         ) const
00110         {
00111             return mixture
00112             (
00113                 ft_.boundaryField()[patchi][facei],
00114                 fu_.boundaryField()[patchi][facei]
00115             );
00116         }
00117 
00118         const ThermoType& cellReactants(const label celli) const
00119         {
00120             return mixture(ft_[celli], ft_[celli]);
00121         }
00122 
00123         const ThermoType& patchFaceReactants
00124         (
00125             const label patchi,
00126             const label facei
00127         ) const
00128         {
00129             return mixture
00130             (
00131                 ft_.boundaryField()[patchi][facei],
00132                 ft_.boundaryField()[patchi][facei]
00133             );
00134         }
00135 
00136         const ThermoType& cellProducts(const label celli) const
00137         {
00138             scalar ft = ft_[celli];
00139             return mixture(ft, fres(ft, stoicRatio().value()));
00140         }
00141 
00142         const ThermoType& patchFaceProducts
00143         (
00144             const label patchi,
00145             const label facei
00146         ) const
00147         {
00148             scalar ft = ft_.boundaryField()[patchi][facei];
00149             return mixture(ft, fres(ft, stoicRatio().value()));
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 <reactionThermophysicalModels/dieselMixture.C>
00165 #endif
00166 
00167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00168 
00169 #endif
00170 
00171 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines