FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

NonEquilibriumReversibleReaction.C

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software: you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
00023 
00024 Description
00025     
00026 \*---------------------------------------------------------------------------*/
00027 
00028 #include <specie/NonEquilibriumReversibleReaction.H>
00029 
00030 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00031 
00032 namespace Foam
00033 {
00034 
00035 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00036 
00037 // Construct from components
00038 template<class ReactionThermo, class ReactionRate>
00039 NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::
00040 NonEquilibriumReversibleReaction
00041 (
00042     const Reaction<ReactionThermo>& reaction,
00043     const ReactionRate& forwardReactionRate,
00044     const ReactionRate& reverseReactionRate
00045 )
00046 :
00047     Reaction<ReactionThermo>(reaction),
00048     fk_(forwardReactionRate),
00049     rk_(reverseReactionRate)
00050 {}
00051 
00052 
00053 // Construct from components
00054 template<class ReactionThermo, class ReactionRate>
00055 NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::
00056 NonEquilibriumReversibleReaction
00057 (
00058     const speciesTable& species,
00059     const HashPtrTable<ReactionThermo>& thermoDatabase,
00060     Istream& is
00061 )
00062 :
00063     Reaction<ReactionThermo>(species, thermoDatabase, is),
00064     fk_(species, is),
00065     rk_(species, is)
00066 {}
00067 
00068 // Construct as copy given new speciesTable
00069 template<class ReactionThermo, class ReactionRate>
00070 NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::
00071 NonEquilibriumReversibleReaction
00072 (
00073     const NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>& nerr,
00074     const speciesTable& species
00075 )
00076 :
00077     Reaction<ReactionThermo>(nerr, species),
00078     fk_(nerr.fk_),
00079     rk_(nerr.rk_)
00080 {}
00081 
00082 
00083 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00084 
00085 template<class ReactionThermo, class ReactionRate>
00086 scalar NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::kf
00087 (
00088     const scalar T,
00089     const scalar p,
00090     const scalarField& c
00091 ) const
00092 {
00093     return fk_(T, p, c);
00094 }
00095 
00096 
00097 template<class ReactionThermo, class ReactionRate>
00098 scalar NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::kr
00099 (
00100     const scalar,
00101     const scalar T,
00102     const scalar p,
00103     const scalarField& c
00104 ) const
00105 {
00106     return rk_(T, p, c);
00107 }
00108 
00109 
00110 template<class ReactionThermo, class ReactionRate>
00111 scalar NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::kr
00112 (
00113     const scalar T,
00114     const scalar p,
00115     const scalarField& c
00116 ) const
00117 {
00118     return rk_(T, p, c);
00119 }
00120 
00121 
00122 template<class ReactionThermo, class ReactionRate>
00123 void NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::write
00124 (
00125     Ostream& os
00126 ) const
00127 {
00128     Reaction<ReactionThermo>::write(os);
00129     os  << token::SPACE << fk_ << token::SPACE << rk_;
00130 }
00131 
00132 
00133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00134 
00135 } // End namespace Foam
00136 
00137 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines