SurfaceReactionModel.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "SurfaceReactionModel.H"
27 
28 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
29 
30 template<class CloudType>
32 (
33  CloudType& owner
34 )
35 :
37  dMass_(0.0)
38 {}
39 
40 
41 template<class CloudType>
43 (
44  const dictionary& dict,
45  CloudType& owner,
46  const word& type
47 )
48 :
49  CloudSubModelBase<CloudType>(owner, dict, typeName, type),
50  dMass_(0.0)
51 {}
52 
53 
54 template<class CloudType>
56 (
58 )
59 :
61  dMass_(srm.dMass_)
62 {}
63 
64 
65 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
66 
67 template<class CloudType>
69 {}
70 
71 
72 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
73 
74 template<class CloudType>
76 (
77  const scalar dMass
78 )
79 {
80  dMass_ += dMass;
81 }
82 
83 
84 template<class CloudType>
86 {
87  const scalar mass0 = this->template getBaseProperty<scalar>("mass");
88  const scalar massTotal = mass0 + returnReduce(dMass_, sumOp<scalar>());
89 
90  Info<< " Mass transfer surface reaction = " << massTotal << nl;
91 
92  if (this->writeTime())
93  {
94  this->setBaseProperty("mass", massTotal);
95  dMass_ = 0.0;
96  }
97 }
98 
99 
100 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
101 
102 #include "SurfaceReactionModelNew.C"
103 
104 // ************************************************************************* //
dictionary dict
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
Base class for cloud sub-models.
virtual ~SurfaceReactionModel()
Destructor.
virtual void info(Ostream &os)
Write injection info to stream.
A class for handling words, derived from string.
Definition: word.H:59
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
static const char nl
Definition: Ostream.H:265
scalar dMass_
Mass of lagrangian phase converted.
SurfaceReactionModel(CloudType &owner)
Construct null from owner.
void addToSurfaceReactionMass(const scalar dMass)
Add to devolatilisation mass.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
messageStream Info
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
Templated surface reaction model class.
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:69