HeterogeneousReactingModel.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) 2018 OpenCFD Ltd.
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::HeterogeneousReactingModel
28
29Group
30 grpLagrangianIntermediateHeterogeneousReactionSubModels
31
32Description
33 Base class for heterogeneous reacting models
34
35SourceFiles
36 HeterogeneousReactingModel.C
37 HeterogeneousReactingModelNew.C
38
39\*---------------------------------------------------------------------------*/
40
41#ifndef HeterogeneousReactingModel_H
42#define HeterogeneousReactingModel_H
43
44#include "IOdictionary.H"
45#include "autoPtr.H"
47#include "CloudSubModelBase.H"
48#include "scalarField.H"
49
50// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51
52namespace Foam
53{
54
55/*---------------------------------------------------------------------------*\
56 Class HeterogeneousReactingModel Declaration
57\*---------------------------------------------------------------------------*/
58
59template<class CloudType>
61:
62 public CloudSubModelBase<CloudType>
63{
64protected:
65
66 // Protected data
67
68 //- Net mass of lagrangian phase consumed
69 scalar dMass_;
70
71 //- Number of progress variables
72 label nF_;
73
74
75public:
76
77 //-Runtime type information
78 TypeName("heterogeneousReactionModel");
79
80
81 //- Declare runtime constructor selection table
83 (
84 autoPtr,
87 (
88 const dictionary& dict,
90 ),
91 (dict, cloud)
92 );
93
94
95 // Constructors
96
97 //- Construct null from owner
99
100 //- Construct from dictionary
102 (
103 const dictionary& dict,
105 const word& type
106 );
107
108 //- Construct copy
110 (
112 );
113
114 //- Construct and return a clone
115 virtual autoPtr
116 <
118 > clone() const = 0;
119
120
121 //- Destructor
122 virtual ~HeterogeneousReactingModel() = default;
123
124
125 //- Selector
127 (
128 const dictionary& dict,
130 );
131
132
133 // Member Functions
134
135 //- Update surface reactions
136 // Returns the heat of reaction
137 virtual scalar calculate
138 (
139 const scalar dt,
140 const scalar Re,
141 const scalar nu,
142 const label celli,
143 const scalar d,
144 const scalar T,
145 const scalar Tc,
146 const scalar pc,
147 const scalar rhoc,
148 const scalar mass,
149 const scalarField& YSolid,
150 scalarField& F,
151 const scalar N,
152 scalar& NCpW,
153 scalarField& dMassSolid,
154 scalarField& dMassSRCarrier
155 ) const = 0;
156
157
158 //- Add to devolatilisation mass
159 void addToSurfaceReactionMass(const scalar dMass);
160
161 //- Number of reactions in the model
162 virtual label nReactions() const = 0;
163
164 //- Number of progress variable
165 virtual label nF() const;
166
167 //- Write injection info to stream
168 virtual void info(Ostream& os);
169};
170
171
172// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173
174} // End namespace Foam
175
176// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178#define makeHeterogeneousReactingModel(CloudType) \
179 \
180 typedef Foam::CloudType::reactingHeterogeneousCloudType \
181 reactingHeterogeneousCloudType; \
182 defineNamedTemplateTypeNameAndDebug \
183 ( \
184 Foam::HeterogeneousReactingModel<reactingHeterogeneousCloudType>, \
185 0 \
186 ); \
187 namespace Foam \
188 { \
189 defineTemplateRunTimeSelectionTable \
190 ( \
191 HeterogeneousReactingModel<reactingHeterogeneousCloudType>, \
192 dictionary \
193 ); \
194 }
195
197#define makeHeterogeneousReactingModelType(SS, CloudType) \
198 \
199 typedef Foam::CloudType::reactingHeterogeneousCloudType \
200 reactingHeterogeneousCloudType; \
201 defineNamedTemplateTypeNameAndDebug \
202 (Foam::SS<reactingHeterogeneousCloudType>, 0); \
203 \
204 Foam::HeterogeneousReactingModel<reactingHeterogeneousCloudType>:: \
205 adddictionaryConstructorToTable \
206 <Foam::SS<reactingHeterogeneousCloudType>> \
207 add##SS##CloudType##reactingHeterogeneousCloudType##ConstructorToTable_;
208
209
210// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211
212#ifdef NoRepository
214#endif
215
216// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
217
218#endif
219
220// ************************************************************************* //
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
Base class for heterogeneous reacting models.
virtual label nReactions() const =0
Number of reactions in the model.
void addToSurfaceReactionMass(const scalar dMass)
Add to devolatilisation mass.
scalar dMass_
Net mass of lagrangian phase consumed.
static autoPtr< HeterogeneousReactingModel< CloudType > > New(const dictionary &dict, CloudType &cloud)
Selector.
label nF_
Number of progress variables.
virtual autoPtr< HeterogeneousReactingModel< CloudType > > clone() const =0
Construct and return a clone.
virtual label nF() const
Number of progress variable.
virtual void info(Ostream &os)
Write injection info to stream.
virtual scalar calculate(const scalar dt, const scalar Re, const scalar nu, const label celli, const scalar d, const scalar T, const scalar Tc, const scalar pc, const scalar rhoc, const scalar mass, const scalarField &YSolid, scalarField &F, const scalar N, scalar &NCpW, scalarField &dMassSolid, scalarField &dMassSRCarrier) const =0
Update surface reactions.
virtual ~HeterogeneousReactingModel()=default
Destructor.
declareRunTimeSelectionTable(autoPtr, HeterogeneousReactingModel, dictionary,(const dictionary &dict, CloudType &cloud),(dict, cloud))
Declare runtime constructor selection table.
TypeName("heterogeneousReactionModel")
Runtime type information.
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 cloud is a registry collection of lagrangian particles.
Definition: cloud.H:60
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)
volVectorField F(fluid.F())
Namespace for OpenFOAM.
scalarField Re(const UList< complex > &cf)
Extract real component.
Definition: complexField.C:159
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
volScalarField & nu
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
const Vector< label > N(dict.get< Vector< label > >("N"))