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

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