Initial commit for version 2.0.x patch release
[OpenFOAM-2.0.x.git] / src / thermophysicalModels / specie / reaction / Reactions / NonEquilibriumReversibleReaction / NonEquilibriumReversibleReaction.H
blob2e95af5ebe9b85cef61301a31efd08d74ea0afeb
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2004-2010 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
13     the Free Software Foundation, either version 3 of the License, or
14     (at your 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, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::NonEquilibriumReversibleReaction
27 Description
28     Simple extension of Reaction to handle reversible reactions using
29     equilibrium thermodynamics.
31 SourceFiles
32     NonEquilibriumReversibleReaction.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef NonEquilibriumReversibleReaction_H
37 #define NonEquilibriumReversibleReaction_H
39 #include "Reaction.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 namespace Foam
46 /*---------------------------------------------------------------------------*\
47              Class NonEquilibriumReversibleReaction Declaration
48 \*---------------------------------------------------------------------------*/
50 template<class ReactionThermo, class ReactionRate>
51 class NonEquilibriumReversibleReaction
53     public Reaction<ReactionThermo>
55     // Private data
57         ReactionRate fk_;
58         ReactionRate rk_;
61     // Private Member Functions
63         //- Disallow default bitwise assignment
64         void operator=
65         (
66             const NonEquilibriumReversibleReaction
67                 <ReactionThermo, ReactionRate>&
68         );
71 public:
73     //- Runtime type information
74     TypeName("nonEquilibriumReversible");
77     // Constructors
79         //- Construct from components
80         NonEquilibriumReversibleReaction
81         (
82             const Reaction<ReactionThermo>& reaction,
83             const ReactionRate& forwardReactionRate,
84             const ReactionRate& reverseReactionRate
85         );
87         //- Construct as copy given new speciesTable
88         NonEquilibriumReversibleReaction
89         (
90             const NonEquilibriumReversibleReaction
91                 <ReactionThermo, ReactionRate>&,
92             const speciesTable& species
93         );
95         //- Construct from Istream
96         NonEquilibriumReversibleReaction
97         (
98             const speciesTable& species,
99             const HashPtrTable<ReactionThermo>& thermoDatabase,
100             Istream& is
101         );
103         //- Construct from dictionary
104         NonEquilibriumReversibleReaction
105         (
106             const speciesTable& species,
107             const HashPtrTable<ReactionThermo>& thermoDatabase,
108             const dictionary& dict
109         );
111         //- Construct and return a clone
112         virtual autoPtr<Reaction<ReactionThermo> > clone() const
113         {
114             return autoPtr<Reaction<ReactionThermo> >
115             (
116                 new NonEquilibriumReversibleReaction
117                     <ReactionThermo, ReactionRate>(*this)
118             );
119         }
121         //- Construct and return a clone with new speciesTable
122         virtual autoPtr<Reaction<ReactionThermo> > clone
123         (
124             const speciesTable& species
125         ) const
126         {
127             return autoPtr<Reaction<ReactionThermo> >
128             (
129                 new NonEquilibriumReversibleReaction
130                     <ReactionThermo, ReactionRate>
131                     (*this, species)
132             );
133         }
136     //- Destructor
137     virtual ~NonEquilibriumReversibleReaction()
138     {}
141     // Member Functions
143         // NonEquilibriumReversibleReaction rate coefficients
145             //- Forward rate constant
146             virtual scalar kf
147             (
148                 const scalar T,
149                 const scalar p,
150                 const scalarField& c
151             ) const;
153             //- Reverse rate constant from the given formard rate constant
154             virtual scalar kr
155             (
156                 const scalar kfwd,
157                 const scalar T,
158                 const scalar p,
159                 const scalarField& c
160             ) const;
162             //- Reverse rate constant.
163             //  Note this evaluates the forward rate constant and divides by the
164             //  equilibrium constant
165             virtual scalar kr
166             (
167                 const scalar T,
168                 const scalar p,
169                 const scalarField& c
170             ) const;
173         //- Write
174         virtual void write(Ostream&) const;
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 } // End namespace Foam
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 #ifdef NoRepository
185 #   include "NonEquilibriumReversibleReaction.C"
186 #endif
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 #endif
192 // ************************************************************************* //