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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::DevolatilisationModel
28
29Group
30 grpLagrangianIntermediateDevolatilisationSubModels
31
32Description
33 Templated devolatilisation model class
34
35SourceFiles
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"
47#include "CloudSubModelBase.H"
48
49// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50
51namespace Foam
52{
53
54/*---------------------------------------------------------------------------*\
55 Class DevolatilisationModel Declaration
56\*---------------------------------------------------------------------------*/
57
58template<class CloudType>
60:
61 public CloudSubModelBase<CloudType>
62{
63protected:
64
65 // Protected data
66
67 //- Mass of lagrangian phase converted
68 scalar dMass_;
69
70
71public:
72
73 //- Runtime type information
74 TypeName("devolatilisationModel");
75
76 //- Declare runtime constructor selection table
78 (
79 autoPtr,
82 (
83 const dictionary& dict,
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,
100 const word& type
101 );
102
103 //- Construct copy
105
106 //- Construct and return a clone
108
109
110 //- Destructor
111 virtual ~DevolatilisationModel();
112
113
114 //- Selector
116 (
117 const dictionary& dict,
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// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
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
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// ************************************************************************* //
Base class for cloud sub-models.
const CloudType & owner() const
Return const access to the owner cloud.
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:75
Templated devolatilisation model class.
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.
scalar dMass_
Mass of lagrangian phase converted.
virtual void info(Ostream &os)
Write injection info to stream.
virtual autoPtr< DevolatilisationModel< CloudType > > clone() const =0
Construct and return a clone.
static autoPtr< DevolatilisationModel< CloudType > > New(const dictionary &dict, CloudType &owner)
Selector.
virtual ~DevolatilisationModel()
Destructor.
TypeName("devolatilisationModel")
Runtime type information.
declareRunTimeSelectionTable(autoPtr, DevolatilisationModel, dictionary,(const dictionary &dict, CloudType &owner),(dict, owner))
Declare runtime constructor selection table.
void addToDevolatilisationMass(const scalar dMass)
Add to devolatilisation mass.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:113
A class for handling words, derived from Foam::string.
Definition: word.H:68
const volScalarField & T
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:598
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73