SurfaceReactionModel.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  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 \*---------------------------------------------------------------------------*/
28 
29 #include "SurfaceReactionModel.H"
30 
31 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32 
33 template<class CloudType>
35 (
36  CloudType& owner
37 )
38 :
40  dMass_(0)
41 {}
42 
43 
44 template<class CloudType>
46 (
47  const dictionary& dict,
48  CloudType& owner,
49  const word& type
50 )
51 :
52  CloudSubModelBase<CloudType>(owner, dict, typeName, type),
53  dMass_(0)
54 {}
55 
56 
57 template<class CloudType>
59 (
61 )
62 :
64  dMass_(srm.dMass_)
65 {}
66 
67 
68 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
69 
70 template<class CloudType>
72 (
73  const scalar dMass
74 )
75 {
76  dMass_ += dMass;
77 }
78 
79 
80 template<class CloudType>
82 {
83  const scalar mass0 = this->template getBaseProperty<scalar>("mass");
84  const scalar massTotal = mass0 + returnReduce(dMass_, sumOp<scalar>());
85 
86  Info<< " Mass transfer surface reaction = " << massTotal << nl;
87 
88  if (this->writeTime())
89  {
90  this->setBaseProperty("mass", massTotal);
91  dMass_ = 0.0;
92  }
93 }
94 
95 
96 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
97 
99 
100 // ************************************************************************* //
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:62
Foam::returnReduce
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
Definition: PstreamReduceOps.H:94
Foam::SurfaceReactionModel::dMass_
scalar dMass_
Mass of lagrangian phase converted.
Definition: SurfaceReactionModel.H:69
Foam::SurfaceReactionModel::SurfaceReactionModel
SurfaceReactionModel(CloudType &owner)
Construct null from owner.
Definition: SurfaceReactionModel.C:35
Foam::CloudSubModelBase
Base class for cloud sub-models.
Definition: CloudSubModelBase.H:51
Foam::SurfaceReactionModel::addToSurfaceReactionMass
void addToSurfaceReactionMass(const scalar dMass)
Add to devolatilisation mass.
Definition: SurfaceReactionModel.C:72
Foam::sumOp
Definition: ops.H:213
SurfaceReactionModelNew.C
SurfaceReactionModel.H
Foam::Info
messageStream Info
Information stream (uses stdout - output is on the master only)
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:121
Foam::nl
constexpr char nl
Definition: Ostream.H:385
Foam::roots::type
type
Types of root.
Definition: Roots.H:54
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::SurfaceReactionModel::info
virtual void info(Ostream &os)
Write injection info to stream.
Definition: SurfaceReactionModel.C:81