DevolatilisationModel.C
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 -------------------------------------------------------------------------------
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 \*---------------------------------------------------------------------------*/
27 
28 #include "DevolatilisationModel.H"
29 
30 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31 
32 template<class CloudType>
34 (
35  CloudType& owner
36 )
37 :
39  dMass_(0.0)
40 {}
41 
42 
43 template<class CloudType>
45 (
46  const dictionary& dict,
47  CloudType& owner,
48  const word& type
49 )
50 :
51  CloudSubModelBase<CloudType>(owner, dict, typeName, type),
52  dMass_(0.0)
53 {}
54 
55 
56 template<class CloudType>
58 (
60 )
61 :
63  dMass_(dm.dMass_)
64 {}
65 
66 
67 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
68 
69 template<class CloudType>
71 {}
72 
73 
74 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
75 
76 template<class CloudType>
78 (
79  const scalar dMass
80 )
81 {
82  dMass_ += dMass;
83 }
84 
85 
86 template<class CloudType>
88 {
90 
91  const scalar mass0 = this->template getBaseProperty<scalar>("mass");
92  const scalar massTotal = mass0 + returnReduce(dMass_, sumOp<scalar>());
93 
94  Log_<< " Mass transfer devolatilisation = " << massTotal << nl;
95 
96  if (this->writeTime())
97  {
98  this->setBaseProperty("mass", massTotal);
99  dMass_ = 0.0;
100  }
101 }
102 
103 
104 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
105 
107 
108 // ************************************************************************* //
dictionary dict
type
Types of root.
Definition: Roots.H:52
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
constexpr char nl
The newline &#39;\n&#39; character (0x0a)
Definition: Ostream.H:50
Base class for cloud sub-models.
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
DevolatilisationModel(CloudType &owner)
Construct null from owner.
virtual ~DevolatilisationModel()
Destructor.
#define Log_
Report write to Foam::Info if the class log switch is true.
A class for handling words, derived from Foam::string.
Definition: word.H:63
Templated devolatilisation model class.
virtual void info()
Write injection info.
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:67
void addToDevolatilisationMass(const scalar dMass)
Add to devolatilisation mass.