Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
10License
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
32template<class CloudType>
34(
36)
37:
39 dMass_(0.0),
40 nF_(0)
41{}
42
43
44template<class CloudType>
46(
47 const dictionary& dict,
48 CloudType& owner,
49 const word& type
50)
51:
53 dMass_(0.0),
54 nF_(this->coeffDict().template getOrDefault<label>("nF", 1))
55{}
56
57
58template<class CloudType>
60(
62)
63:
65 dMass_(srm.dMass_),
66 nF_(srm.nF_)
67{}
68
69
70// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
71
72template<class CloudType>
74(
75 const scalar dMass
77{
78 dMass_ += dMass;
79}
80
81
82template<class CloudType>
84{
85 return nF_;
86}
87
88
89template<class CloudType>
91{
93
94 const scalar mass0 = this->template getBaseProperty<scalar>("mass");
95 const scalar massTotal = mass0 + returnReduce(dMass_, sumOp<scalar>());
96
97 Log_<< " Mass transfer surface reaction = " << massTotal << nl;
98
99 if (this->writeTime())
100 {
101 this->setBaseProperty("mass", massTotal);
102 dMass_ = 0.0;
104}
105
106
107// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
108
110
111// ************************************************************************* //
Base class for cloud sub-models.
const CloudType & owner() const
Return const access to the owner cloud.
virtual void info()
Write to info.
CloudSubModelBase(CloudType &owner)
Construct null from owner cloud.
virtual bool writeTime() const
Flag to indicate when to write a property.
Base class for heterogeneous reacting models.
HeterogeneousReactingModel(CloudType &owner)
Construct null from owner.
void addToSurfaceReactionMass(const scalar dMass)
Add to devolatilisation mass.
scalar dMass_
Net mass of lagrangian phase consumed.
label nF_
Number of progress variables.
virtual label nF() const
Number of progress variable.
virtual void info()
Write injection info.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
const dictionary & coeffDict() const
Return const access to the coefficients dictionary.
Type getBaseProperty(const word &entryName, const Type &defaultValue=Type(Zero)) const
Retrieve generic property from the base model.
const dictionary & dict() const
Return const access to the cloud dictionary.
void setBaseProperty(const word &entryName, const Type &value)
Add generic property to the base model.
A class for handling words, derived from Foam::string.
Definition word.H:66
return returnReduce(nRefine-oldNRefine, sumOp< label >())
#define Log_
Report write to Foam::Info if the class log switch is true.
DSMCCloud< dsmcParcel > CloudType
T returnReduce(const T &value, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
constexpr char nl
The newline '\n' character (0x0a).
Definition Ostream.H:50
dictionary dict