initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / lagrangian / intermediate / submodels / ReactingMultiphase / SurfaceReactionModel / SurfaceReactionModel / SurfaceReactionModel.H
blobf876563fec613eadc020828d1ab89e9cea0bcaf9
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
25 Class
26     Foam::SurfaceReactionModel
28 Description
29     Templated surface reaction model class
31 SourceFiles
32     SurfaceReactionModel.C
33     NewSurfaceReactionModel.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef SurfaceReactionModel_H
38 #define SurfaceReactionModel_H
40 #include "IOdictionary.H"
41 #include "autoPtr.H"
42 #include "runTimeSelectionTables.H"
44 #include "scalarField.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 namespace Foam
51 /*---------------------------------------------------------------------------*\
52                      Class SurfaceReactionModel Declaration
53 \*---------------------------------------------------------------------------*/
55 template<class CloudType>
56 class SurfaceReactionModel
58     // Private data
60         //- The cloud dictionary
61         const dictionary& dict_;
63         //- Reference to the owner cloud class
64         CloudType& owner_;
66         //- The coefficients dictionary
67         const dictionary coeffDict_;
70 public:
72     //-Runtime type information
73     TypeName("SurfaceReactionModel");
76     //- Declare runtime constructor selection table
77     declareRunTimeSelectionTable
78     (
79         autoPtr,
80         SurfaceReactionModel,
81         dictionary,
82         (
83             const dictionary& dict,
84             CloudType& cloud
85         ),
86         (dict, cloud)
87     );
90     // Constructors
92         //- Construct null from owner
93         SurfaceReactionModel(CloudType& owner);
95         //- Construct from dictionary
96         SurfaceReactionModel
97         (
98             const dictionary& dict,
99             CloudType& cloud,
100             const word& type
101         );
104     //- Destructor
105     virtual ~SurfaceReactionModel();
108     //- Selector
109     static autoPtr<SurfaceReactionModel<CloudType> > New
110     (
111         const dictionary& dict,
112         CloudType& cloud
113     );
116     // Access
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;
128     // Member Functions
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
136         (
137             const scalar dt,
138             const label cellI,
139             const scalar d,
140             const scalar T,
141             const scalar Tc,
142             const scalar pc,
143             const scalar rhoc,
144             const scalar mass,
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
154         ) const = 0;
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 } // End namespace Foam
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 #define makeSurfaceReactionModel(CloudType)                                   \
165                                                                               \
166     defineNamedTemplateTypeNameAndDebug(SurfaceReactionModel<CloudType>, 0);  \
167                                                                               \
168     defineTemplateRunTimeSelectionTable                                       \
169     (                                                                         \
170         SurfaceReactionModel<CloudType>,                                      \
171         dictionary                                                            \
172     );
175 #define makeSurfaceReactionModelThermoType(SS, CloudType, ParcelType, ThermoType)\
176                                                                               \
177     defineNamedTemplateTypeNameAndDebug                                       \
178     (                                                                         \
179         SS<CloudType<ParcelType<ThermoType> > >,                              \
180         0                                                                     \
181     );                                                                        \
182                                                                               \
183     SurfaceReactionModel<CloudType<ParcelType<ThermoType> > >::               \
184         adddictionaryConstructorToTable                                       \
185             <SS<CloudType<ParcelType<ThermoType> > > >                        \
186             add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_;
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 #ifdef NoRepository
192 #   include "SurfaceReactionModel.C"
193 #endif
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 #endif
199 // ************************************************************************* //