initial commit for version 1.5.x patch release
[OpenFOAM-1.5.x.git] / src / lagrangian / intermediate / submodels / Reacting / MassTransferModel / MassTransferModel / MassTransferModel.H
blob7b16d3dc3586bbfc3d7d3860a4cbbf35900f847c
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::MassTransferModel
29 Description
30     Templated mass transfer model class
32 SourceFiles
33     MassTransferModel.C
34     NewMassTransferModel.C
36 \*---------------------------------------------------------------------------*/
38 #ifndef MassTransferModel_H
39 #define MassTransferModel_H
41 #include "IOdictionary.H"
42 #include "autoPtr.H"
43 #include "runTimeSelectionTables.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 namespace Foam
50 /*---------------------------------------------------------------------------*\
51                       Class MassTransferModel Declaration
52 \*---------------------------------------------------------------------------*/
54 template<class CloudType>
55 class MassTransferModel
58 protected:
60     // Protected data
62         //- The cloud dictionary
63         const dictionary& dict_;
65         //- Reference to the owner cloud class
66         CloudType& owner_;
68         //- The coefficient dictionary
69         const dictionary coeffDict_;
72 public:
74     //- Runtime type information
75     TypeName("MassTransferModel");
77     //- Declare runtime constructor selection table
78     declareRunTimeSelectionTable
79     (
80         autoPtr,
81         MassTransferModel,
82         dictionary,
83         (
84             const dictionary& dict,
85             CloudType& owner
86         ),
87         (dict, owner)
88     );
91     // Constructors
93         //- Construct from dictionary
94         MassTransferModel
95         (
96             const dictionary& dict,
97             CloudType& owner,
98             const word& type
99         );
102     // Destructor
104         virtual ~MassTransferModel();
107     // Selector
109         static autoPtr<MassTransferModel<CloudType> > New
110         (
111             const dictionary& dict,
112             CloudType& owner
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 coefficient dictionary
125         const dictionary& coeffDict() const;
128     // Member Functions
130         //- Flag to indicate whether model activates mass transfer model
131         virtual bool active() const = 0;
133         //- Flag to indicate whether model changes particle volume
134         virtual bool changesVolume() const = 0;
136         //- Update model
137         virtual scalar calculate
138         (
139             const scalar dt,
140             const scalar mass0,
141             const scalar mass,
142             const scalarField& YMixture0,
143             const scalarField& YMixture,
144             const scalar T,
145             bool& canCombust
146         ) const = 0;
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 } // End namespace Foam
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 #define makeMassTransferModel(CloudType)                                      \
157                                                                               \
158     defineNamedTemplateTypeNameAndDebug(MassTransferModel<CloudType>, 0);     \
159                                                                               \
160     defineTemplateRunTimeSelectionTable                                       \
161     (                                                                         \
162         MassTransferModel<CloudType>,                                         \
163         dictionary                                                            \
164     );
167 #define makeMassTransferModelType(SS, CloudType, ParcelType)                  \
168                                                                               \
169     defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0);       \
170                                                                               \
171     MassTransferModel<CloudType<ParcelType> >::                               \
172         adddictionaryConstructorToTable<SS<CloudType<ParcelType> > >          \
173             add##SS##CloudType##ParcelType##ConstructorToTable_;
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 #ifdef NoRepository
179 #   include "MassTransferModel.C"
180 #endif
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 #endif
186 // ************************************************************************* //