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 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::SurfaceReactionModel
29 
30 Group
31  grpLagrangianIntermediateSurfaceReactionSubModels
32 
33 Description
34  Templated surface reaction model class
35 
36 SourceFiles
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"
47 #include "runTimeSelectionTables.H"
48 #include "CloudSubModelBase.H"
49 #include "scalarField.H"
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 namespace Foam
54 {
55 
56 /*---------------------------------------------------------------------------*\
57  Class SurfaceReactionModel Declaration
58 \*---------------------------------------------------------------------------*/
59 
60 template<class CloudType>
61 class SurfaceReactionModel
62 :
63  public CloudSubModelBase<CloudType>
64 {
65 protected:
66 
67  // Protected Data
68 
69  //- Mass of lagrangian phase converted
70  scalar dMass_;
71 
72 
73 public:
74 
75  //-Runtime type information
76  TypeName("surfaceReactionModel");
77 
78 
79  //- Declare runtime constructor selection table
81  (
82  autoPtr,
84  dictionary,
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,
102  CloudType& cloud,
103  const word& type
104  );
105 
106  //- Construct copy
108 
109  //- Construct and return a clone
110  virtual autoPtr<SurfaceReactionModel<CloudType>> clone() const = 0;
111 
112 
113  //- Destructor
114  virtual ~SurfaceReactionModel() = default;
115 
116 
117  //- Selector
119  (
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 to stream
159  virtual void info(Ostream& os);
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) \
189  \
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 
209 #endif
210 
211 // ************************************************************************* //
Foam::SurfaceReactionModel
Templated surface reaction model class.
Definition: ReactingMultiphaseCloud.H:61
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::SurfaceReactionModel::~SurfaceReactionModel
virtual ~SurfaceReactionModel()=default
Destructor.
Foam::SurfaceReactionModel::dMass_
scalar dMass_
Mass of lagrangian phase converted.
Definition: SurfaceReactionModel.H:69
scalarField.H
Foam::SurfaceReactionModel::SurfaceReactionModel
SurfaceReactionModel(CloudType &owner)
Construct null from owner.
Definition: SurfaceReactionModel.C:35
Foam::SurfaceReactionModel::addToSurfaceReactionMass
void addToSurfaceReactionMass(const scalar dMass)
Add to devolatilisation mass.
Definition: SurfaceReactionModel.C:72
nu
volScalarField & nu
Definition: readMechanicalProperties.H:176
Foam::Field< scalar >
CloudSubModelBase.H
Foam::SurfaceReactionModel::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, SurfaceReactionModel, dictionary,(const dictionary &dict, CloudType &cloud),(dict, cloud))
Declare runtime constructor selection table.
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:58
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:71
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
Foam::SurfaceReactionModel::clone
virtual autoPtr< SurfaceReactionModel< CloudType > > clone() const =0
Construct and return a clone.
os
OBJstream os(runTime.globalPath()/outputName)
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::SurfaceReactionModel::New
static autoPtr< SurfaceReactionModel< CloudType > > New(const dictionary &dict, CloudType &cloud)
Selector.
Definition: SurfaceReactionModelNew.C:36
IOdictionary.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::cloud
A cloud is a registry collection of lagrangian particles.
Definition: cloud.H:57
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
SurfaceReactionModel.C
Foam::Re
scalarField Re(const UList< complex > &cf)
Extract real component.
Definition: complexField.C:159
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
N
const Vector< label > N(dict.get< Vector< label >>("N"))
Foam::SurfaceReactionModel::info
virtual void info(Ostream &os)
Write injection info to stream.
Definition: SurfaceReactionModel.C:81
Foam::SurfaceReactionModel::TypeName
TypeName("surfaceReactionModel")
Runtime type information.
Foam::SurfaceReactionModel::calculate
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.
autoPtr.H