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-2021 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 typename CloudType::parcelType& p,
123  const typename CloudType::parcelType::trackingData& td,
124  const scalar dt,
125  const scalar mass0,
126  const scalar mass,
127  const scalar T,
128  const scalarField& YGasEff,
129  const scalarField& YLiquidEff,
130  const scalarField& YSolidEff,
131  label& canCombust,
132  scalarField& dMassDV
133  ) const = 0;
134 
135  //- Add to devolatilisation mass
136  void addToDevolatilisationMass(const scalar dMass);
137 
138 
139  // I-O
140 
141  //- Write injection info to stream
142  virtual void info(Ostream& os);
143 };
144 
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 } // End namespace Foam
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 #define makeDevolatilisationModel(CloudType) \
153  \
154  typedef Foam::CloudType::reactingMultiphaseCloudType \
155  reactingMultiphaseCloudType; \
156  defineNamedTemplateTypeNameAndDebug \
157  ( \
158  Foam::DevolatilisationModel<reactingMultiphaseCloudType>, \
159  0 \
160  ); \
161  namespace Foam \
162  { \
163  defineTemplateRunTimeSelectionTable \
164  ( \
165  DevolatilisationModel<reactingMultiphaseCloudType>, \
166  dictionary \
167  ); \
168  }
169 
171 #define makeDevolatilisationModelType(SS, CloudType) \
172  \
173  typedef Foam::CloudType::reactingMultiphaseCloudType \
174  reactingMultiphaseCloudType; \
175  defineNamedTemplateTypeNameAndDebug \
176  (Foam::SS<reactingMultiphaseCloudType>, 0); \
177  \
178  Foam::DevolatilisationModel<reactingMultiphaseCloudType>:: \
179  adddictionaryConstructorToTable \
180  <Foam::SS<reactingMultiphaseCloudType>> \
181  add##SS##CloudType##reactingMultiphaseCloudType##ConstructorToTable_;
182 
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 
186 #ifdef NoRepository
187  #include "DevolatilisationModel.C"
188 #endif
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 #endif
193 
194 // ************************************************************************* //
TypeName("devolatilisationModel")
Runtime type information.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
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.
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:221
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
virtual void info(Ostream &os)
Write injection info to stream.
virtual void calculate(const typename CloudType::parcelType &p, const typename CloudType::parcelType::trackingData &td, const scalar dt, 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.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
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.
volScalarField & p
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:75
static autoPtr< DevolatilisationModel< CloudType > > New(const dictionary &dict, CloudType &owner)
Selector.
Namespace for OpenFOAM.
void addToDevolatilisationMass(const scalar dMass)
Add to devolatilisation mass.