DevolatilisationModel.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
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  DevolatilisationModelNew.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef DevolatilisationModel_H
37 #define DevolatilisationModel_H
38 
39 #include "IOdictionary.H"
40 #include "autoPtr.H"
41 #include "runTimeSelectionTables.H"
42 #include "CloudSubModelBase.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class DevolatilisationModel Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 template<class CloudType>
54 class DevolatilisationModel
55 :
56  public CloudSubModelBase<CloudType>
57 {
58 protected:
59 
60  // Protected data
61 
62  //- Mass of lagrangian phase converted
63  scalar dMass_;
64 
65 
66 public:
67 
68  //- Runtime type information
69  TypeName("devolatilisationModel");
70 
71  //- Declare runtime constructor selection table
73  (
74  autoPtr,
76  dictionary,
77  (
78  const dictionary& dict,
80  ),
81  (dict, owner)
82  );
83 
84 
85  // Constructors
86 
87  //- Construct null from owner
89 
90  //- Construct from dictionary
92  (
93  const dictionary& dict,
94  CloudType& owner,
95  const word& type
96  );
97 
98  //- Construct copy
100 
101  //- Construct and return a clone
102  virtual autoPtr<DevolatilisationModel<CloudType>> clone() const = 0;
103 
104 
105  //- Destructor
106  virtual ~DevolatilisationModel();
107 
108 
109  //- Selector
111  (
112  const dictionary& dict,
113  CloudType& owner
114  );
115 
116 
117  // Member Functions
118 
119  //- Update model
120  virtual void calculate
121  (
122  const scalar dt,
123  const scalar age,
124  const scalar mass0,
125  const scalar mass,
126  const scalar T,
127  const scalarField& YGasEff,
128  const scalarField& YLiquidEff,
129  const scalarField& YSolidEff,
130  label& canCombust,
131  scalarField& dMassDV
132  ) const = 0;
133 
134  //- Add to devolatilisation mass
135  void addToDevolatilisationMass(const scalar dMass);
136 
137 
138  // I-O
139 
140  //- Write injection info to stream
141  virtual void info(Ostream& os);
142 };
143 
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 } // End namespace Foam
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 #define makeDevolatilisationModel(CloudType) \
152  \
153  typedef Foam::CloudType::reactingMultiphaseCloudType \
154  reactingMultiphaseCloudType; \
155  defineNamedTemplateTypeNameAndDebug \
156  ( \
157  Foam::DevolatilisationModel<reactingMultiphaseCloudType>, \
158  0 \
159  ); \
160  namespace Foam \
161  { \
162  defineTemplateRunTimeSelectionTable \
163  ( \
164  DevolatilisationModel<reactingMultiphaseCloudType>, \
165  dictionary \
166  ); \
167  }
168 
170 #define makeDevolatilisationModelType(SS, CloudType) \
171  \
172  typedef Foam::CloudType::reactingMultiphaseCloudType \
173  reactingMultiphaseCloudType; \
174  defineNamedTemplateTypeNameAndDebug \
175  (Foam::SS<reactingMultiphaseCloudType>, 0); \
176  \
177  Foam::DevolatilisationModel<reactingMultiphaseCloudType>:: \
178  adddictionaryConstructorToTable \
179  <Foam::SS<reactingMultiphaseCloudType>> \
180  add##SS##CloudType##reactingMultiphaseCloudType##ConstructorToTable_;
181 
182 
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 
185 #ifdef NoRepository
186  #include "DevolatilisationModel.C"
187 #endif
188 
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 
191 #endif
192 
193 // ************************************************************************* //
TypeName("devolatilisationModel")
Runtime type information.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
virtual void calculate(const scalar dt, const scalar age, const scalar mass0, const scalar mass, const scalar T, const scalarField &YGasEff, const scalarField &YLiquidEff, const scalarField &YSolidEff, label &canCombust, scalarField &dMassDV) const =0
Update model.
DevolatilisationModel(CloudType &owner)
Construct null from owner.
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:110
virtual autoPtr< DevolatilisationModel< CloudType > > clone() const =0
Construct and return a clone.
const CloudType & owner() const
Return const access to the owner cloud.
virtual ~DevolatilisationModel()
Destructor.
A class for handling words, derived from string.
Definition: word.H:59
scalar dMass_
Mass of lagrangian phase converted.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
virtual void info(Ostream &os)
Write injection info to stream.
fileName::Type type(const fileName &, const bool followLink=true)
Return the file type: DIRECTORY or FILE.
Definition: POSIX.C:481
Templated devolatilisation model class.
declareRunTimeSelectionTable(autoPtr, DevolatilisationModel, dictionary,(const dictionary &dict, CloudType &owner),(dict, owner))
Declare runtime constructor selection table.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Macros to ease declaration of run-time selection tables.
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:69
static autoPtr< DevolatilisationModel< CloudType > > New(const dictionary &dict, CloudType &owner)
Selector.
Namespace for OpenFOAM.
void addToDevolatilisationMass(const scalar dMass)
Add to devolatilisation mass.