initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / lagrangian / intermediate / submodels / ReactingMultiphase / DevolatilisationModel / DevolatilisationModel / DevolatilisationModel.H
blobb7edc60275d7b403049c66a4a1157c3c01f71167
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2008-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::DevolatilisationModel
28 Description
29     Templated devolatilisation model class
31 SourceFiles
32     DevolatilisationModel.C
33     NewDevolatilisationModel.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef DevolatilisationModel_H
38 #define DevolatilisationModel_H
40 #include "IOdictionary.H"
41 #include "autoPtr.H"
42 #include "runTimeSelectionTables.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 namespace Foam
49 /*---------------------------------------------------------------------------*\
50                       Class DevolatilisationModel Declaration
51 \*---------------------------------------------------------------------------*/
53 template<class CloudType>
54 class DevolatilisationModel
56 protected:
58     // Protected data
60         //- The cloud dictionary
61         const dictionary& dict_;
63         //- Reference to the owner cloud class
64         CloudType& owner_;
66         //- The coefficient dictionary
67         const dictionary coeffDict_;
70 public:
72     //- Runtime type information
73     TypeName("DevolatilisationModel");
75     //- Declare runtime constructor selection table
76     declareRunTimeSelectionTable
77     (
78         autoPtr,
79         DevolatilisationModel,
80         dictionary,
81         (
82             const dictionary& dict,
83             CloudType& owner
84         ),
85         (dict, owner)
86     );
89     // Constructors
91         //- Construct null from owner
92         DevolatilisationModel(CloudType& owner);
94         //- Construct from dictionary
95         DevolatilisationModel
96         (
97             const dictionary& dict,
98             CloudType& owner,
99             const word& type
100         );
103     //- Destructor
104     virtual ~DevolatilisationModel();
107     //- Selector
108     static autoPtr<DevolatilisationModel<CloudType> > New
109     (
110         const dictionary& dict,
111         CloudType& owner
112     );
115     // Access
117         //- Return the owner cloud object
118         const CloudType& owner() const;
120         //- Return the cloud dictionary
121         const dictionary& dict() const;
123         //- Return the coefficient dictionary
124         const dictionary& coeffDict() const;
127     // Member Functions
129         //- Flag to indicate whether model activates devolatilisation model
130         virtual bool active() const = 0;
132         //- Update model
133         virtual scalar calculate
134         (
135             const scalar dt,
136             const scalar mass0,
137             const scalar mass,
138             const scalar T,
139             const scalar YVolatile0,
140             const scalar YVolatile,
141             bool& canCombust
142         ) const = 0;
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 } // End namespace Foam
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 #define makeDevolatilisationModel(CloudType)                                  \
153                                                                               \
154     defineNamedTemplateTypeNameAndDebug(DevolatilisationModel<CloudType>, 0); \
155                                                                               \
156     defineTemplateRunTimeSelectionTable                                       \
157     (                                                                         \
158         DevolatilisationModel<CloudType>,                                     \
159         dictionary                                                            \
160     );
163 #define makeDevolatilisationModelThermoType(SS, CloudType, ParcelType, ThermoType)\
164                                                                               \
165     defineNamedTemplateTypeNameAndDebug                                       \
166     (                                                                         \
167         SS<CloudType<ParcelType<ThermoType> > >,                              \
168         0                                                                     \
169     );                                                                        \
170                                                                               \
171     DevolatilisationModel<CloudType<ParcelType<ThermoType> > >::              \
172         adddictionaryConstructorToTable                                       \
173             <SS<CloudType<ParcelType<ThermoType> > > >                        \
174             add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_;
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 #ifdef NoRepository
180 #   include "DevolatilisationModel.C"
181 #endif
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 #endif
187 // ************************************************************************* //