1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
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
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
26 Foam::SurfaceReactionModel
29 Templated surface reaction model class
32 SurfaceReactionModel.C
33 NewSurfaceReactionModel.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef SurfaceReactionModel_H
38 #define SurfaceReactionModel_H
40 #include "IOdictionary.H"
42 #include "runTimeSelectionTables.H"
44 #include "scalarField.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 /*---------------------------------------------------------------------------*\
52 Class SurfaceReactionModel Declaration
53 \*---------------------------------------------------------------------------*/
55 template<class CloudType>
56 class SurfaceReactionModel
60 //- The cloud dictionary
61 const dictionary& dict_;
63 //- Reference to the owner cloud class
66 //- The coefficients dictionary
67 const dictionary coeffDict_;
72 //-Runtime type information
73 TypeName("SurfaceReactionModel");
76 //- Declare runtime constructor selection table
77 declareRunTimeSelectionTable
83 const dictionary& dict,
92 //- Construct null from owner
93 SurfaceReactionModel(CloudType& owner);
95 //- Construct from dictionary
98 const dictionary& dict,
105 virtual ~SurfaceReactionModel();
109 static autoPtr<SurfaceReactionModel<CloudType> > New
111 const dictionary& dict,
118 //- Return the owner cloud object
119 const CloudType& owner() const;
121 //- Return the cloud dictionary
122 const dictionary& dict() const;
124 //- Return the coefficients dictionary
125 const dictionary& coeffDict() const;
130 //- Flag to indicate whether model activates surface reaction model
131 virtual bool active() const = 0;
133 //- Update surface reactions
134 // Returns the heat of reaction
135 virtual scalar calculate
145 const scalarField& YGas,
146 const scalarField& YLiquid,
147 const scalarField& YSolid,
148 const scalarField& YMixture,
149 const scalarField& dMassVolatile,
150 scalarField& dMassGas,
151 scalarField& dMassLiquid,
152 scalarField& dMassSolid,
153 scalarField& dMassSRCarrier
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 } // End namespace Foam
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 #define makeSurfaceReactionModel(CloudType) \
166 defineNamedTemplateTypeNameAndDebug(SurfaceReactionModel<CloudType>, 0); \
168 defineTemplateRunTimeSelectionTable \
170 SurfaceReactionModel<CloudType>, \
175 #define makeSurfaceReactionModelThermoType(SS, CloudType, ParcelType, ThermoType)\
177 defineNamedTemplateTypeNameAndDebug \
179 SS<CloudType<ParcelType<ThermoType> > >, \
183 SurfaceReactionModel<CloudType<ParcelType<ThermoType> > >:: \
184 adddictionaryConstructorToTable \
185 <SS<CloudType<ParcelType<ThermoType> > > > \
186 add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_;
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 # include "SurfaceReactionModel.C"
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 // ************************************************************************* //