Bugfix: Compressible solver update
[foam-extend-3.2.git] / src / thermophysicalModels / specie / reaction / Reactions / NonEquilibriumReversibleReaction / NonEquilibriumReversibleReaction.H
blob2960b2f584b8f424b8825f36aa1705f0ac988fc0
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     | Version:     3.2
5     \\  /    A nd           | Web:         http://www.foam-extend.org
6      \\/     M anipulation  | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9     This file is part of foam-extend.
11     foam-extend 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 3 of the License, or (at your
14     option) any later version.
16     foam-extend is distributed in the hope that it will be useful, but
17     WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19     General Public License for more details.
21     You should have received a copy of the GNU General Public License
22     along with foam-extend.  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 and return a clone
104         virtual autoPtr<Reaction<ReactionThermo> > clone() const
105         {
106             return autoPtr<Reaction<ReactionThermo> >
107             (
108                 new NonEquilibriumReversibleReaction
109                     <ReactionThermo, ReactionRate>(*this)
110             );
111         }
113         //- Construct and return a clone with new speciesTable
114         virtual autoPtr<Reaction<ReactionThermo> > clone
115         (
116             const speciesTable& species
117         ) const
118         {
119             return autoPtr<Reaction<ReactionThermo> >
120             (
121                 new NonEquilibriumReversibleReaction
122                     <ReactionThermo, ReactionRate>
123                     (*this, species)
124             );
125         }
128     // Destructor
130         virtual ~NonEquilibriumReversibleReaction()
131         {}
134     // Member Functions
136         // NonEquilibriumReversibleReaction rate coefficients
138             //- Forward rate constant
139             virtual scalar kf
140             (
141                 const scalar T,
142                 const scalar p,
143                 const scalarField& c
144             ) const;
146             //- Reverse rate constant from the given formard rate constant
147             virtual scalar kr
148             (
149                 const scalar kfwd,
150                 const scalar T,
151                 const scalar p,
152                 const scalarField& c
153             ) const;
155             //- Reverse rate constant.
156             //  Note this evaluates the forward rate constant and divides by the
157             //  equilibrium constant
158             virtual scalar kr
159             (
160                 const scalar T,
161                 const scalar p,
162                 const scalarField& c
163             ) const;
166         //- Write
167         virtual void write(Ostream&) const;
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 } // End namespace Foam
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 #ifdef NoRepository
178 #   include "NonEquilibriumReversibleReaction.C"
179 #endif
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 #endif
185 // ************************************************************************* //