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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::DevolatilisationModel
28 
29 Group
30  grpLagrangianIntermediateDevolatilisationSubModels
31 
32 Description
33  Templated devolatilisation model class
34 
35 SourceFiles
36  DevolatilisationModel.C
37  DevolatilisationModelNew.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef DevolatilisationModel_H
42 #define DevolatilisationModel_H
43 
44 #include "IOdictionary.H"
45 #include "autoPtr.H"
46 #include "runTimeSelectionTables.H"
47 #include "CloudSubModelBase.H"
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 namespace Foam
52 {
53 
54 /*---------------------------------------------------------------------------*\
55  Class DevolatilisationModel Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 template<class CloudType>
59 class DevolatilisationModel
60 :
61  public CloudSubModelBase<CloudType>
62 {
63 protected:
64 
65  // Protected data
66 
67  //- Mass of lagrangian phase converted
68  scalar dMass_;
69 
70 
71 public:
72 
73  //- Runtime type information
74  TypeName("devolatilisationModel");
75 
76  //- Declare runtime constructor selection table
78  (
79  autoPtr,
81  dictionary,
82  (
83  const dictionary& dict,
84  CloudType& owner
85  ),
86  (dict, owner)
87  );
88 
89 
90  // Constructors
91 
92  //- Construct null from owner
94 
95  //- Construct from dictionary
97  (
98  const dictionary& dict,
99  CloudType& owner,
100  const word& type
101  );
102 
103  //- Construct copy
105 
106  //- Construct and return a clone
107  virtual autoPtr<DevolatilisationModel<CloudType>> clone() const = 0;
108 
109 
110  //- Destructor
111  virtual ~DevolatilisationModel();
112 
113 
114  //- Selector
116  (
117  const dictionary& dict,
118  CloudType& owner
119  );
120 
121 
122  // Member Functions
123 
124  //- Update model
125  virtual void calculate
126  (
127  const scalar dt,
128  const scalar age,
129  const scalar mass0,
130  const scalar mass,
131  const scalar T,
132  const scalarField& YGasEff,
133  const scalarField& YLiquidEff,
134  const scalarField& YSolidEff,
135  label& canCombust,
136  scalarField& dMassDV
137  ) const = 0;
138 
139  //- Add to devolatilisation mass
140  void addToDevolatilisationMass(const scalar dMass);
141 
142 
143  // I-O
144 
145  //- Write injection info to stream
146  virtual void info(Ostream& os);
147 };
148 
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 } // End namespace Foam
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 #define makeDevolatilisationModel(CloudType) \
157  \
158  typedef Foam::CloudType::reactingMultiphaseCloudType \
159  reactingMultiphaseCloudType; \
160  defineNamedTemplateTypeNameAndDebug \
161  ( \
162  Foam::DevolatilisationModel<reactingMultiphaseCloudType>, \
163  0 \
164  ); \
165  namespace Foam \
166  { \
167  defineTemplateRunTimeSelectionTable \
168  ( \
169  DevolatilisationModel<reactingMultiphaseCloudType>, \
170  dictionary \
171  ); \
172  }
173 
174 
175 #define makeDevolatilisationModelType(SS, CloudType) \
176  \
177  typedef Foam::CloudType::reactingMultiphaseCloudType \
178  reactingMultiphaseCloudType; \
179  defineNamedTemplateTypeNameAndDebug \
180  (Foam::SS<reactingMultiphaseCloudType>, 0); \
181  \
182  Foam::DevolatilisationModel<reactingMultiphaseCloudType>:: \
183  adddictionaryConstructorToTable \
184  <Foam::SS<reactingMultiphaseCloudType>> \
185  add##SS##CloudType##reactingMultiphaseCloudType##ConstructorToTable_;
186 
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 #ifdef NoRepository
191  #include "DevolatilisationModel.C"
192 #endif
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 #endif
197 
198 // ************************************************************************* //
Foam::DevolatilisationModel::calculate
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.
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::DevolatilisationModel::New
static autoPtr< DevolatilisationModel< CloudType > > New(const dictionary &dict, CloudType &owner)
Selector.
Definition: DevolatilisationModelNew.C:36
DevolatilisationModel.C
Foam::DevolatilisationModel::DevolatilisationModel
DevolatilisationModel(CloudType &owner)
Construct null from owner.
Definition: DevolatilisationModel.C:34
Foam::Field< scalar >
CloudSubModelBase.H
Foam::DevolatilisationModel::~DevolatilisationModel
virtual ~DevolatilisationModel()
Destructor.
Definition: DevolatilisationModel.C:70
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:58
Foam::DevolatilisationModel
Templated devolatilisation model class.
Definition: ReactingMultiphaseCloud.H:58
Foam::DevolatilisationModel::clone
virtual autoPtr< DevolatilisationModel< CloudType > > clone() const =0
Construct and return a clone.
Foam::DevolatilisationModel::info
virtual void info(Ostream &os)
Write injection info to stream.
Definition: DevolatilisationModel.C:87
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:71
Foam::DevolatilisationModel::dMass_
scalar dMass_
Mass of lagrangian phase converted.
Definition: DevolatilisationModel.H:67
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
IOdictionary.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::type
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:590
Foam::DevolatilisationModel::addToDevolatilisationMass
void addToDevolatilisationMass(const scalar dMass)
Add to devolatilisation mass.
Definition: DevolatilisationModel.C:78
Foam::DevolatilisationModel::TypeName
TypeName("devolatilisationModel")
Runtime type information.
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::DevolatilisationModel::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, DevolatilisationModel, dictionary,(const dictionary &dict, CloudType &owner),(dict, owner))
Declare runtime constructor selection table.
autoPtr.H