1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 Foam::ReversibleReaction
29 Simple extension of Reaction to handle reversible reactions using
30 equilibrium thermodynamics.
35 \*---------------------------------------------------------------------------*/
37 #ifndef ReversibleReaction_H
38 #define ReversibleReaction_H
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 /*---------------------------------------------------------------------------*\
48 Class ReversibleReaction Declaration
49 \*---------------------------------------------------------------------------*/
51 template<class ReactionThermo, class ReactionRate>
52 class ReversibleReaction
54 public Reaction<ReactionThermo>
61 // Private Member Functions
63 //- Disallow default bitwise assignment
64 void operator=(const ReversibleReaction<ReactionThermo, ReactionRate>&);
69 //- Runtime type information
70 TypeName("reversible");
75 //- Construct from components
78 const Reaction<ReactionThermo>& reaction,
82 //- Construct as copy given new speciesTable
85 const ReversibleReaction<ReactionThermo, ReactionRate>&,
86 const speciesTable& species
89 //- Construct from Istream
92 const speciesTable& species,
93 const HashPtrTable<ReactionThermo>& thermoDatabase,
97 //- Construct and return a clone
98 virtual autoPtr<Reaction<ReactionThermo> > clone() const
100 return autoPtr<Reaction<ReactionThermo> >
102 new ReversibleReaction<ReactionThermo, ReactionRate>(*this)
106 //- Construct and return a clone with new speciesTable
107 virtual autoPtr<Reaction<ReactionThermo> > clone
109 const speciesTable& species
112 return autoPtr<Reaction<ReactionThermo> >
114 new ReversibleReaction<ReactionThermo, ReactionRate>
125 virtual ~ReversibleReaction()
131 // ReversibleReaction rate coefficients
133 //- Forward rate constant
141 //- Reverse rate constant from the given formard rate constant
150 //- Reverse rate constant.
151 // Note this evaluates the forward rate constant and divides by the
152 // equilibrium constant
162 virtual void write(Ostream&) const;
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 } // End namespace Foam
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 # include "ReversibleReaction.C"
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 // ************************************************************************* //