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 -------------------------------------------------------------------------------
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::HeterogeneousReactingModel
28 
29 Group
30  grpLagrangianIntermediateHeterogeneousReactionSubModels
31 
32 Description
33  Base class for heterogeneous reacting models
34 
35 SourceFiles
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"
46 #include "runTimeSelectionTables.H"
47 #include "CloudSubModelBase.H"
48 #include "scalarField.H"
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 namespace Foam
53 {
54 
55 /*---------------------------------------------------------------------------*\
56  Class HeterogeneousReactingModel Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 template<class CloudType>
60 class HeterogeneousReactingModel
61 :
62  public CloudSubModelBase<CloudType>
63 {
64 protected:
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 
75 public:
76 
77  //-Runtime type information
78  TypeName("heterogeneousReactionModel");
79 
80 
81  //- Declare runtime constructor selection table
83  (
84  autoPtr,
86  dictionary,
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,
104  CloudType& cloud,
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
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 
196 
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 // ************************************************************************* //
Foam::HeterogeneousReactingModel::nF_
label nF_
Number of progress variables.
Definition: HeterogeneousReactingModel.H:71
Foam::HeterogeneousReactingModel::info
virtual void info(Ostream &os)
Write injection info to stream.
Definition: HeterogeneousReactingModel.C:90
Foam::HeterogeneousReactingModel
Base class for heterogeneous reacting models.
Definition: ReactingHeterogeneousCloud.H:55
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
scalarField.H
Foam::HeterogeneousReactingModel::dMass_
scalar dMass_
Net mass of lagrangian phase consumed.
Definition: HeterogeneousReactingModel.H:68
Foam::HeterogeneousReactingModel::HeterogeneousReactingModel
HeterogeneousReactingModel(CloudType &owner)
Construct null from owner.
Definition: HeterogeneousReactingModel.C:34
Foam::HeterogeneousReactingModel::nReactions
virtual label nReactions() const =0
Number of reactions in the model.
Foam::HeterogeneousReactingModel::addToSurfaceReactionMass
void addToSurfaceReactionMass(const scalar dMass)
Add to devolatilisation mass.
Definition: HeterogeneousReactingModel.C:74
F
volVectorField F(fluid.F())
nu
volScalarField & nu
Definition: readMechanicalProperties.H:176
Foam::HeterogeneousReactingModel::TypeName
TypeName("heterogeneousReactionModel")
Runtime type information.
Foam::Field< scalar >
CloudSubModelBase.H
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
os
OBJstream os(runTime.globalPath()/outputName)
HeterogeneousReactingModel.C
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::HeterogeneousReactingModel::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 &YSolid, scalarField &F, const scalar N, scalar &NCpW, scalarField &dMassSolid, scalarField &dMassSRCarrier) const =0
Update surface reactions.
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
Foam::HeterogeneousReactingModel::New
static autoPtr< HeterogeneousReactingModel< CloudType > > New(const dictionary &dict, CloudType &cloud)
Selector.
Definition: HeterogeneousReactingModelNew.C:35
Foam::Re
scalarField Re(const UList< complex > &cf)
Extract real component.
Definition: complexField.C:159
Foam::HeterogeneousReactingModel::~HeterogeneousReactingModel
virtual ~HeterogeneousReactingModel()=default
Destructor.
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::HeterogeneousReactingModel::nF
virtual label nF() const
Number of progress variable.
Definition: HeterogeneousReactingModel.C:83
Foam::HeterogeneousReactingModel::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, HeterogeneousReactingModel, dictionary,(const dictionary &dict, CloudType &cloud),(dict, cloud))
Declare runtime constructor selection table.
Foam::HeterogeneousReactingModel::clone
virtual autoPtr< HeterogeneousReactingModel< CloudType > > clone() const =0
Construct and return a clone.
autoPtr.H