OpenFOAM logo
Open Source CFD Toolkit

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