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

makeReactionThermo.H

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 InClass
00025     Foam::makeReactionThermo
00026 
00027 Description
00028     Macros for instantiating reactions on given thermo packages
00029 
00030 \*---------------------------------------------------------------------------*/
00031 
00032 #ifndef makeReactionThermo_H
00033 #define makeReactionThermo_H
00034 
00035 #include <specie/Reaction.H>
00036 
00037 #include <specie/IrreversibleReaction.H>
00038 #include <specie/ReversibleReaction.H>
00039 #include <specie/NonEquilibriumReversibleReaction.H>
00040 
00041 #include <specie/specieThermo.H>
00042 
00043 #include <specie/sutherlandTransport.H>
00044 #include <specie/janafThermo.H>
00045 #include <specie/perfectGas.H>
00046 
00047 #include <specie/polynomialTransport.H>
00048 #include <specie/hPolynomialThermo.H>
00049 #include <specie/icoPolynomial.H>
00050 
00051 #include <OpenFOAM/addToRunTimeSelectionTable.H>
00052 
00053 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00054 
00055 namespace Foam
00056 {
00057 
00058 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00059 
00060 #define makeReaction(Thermo, ReactionType, ReactionRate)                      \
00061                                                                               \
00062     typedef Reaction<Thermo> Reaction##Thermo;                                \
00063                                                                               \
00064     typedef ReactionType<Thermo, ReactionRate>                                \
00065         ReactionType##Thermo##ReactionRate;                                   \
00066                                                                               \
00067     template<>                                                                \
00068     const word ReactionType##Thermo##ReactionRate::typeName                   \
00069     (                                                                         \
00070         ReactionType::typeName_()                                             \
00071       + ReactionRate::type()                                                  \
00072       + Reaction##Thermo::typeName_()                                 \
00073     );                                                                        \
00074                                                                               \
00075     addToRunTimeSelectionTable                                                \
00076     (                                                                         \
00077         Reaction##Thermo,                                                     \
00078         ReactionType##Thermo##ReactionRate,                                   \
00079         Istream                                                               \
00080     );
00081 
00082 
00083 #define makePressureDependentReaction(Thermo, Reaction, PressureDependentReactionRate, ReactionRate, FallOffFunction) \
00084                                                                               \
00085     typedef PressureDependentReactionRate<ReactionRate, FallOffFunction>      \
00086         PressureDependentReactionRate##ReactionRate##FallOffFunction;         \
00087                                                                               \
00088     makeReaction                                                              \
00089     (                                                                         \
00090         Thermo,                                                               \
00091         Reaction,                                                             \
00092         PressureDependentReactionRate##ReactionRate##FallOffFunction          \
00093     )
00094 
00095 
00096 #define makeIRReactions(Thermo, ReactionRate)                                 \
00097                                                                               \
00098     makeReaction(Thermo, IrreversibleReaction, ReactionRate)                  \
00099                                                                               \
00100     makeReaction(Thermo, ReversibleReaction, ReactionRate)
00101 
00102 
00103 #define makeIRNReactions(Thermo, ReactionRate)                                \
00104                                                                               \
00105     makeIRReactions(Thermo, ReactionRate)                                     \
00106                                                                               \
00107     makeReaction(Thermo, NonEquilibriumReversibleReaction, ReactionRate)
00108 
00109 
00110 #define makePressureDependentReactions(Thermo, ReactionRate, FallOffFunction) \
00111                                                                               \
00112     makePressureDependentReaction                                             \
00113     (                                                                         \
00114         Thermo,                                                               \
00115         IrreversibleReaction,                                                 \
00116         FallOffReactionRate,                                                  \
00117         ReactionRate,                                                         \
00118         FallOffFunction                                                       \
00119     )                                                                         \
00120                                                                               \
00121     makePressureDependentReaction                                             \
00122     (                                                                         \
00123         Thermo,                                                               \
00124         ReversibleReaction,                                                   \
00125         FallOffReactionRate,                                                  \
00126         ReactionRate,                                                         \
00127         FallOffFunction                                                       \
00128     )                                                                         \
00129                                                                               \
00130     makePressureDependentReaction                                             \
00131     (                                                                         \
00132         Thermo,                                                               \
00133         IrreversibleReaction,                                                 \
00134         ChemicallyActivatedReactionRate,                                      \
00135         ReactionRate,                                                         \
00136         FallOffFunction                                                       \
00137     )                                                                         \
00138                                                                               \
00139     makePressureDependentReaction                                             \
00140     (                                                                         \
00141         Thermo,                                                               \
00142         ReversibleReaction,                                                   \
00143         ChemicallyActivatedReactionRate,                                      \
00144         ReactionRate,                                                         \
00145         FallOffFunction                                                       \
00146     )
00147 
00148 
00149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00150 
00151 } // End namespace Foam
00152 
00153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00154 
00155 #endif
00156 
00157 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines