initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / thermophysicalModels / specie / reaction / Reactions / NonEquilibriumReversibleReaction / NonEquilibriumReversibleReaction.H
blob5b33d8c3d8fe474f98f11dbcd5dd82601f33163b
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
25 Class
26     Foam::NonEquilibriumReversibleReaction
28 Description
29     Simple extension of Reaction to handle reversible reactions using
30     equilibrium thermodynamics.
32 SourceFiles
33     NonEquilibriumReversibleReaction.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef NonEquilibriumReversibleReaction_H
38 #define NonEquilibriumReversibleReaction_H
40 #include "Reaction.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 namespace Foam
47 /*---------------------------------------------------------------------------*\
48                            Class NonEquilibriumReversibleReaction Declaration
49 \*---------------------------------------------------------------------------*/
51 template<class ReactionThermo, class ReactionRate>
52 class NonEquilibriumReversibleReaction
54     public Reaction<ReactionThermo>
56     // Private data
58         ReactionRate fk_;
59         ReactionRate rk_;
62     // Private Member Functions
64         //- Disallow default bitwise assignment
65         void operator=
66         (
67             const NonEquilibriumReversibleReaction
68                 <ReactionThermo, ReactionRate>&
69         );
72 public:
74     //- Runtime type information
75     TypeName("nonEquilibriumReversible");
78     // Constructors
80         //- Construct from components
81         NonEquilibriumReversibleReaction
82         (
83             const Reaction<ReactionThermo>& reaction,
84             const ReactionRate& forwardReactionRate,
85             const ReactionRate& reverseReactionRate
86         );
88         //- Construct as copy given new speciesTable
89         NonEquilibriumReversibleReaction
90         (
91             const NonEquilibriumReversibleReaction
92                 <ReactionThermo, ReactionRate>&,
93             const speciesTable& species
94         );
96         //- Construct from Istream
97         NonEquilibriumReversibleReaction
98         (
99             const speciesTable& species,
100             const HashPtrTable<ReactionThermo>& thermoDatabase,
101             Istream& is
102         );
104         //- Construct and return a clone
105         virtual autoPtr<Reaction<ReactionThermo> > clone() const
106         {
107             return autoPtr<Reaction<ReactionThermo> >
108             (
109                 new NonEquilibriumReversibleReaction
110                     <ReactionThermo, ReactionRate>(*this)
111             );
112         }
114         //- Construct and return a clone with new speciesTable
115         virtual autoPtr<Reaction<ReactionThermo> > clone
116         (
117             const speciesTable& species
118         ) const
119         {
120             return autoPtr<Reaction<ReactionThermo> >
121             (
122                 new NonEquilibriumReversibleReaction
123                     <ReactionThermo, ReactionRate>
124                     (*this, species)
125             );
126         }
129     // Destructor
131         virtual ~NonEquilibriumReversibleReaction()
132         {}
135     // Member Functions
137         // NonEquilibriumReversibleReaction rate coefficients
139             //- Forward rate constant
140             virtual scalar kf
141             (
142                 const scalar T,
143                 const scalar p,
144                 const scalarField& c
145             ) const;
147             //- Reverse rate constant from the given formard rate constant
148             virtual scalar kr
149             (
150                 const scalar kfwd,
151                 const scalar T,
152                 const scalar p,
153                 const scalarField& c
154             ) const;
156             //- Reverse rate constant.
157             //  Note this evaluates the forward rate constant and divides by the
158             //  equilibrium constant
159             virtual scalar kr
160             (
161                 const scalar T,
162                 const scalar p,
163                 const scalarField& c
164             ) const;
167         //- Write
168         virtual void write(Ostream&) const;
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 } // End namespace Foam
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 #ifdef NoRepository
179 #   include "NonEquilibriumReversibleReaction.C"
180 #endif
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 #endif
186 // ************************************************************************* //