OpenFOAM logo
Open Source CFD Toolkit

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