Loading...
Searching...
No Matches
SurfaceReactionModel.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 Copyright (C) 2018-2019 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::SurfaceReactionModel
29
30Group
31 grpLagrangianIntermediateSurfaceReactionSubModels
32
33Description
34 Templated surface reaction model class
35
36SourceFiles
37 SurfaceReactionModel.C
38 SurfaceReactionModelNew.C
39
40\*---------------------------------------------------------------------------*/
41
42#ifndef SurfaceReactionModel_H
43#define SurfaceReactionModel_H
44
45#include "IOdictionary.H"
46#include "autoPtr.H"
48#include "CloudSubModelBase.H"
49#include "scalarField.H"
50
51// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52
53namespace Foam
54{
55
56/*---------------------------------------------------------------------------*\
57 Class SurfaceReactionModel Declaration
58\*---------------------------------------------------------------------------*/
59
60template<class CloudType>
62:
63 public CloudSubModelBase<CloudType>
64{
65protected:
66
67 // Protected Data
68
69 //- Mass of lagrangian phase converted
70 scalar dMass_;
71
72
73public:
74
75 //-Runtime type information
76 TypeName("surfaceReactionModel");
77
78
79 //- Declare runtime constructor selection table
81 (
82 autoPtr,
85 (
86 const dictionary& dict,
88 ),
89 (dict, cloud)
90 );
91
92
93 // Constructors
94
95 //- Construct null from owner
97
98 //- Construct from dictionary
100 (
101 const dictionary& dict,
103 const word& type
104 );
105
106 //- Construct copy
108
109 //- Construct and return a clone
111
112
113 //- Destructor
114 virtual ~SurfaceReactionModel() = default;
115
116
117 //- Selector
120 const dictionary& dict,
122 );
123
124
125 // Member Functions
126
127 //- Update surface reactions
128 // Returns the heat of reaction
129 virtual scalar calculate
130 (
131 const scalar dt,
132 const scalar Re,
133 const scalar nu,
134 const label celli,
135 const scalar d,
136 const scalar T,
137 const scalar Tc,
138 const scalar pc,
139 const scalar rhoc,
140 const scalar mass,
141 const scalarField& YGas,
142 const scalarField& YLiquid,
143 const scalarField& YSolid,
144 const scalarField& YMixture,
145 const scalar N,
146 scalarField& dMassGas,
147 scalarField& dMassLiquid,
148 scalarField& dMassSolid,
149 scalarField& dMassSRCarrier
150 ) const = 0;
151
152 //- Add to devolatilisation mass
153 void addToSurfaceReactionMass(const scalar dMass);
154
155
156 // I-O
157
158 //- Write injection info
159 virtual void info();
160};
161
162
163// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164
165} // End namespace Foam
166
167// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168
169#define makeSurfaceReactionModel(CloudType) \
170 \
171 typedef Foam::CloudType::reactingMultiphaseCloudType \
172 reactingMultiphaseCloudType; \
173 defineNamedTemplateTypeNameAndDebug \
174 ( \
175 Foam::SurfaceReactionModel<reactingMultiphaseCloudType>, \
176 0 \
177 ); \
178 namespace Foam \
179 { \
180 defineTemplateRunTimeSelectionTable \
181 ( \
182 SurfaceReactionModel<reactingMultiphaseCloudType>, \
183 dictionary \
184 ); \
185 }
186
187
188#define makeSurfaceReactionModelType(SS, CloudType) \
190 typedef Foam::CloudType::reactingMultiphaseCloudType \
191 reactingMultiphaseCloudType; \
192 defineNamedTemplateTypeNameAndDebug \
193 (Foam::SS<reactingMultiphaseCloudType>, 0); \
194 \
195 Foam::SurfaceReactionModel<reactingMultiphaseCloudType>:: \
196 adddictionaryConstructorToTable \
197 <Foam::SS<reactingMultiphaseCloudType>> \
198 add##SS##CloudType##reactingMultiphaseCloudType##ConstructorToTable_;
199
200
201// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202
203#ifdef NoRepository
204 #include "SurfaceReactionModel.C"
205#endif
206
207// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209#endif
210
211// ************************************************************************* //
const CloudType & owner() const
Return const access to the owner cloud.
CloudSubModelBase(CloudType &owner)
Construct null from owner cloud.
declareRunTimeSelectionTable(autoPtr, SurfaceReactionModel, dictionary,(const dictionary &dict, CloudType &cloud),(dict, cloud))
Declare runtime constructor selection table.
void addToSurfaceReactionMass(const scalar dMass)
Add to devolatilisation mass.
scalar dMass_
Mass of lagrangian phase converted.
virtual autoPtr< SurfaceReactionModel< CloudType > > clone() const =0
Construct and return a clone.
SurfaceReactionModel(CloudType &owner)
Construct null from owner.
virtual ~SurfaceReactionModel()=default
Destructor.
static autoPtr< SurfaceReactionModel< CloudType > > New(const dictionary &dict, CloudType &cloud)
Selector.
virtual void info()
Write injection info.
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 &YGas, const scalarField &YLiquid, const scalarField &YSolid, const scalarField &YMixture, const scalar N, scalarField &dMassGas, scalarField &dMassLiquid, scalarField &dMassSolid, scalarField &dMassSRCarrier) const =0
Update surface reactions.
TypeName("surfaceReactionModel")
Runtime type information.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A cloud is a registry collection of lagrangian particles.
Definition cloud.H:56
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
const dictionary & dict() const
Return const access to the cloud dictionary.
A class for handling words, derived from Foam::string.
Definition word.H:66
Namespace for OpenFOAM.
DSMCCloud< dsmcParcel > CloudType
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
scalarField Re(const UList< complex > &cmplx)
Extract real component.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
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:68
const Vector< label > N(dict.get< Vector< label > >("N"))