FreeFOAM The Cross-Platform CFD Toolkit
DevolatilisationModel.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
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.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::DevolatilisationModel
26 
27 Description
28  Templated devolatilisation model class
29 
30 SourceFiles
31  DevolatilisationModel.C
32  NewDevolatilisationModel.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef DevolatilisationModel_H
37 #define DevolatilisationModel_H
38 
39 #include <OpenFOAM/IOdictionary.H>
40 #include <OpenFOAM/autoPtr.H>
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class DevolatilisationModel Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 template<class CloudType>
54 {
55 protected:
56 
57  // Protected data
58 
59  //- The cloud dictionary
60  const dictionary& dict_;
61 
62  //- Reference to the owner cloud class
63  CloudType& owner_;
64 
65  //- The coefficient dictionary
67 
68 
69 public:
70 
71  //- Runtime type information
72  TypeName("DevolatilisationModel");
73 
74  //- Declare runtime constructor selection table
76  (
77  autoPtr,
79  dictionary,
80  (
81  const dictionary& dict,
82  CloudType& owner
83  ),
84  (dict, owner)
85  );
86 
87 
88  // Constructors
89 
90  //- Construct null from owner
91  DevolatilisationModel(CloudType& owner);
92 
93  //- Construct from dictionary
95  (
96  const dictionary& dict,
97  CloudType& owner,
98  const word& type
99  );
100 
101 
102  //- Destructor
103  virtual ~DevolatilisationModel();
104 
105 
106  //- Selector
108  (
109  const dictionary& dict,
110  CloudType& owner
111  );
112 
113 
114  // Access
115 
116  //- Return the owner cloud object
117  const CloudType& owner() const;
118 
119  //- Return the cloud dictionary
120  const dictionary& dict() const;
121 
122  //- Return the coefficient dictionary
123  const dictionary& coeffDict() const;
124 
125 
126  // Member Functions
127 
128  //- Flag to indicate whether model activates devolatilisation model
129  virtual bool active() const = 0;
130 
131  //- Update model
132  virtual scalar calculate
133  (
134  const scalar dt,
135  const scalar mass0,
136  const scalar mass,
137  const scalar T,
138  const scalar YVolatile0,
139  const scalar YVolatile,
140  bool& canCombust
141  ) const = 0;
142 };
143 
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 } // End namespace Foam
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 #define makeDevolatilisationModel(CloudType) \
152  \
153  defineNamedTemplateTypeNameAndDebug(DevolatilisationModel<CloudType>, 0); \
154  \
155  defineTemplateRunTimeSelectionTable \
156  ( \
157  DevolatilisationModel<CloudType>, \
158  dictionary \
159  );
160 
161 
162 #define makeDevolatilisationModelThermoType(SS, CloudType, ParcelType, ThermoType)\
163  \
164  defineNamedTemplateTypeNameAndDebug \
165  ( \
166  SS<CloudType<ParcelType<ThermoType> > >, \
167  0 \
168  ); \
169  \
170  DevolatilisationModel<CloudType<ParcelType<ThermoType> > >:: \
171  adddictionaryConstructorToTable \
172  <SS<CloudType<ParcelType<ThermoType> > > > \
173  add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_;
174 
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 #ifdef NoRepository
179 # include "DevolatilisationModel.C"
180 #endif
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 #endif
185 
186 // ************************ vim: set sw=4 sts=4 et: ************************ //