HeterogeneousReactingModel.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) 2018-2020 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 \*---------------------------------------------------------------------------*/
27 
29 
30 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31 
32 template<class CloudType>
34 (
35  CloudType& owner
36 )
37 :
39  dMass_(0.0),
40  nF_(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.0),
54  nF_(this->coeffDict().template getOrDefault<label>("nF", 1))
55 {}
56 
57 
58 template<class CloudType>
60 (
62 )
63 :
65  dMass_(srm.dMass_),
66  nF_(srm.nF_)
67 {}
68 
69 
70 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
71 
72 template<class CloudType>
74 (
75  const scalar dMass
76 )
77 {
78  dMass_ += dMass;
79 }
80 
81 
82 template<class CloudType>
84 {
85  return nF_;
86 }
87 
88 
89 template<class CloudType>
91 {
92  const scalar mass0 = this->template getBaseProperty<scalar>("mass");
93  const scalar massTotal = mass0 + returnReduce(dMass_, sumOp<scalar>());
94 
95  Info<< " Mass transfer surface reaction = " << massTotal << nl;
96 
97  if (this->writeTime())
98  {
99  this->setBaseProperty("mass", massTotal);
100  dMass_ = 0.0;
101  }
102 }
103 
104 
105 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
106 
108 
109 // ************************************************************************* //
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
Foam::returnReduce
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
Definition: PstreamReduceOps.H:94
HeterogeneousReactingModelNew.C
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::addToSurfaceReactionMass
void addToSurfaceReactionMass(const scalar dMass)
Add to devolatilisation mass.
Definition: HeterogeneousReactingModel.C:74
Foam::CloudSubModelBase
Base class for cloud sub-models.
Definition: CloudSubModelBase.H:51
HeterogeneousReactingModel.H
Foam::sumOp
Definition: ops.H:213
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
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)
Foam::nl
constexpr char nl
Definition: Ostream.H:404
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::HeterogeneousReactingModel::nF
virtual label nF() const
Number of progress variable.
Definition: HeterogeneousReactingModel.C:83