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

IrreversibleReaction.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/IrreversibleReaction.H>
00029 
00030 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00031 
00032 namespace Foam
00033 {
00034 
00035 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00036 
00037 // Construct from components
00038 template<class ReactionThermo, class ReactionRate>
00039 IrreversibleReaction<ReactionThermo, ReactionRate>::IrreversibleReaction
00040 (
00041     const Reaction<ReactionThermo>& reaction,
00042     const ReactionRate& k
00043 )
00044 :
00045     Reaction<ReactionThermo>(reaction),
00046     k_(k)
00047 {}
00048 
00049 
00050 // Construct from components
00051 template<class ReactionThermo, class ReactionRate>
00052 IrreversibleReaction<ReactionThermo, ReactionRate>::IrreversibleReaction
00053 (
00054     const speciesTable& species,
00055     const HashPtrTable<ReactionThermo>& thermoDatabase,
00056     Istream& is
00057 )
00058 :
00059     Reaction<ReactionThermo>(species, thermoDatabase, is),
00060     k_(species, is)
00061 {}
00062 
00063 
00064 // Construct as copy given new speciesTable
00065 template<class ReactionThermo, class ReactionRate>
00066 IrreversibleReaction<ReactionThermo, ReactionRate>::IrreversibleReaction
00067 (
00068     const IrreversibleReaction<ReactionThermo, ReactionRate>& irr,
00069     const speciesTable& species
00070 )
00071 :
00072     Reaction<ReactionThermo>(irr, species),
00073     k_(irr.k_)
00074 {}
00075 
00076 
00077 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00078 
00079 template<class ReactionThermo, class ReactionRate>
00080 scalar IrreversibleReaction<ReactionThermo, ReactionRate>::kf
00081 (
00082     const scalar T,
00083     const scalar p,
00084     const scalarField& c
00085 ) const
00086 {
00087     return k_(T, p, c);
00088 }
00089 
00090 
00091 template<class ReactionThermo, class ReactionRate>
00092 void IrreversibleReaction<ReactionThermo, ReactionRate>::write
00093 (
00094     Ostream& os
00095 ) const
00096 {
00097     Reaction<ReactionThermo>::write(os);
00098     os  << token::SPACE << k_;
00099 }
00100 
00101 
00102 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00103 
00104 } // End namespace Foam
00105 
00106 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines