initial commit for version 1.5.x patch release
[OpenFOAM-1.5.x.git] / src / thermophysicalModels / specie / reaction / Reactions / IrreversibleReaction / IrreversibleReaction.H
blob6d6ef63448666baa5d28952d4d0467c96faf8708
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2008 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::IrreversibleReaction
28 Description
29     Simple extension of Reaction to handle reversible reactions using
30     equilibrium thermodynamics.
32 SourceFiles
33     IrreversibleReaction.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef IrreversibleReaction_H
38 #define IrreversibleReaction_H
40 #include "Reaction.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 namespace Foam
47 /*---------------------------------------------------------------------------*\
48                            Class IrreversibleReaction Declaration
49 \*---------------------------------------------------------------------------*/
51 template<class ReactionThermo, class ReactionRate>
52 class IrreversibleReaction
54     public Reaction<ReactionThermo>
56     // Private data
58         ReactionRate k_;
61     // Private Member Functions
63         //- Disallow default bitwise assignment
64         void operator=
65         (
66             const IrreversibleReaction<ReactionThermo, ReactionRate>&
67         );
70 public:
72     //- Runtime type information
73     TypeName("irreversible");
76     // Constructors
78         //- Construct from components
79         IrreversibleReaction
80         (
81             const Reaction<ReactionThermo>& reaction,
82             const ReactionRate& reactionRate
83         );
85         //- Construct as copy given new speciesTable
86         IrreversibleReaction
87         (
88             const IrreversibleReaction<ReactionThermo, ReactionRate>&,
89             const speciesTable& species
90         );
92         //- Construct from Istream
93         IrreversibleReaction
94         (
95             const speciesTable& species,
96             const HashPtrTable<ReactionThermo>& thermoDatabase,
97             Istream& is
98         );
100         //- Construct and return a clone
101         virtual autoPtr<Reaction<ReactionThermo> > clone() const
102         {
103             return autoPtr<Reaction<ReactionThermo> >
104             (
105                 new IrreversibleReaction<ReactionThermo, ReactionRate>(*this)
106             );
107         }
109         //- Construct and return a clone with new speciesTable
110         virtual autoPtr<Reaction<ReactionThermo> > clone
111         (
112             const speciesTable& species
113         ) const
114         {
115             return autoPtr<Reaction<ReactionThermo> >
116             (
117                 new IrreversibleReaction<ReactionThermo, ReactionRate>
118                 (
119                     *this,
120                     species
121                 )
122             );
123         }
126     // Destructor
128         virtual ~IrreversibleReaction()
129         {}
132     // Member Functions
134         // IrreversibleReaction rate coefficients
136             //- Forward rate constant
137             virtual scalar kf
138             (
139                 const scalar T,
140                 const scalar p,
141                 const scalarField& c
142             ) const;
145         //- Write
146         virtual void write(Ostream&) const;
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 } // End namespace Foam
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 #ifdef NoRepository
157 #   include "IrreversibleReaction.C"
158 #endif
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 #endif
164 // ************************************************************************* //