OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

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-2009 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 the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     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, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Description
00026     
00027 \*---------------------------------------------------------------------------*/
00028 
00029 #include "NonEquilibriumReversibleReaction.H"
00030 
00031 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00032 
00033 namespace Foam
00034 {
00035 
00036 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00037 
00038 // Construct from components
00039 template<class ReactionThermo, class ReactionRate>
00040 NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::
00041 NonEquilibriumReversibleReaction
00042 (
00043     const Reaction<ReactionThermo>& reaction,
00044     const ReactionRate& forwardReactionRate,
00045     const ReactionRate& reverseReactionRate
00046 )
00047 :
00048     Reaction<ReactionThermo>(reaction),
00049     fk_(forwardReactionRate),
00050     rk_(reverseReactionRate)
00051 {}
00052 
00053 
00054 // Construct from components
00055 template<class ReactionThermo, class ReactionRate>
00056 NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::
00057 NonEquilibriumReversibleReaction
00058 (
00059     const speciesTable& species,
00060     const HashPtrTable<ReactionThermo>& thermoDatabase,
00061     Istream& is
00062 )
00063 :
00064     Reaction<ReactionThermo>(species, thermoDatabase, is),
00065     fk_(species, is),
00066     rk_(species, is)
00067 {}
00068 
00069 // Construct as copy given new speciesTable
00070 template<class ReactionThermo, class ReactionRate>
00071 NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::
00072 NonEquilibriumReversibleReaction
00073 (
00074     const NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>& nerr,
00075     const speciesTable& species
00076 )
00077 :
00078     Reaction<ReactionThermo>(nerr, species),
00079     fk_(nerr.fk_),
00080     rk_(nerr.rk_)
00081 {}
00082 
00083 
00084 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00085 
00086 template<class ReactionThermo, class ReactionRate>
00087 scalar NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::kf
00088 (
00089     const scalar T,
00090     const scalar p,
00091     const scalarField& c
00092 ) const
00093 {
00094     return fk_(T, p, c);
00095 }
00096 
00097 
00098 template<class ReactionThermo, class ReactionRate>
00099 scalar NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::kr
00100 (
00101     const scalar,
00102     const scalar T,
00103     const scalar p,
00104     const scalarField& c
00105 ) const
00106 {
00107     return rk_(T, p, c);
00108 }
00109 
00110 
00111 template<class ReactionThermo, class ReactionRate>
00112 scalar NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::kr
00113 (
00114     const scalar T,
00115     const scalar p,
00116     const scalarField& c
00117 ) const
00118 {
00119     return rk_(T, p, c);
00120 }
00121 
00122 
00123 template<class ReactionThermo, class ReactionRate>
00124 void NonEquilibriumReversibleReaction<ReactionThermo, ReactionRate>::write
00125 (
00126     Ostream& os
00127 ) const
00128 {
00129     Reaction<ReactionThermo>::write(os);
00130     os  << token::SPACE << fk_ << token::SPACE << rk_;
00131 }
00132 
00133 
00134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00135 
00136 } // End namespace Foam
00137 
00138 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd