initial commit for version 1.5.x patch release
[OpenFOAM-1.5.x.git] / src / lagrangian / intermediate / submodels / Reacting / SurfaceReactionModel / SurfaceReactionModel / SurfaceReactionModel.H
blobb50b5a90b42409d15f57ea3ac94d4843f7122129
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2008 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
29 Description
30     Templated surface reaction model class
32 SourceFiles
33     SurfaceReactionModel.C
34     NewSurfaceReactionModel.C
36 \*---------------------------------------------------------------------------*/
38 #ifndef SurfaceReactionModel_H
39 #define SurfaceReactionModel_H
41 #include "IOdictionary.H"
42 #include "autoPtr.H"
43 #include "runTimeSelectionTables.H"
45 #include "scalarField.H"
46 #include "scalarList.H"
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 namespace Foam
53 /*---------------------------------------------------------------------------*\
54                      Class SurfaceReactionModel Declaration
55 \*---------------------------------------------------------------------------*/
57 template<class CloudType>
58 class SurfaceReactionModel
61     // Private data
63         //- The cloud dictionary
64         const dictionary& dict_;
66         // reference to the owner cloud class
67         CloudType& owner_;
69         //- The coefficients dictionary
70         const dictionary coeffDict_;
73 public:
75     //-Runtime type information
76     TypeName("SurfaceReactionModel");
79     //- Declare runtime constructor selection table
80     declareRunTimeSelectionTable
81     (
82         autoPtr,
83         SurfaceReactionModel,
84         dictionary,
85         (
86             const dictionary& dict,
87             CloudType& cloud
88         ),
89         (dict, cloud)
90     );
93     // Constructors
95         //- Construct from dictionary
96         SurfaceReactionModel
97         (
98             const dictionary& dict,
99             CloudType& cloud,
100             const word& type
101         );
104     // Destructor
106         virtual ~SurfaceReactionModel();
109     // Selector
111         static autoPtr<SurfaceReactionModel<CloudType> > New
112         (
113             const dictionary& dict,
114             CloudType& cloud
115         );
118     // Access
120         //- Return the owner cloud object
121         const CloudType& owner() const;
123         //- Return the cloud dictionary
124         const dictionary& dict() const;
126         //- Return the coefficients dictionary
127         const dictionary& coeffDict() const;
130     // Member Functions
132         //- Flag to indicate whether model activates devolatisation model
133         virtual bool active() const = 0;
135         //- Update surface reactions
136         virtual void calculate
137         (
138             const scalar dt,
139             const label celli,
140             const scalar dp,
141             const scalar T0,
142             const scalar T1,
143             const scalar Tc,
144             const scalar rhoc,
145             const scalar massp,
146             scalarField& YGas,
147             scalarField& YLiquid,
148             scalarField& YSolid,
149             scalarField& YMixture,
150             scalar& dMassMTSR,
151             scalarList& dMassSR
152         ) const = 0;
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 } // End namespace Foam
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 #define makeSurfaceReactionModel(CloudType)                                   \
163                                                                               \
164     defineNamedTemplateTypeNameAndDebug(SurfaceReactionModel<CloudType>, 0);  \
165                                                                               \
166     defineTemplateRunTimeSelectionTable                                       \
167     (                                                                         \
168         SurfaceReactionModel<CloudType>,                                      \
169         dictionary                                                            \
170     );
173 #define makeSurfaceReactionModelType(SS, CloudType, ParcelType)               \
174                                                                               \
175     defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0);       \
176                                                                               \
177     SurfaceReactionModel<CloudType<ParcelType> >::                            \
178         adddictionaryConstructorToTable<SS<CloudType<ParcelType> > >          \
179             add##SS##CloudType##ParcelType##ConstructorToTable_;
182 #define makeSurfaceReactionModelTypeInstance(SS, CloudType, ParcelType)       \
183                                                                               \
184     defineNamedTemplateTypeNameAndDebug(SS, 0);                               \
185                                                                               \
186     SurfaceReactionModel<CloudType<ParcelType> >::                            \
187         adddictionaryConstructorToTable<SS>                                   \
188             add##SS##CloudType##ParcelType##ConstructorToTable_;
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 #ifdef NoRepository
194 #   include "SurfaceReactionModel.C"
195 #endif
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 #endif
201 // ************************************************************************* //