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

ReversibleReaction.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::ReversibleReaction
00026 
00027 Description
00028     Simple extension of Reaction to handle reversible reactions using
00029     equilibrium thermodynamics.
00030 
00031 SourceFiles
00032     ReversibleReaction.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef ReversibleReaction_H
00037 #define ReversibleReaction_H
00038 
00039 #include <specie/Reaction.H>
00040 
00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00042 
00043 namespace Foam
00044 {
00045 
00046 /*---------------------------------------------------------------------------*\
00047                            Class ReversibleReaction Declaration
00048 \*---------------------------------------------------------------------------*/
00049 
00050 template<class ReactionThermo, class ReactionRate>
00051 class ReversibleReaction
00052 :
00053     public Reaction<ReactionThermo>
00054 {
00055     // Private data
00056 
00057         ReactionRate k_;
00058 
00059 
00060     // Private Member Functions
00061 
00062         //- Disallow default bitwise assignment
00063         void operator=(const ReversibleReaction<ReactionThermo, ReactionRate>&);
00064 
00065 
00066 public:
00067 
00068     //- Runtime type information
00069     TypeName("reversible");
00070 
00071 
00072     // Constructors
00073 
00074         //- Construct from components
00075         ReversibleReaction
00076         (
00077             const Reaction<ReactionThermo>& reaction,
00078             const ReactionRate& k
00079         );
00080 
00081         //- Construct as copy given new speciesTable
00082         ReversibleReaction
00083         (
00084             const ReversibleReaction<ReactionThermo, ReactionRate>&,
00085             const speciesTable& species
00086         );
00087 
00088         //- Construct from Istream
00089         ReversibleReaction
00090         (
00091             const speciesTable& species,
00092             const HashPtrTable<ReactionThermo>& thermoDatabase,
00093             Istream& is
00094         );
00095 
00096         //- Construct and return a clone
00097         virtual autoPtr<Reaction<ReactionThermo> > clone() const
00098         {
00099             return autoPtr<Reaction<ReactionThermo> >
00100             (
00101                 new ReversibleReaction<ReactionThermo, ReactionRate>(*this)
00102             );
00103         }
00104 
00105         //- Construct and return a clone with new speciesTable
00106         virtual autoPtr<Reaction<ReactionThermo> > clone
00107         (
00108             const speciesTable& species
00109         ) const
00110         {
00111             return autoPtr<Reaction<ReactionThermo> >
00112             (
00113                 new ReversibleReaction<ReactionThermo, ReactionRate>
00114                 (
00115                     *this,
00116                     species
00117                 )
00118             );
00119         }
00120 
00121 
00122     // Destructor
00123 
00124         virtual ~ReversibleReaction()
00125         {}
00126 
00127 
00128     // Member Functions
00129 
00130         // ReversibleReaction rate coefficients
00131 
00132             //- Forward rate constant
00133             virtual scalar kf
00134             (
00135                 const scalar T,
00136                 const scalar p,
00137                 const scalarField& c
00138             ) const;
00139 
00140             //- Reverse rate constant from the given formard rate constant
00141             virtual scalar kr
00142             (
00143                 const scalar kfwd,
00144                 const scalar T,
00145                 const scalar p,
00146                 const scalarField& c
00147             ) const;
00148 
00149             //- Reverse rate constant.
00150             //  Note this evaluates the forward rate constant and divides by the
00151             //  equilibrium constant
00152             virtual scalar kr
00153             (
00154                 const scalar T,
00155                 const scalar p,
00156                 const scalarField& c
00157             ) const;
00158 
00159 
00160         //- Write
00161         virtual void write(Ostream&) const;
00162 };
00163 
00164 
00165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00166 
00167 } // End namespace Foam
00168 
00169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00170 
00171 #ifdef NoRepository
00172 #   include <specie/ReversibleReaction.C>
00173 #endif
00174 
00175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00176 
00177 #endif
00178 
00179 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines