SingleKineticRateDevolatilisation.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-2015 OpenFOAM Foundation
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>
35(
36 const dictionary& dict,
37 CloudType& owner
38)
39:
40 DevolatilisationModel<CloudType>(dict, owner, typeName),
41 volatileData_(this->coeffDict().lookup("volatileData")),
42 YVolatile0_(volatileData_.size()),
43 volatileToGasMap_(volatileData_.size()),
44 residualCoeff_(this->coeffDict().getScalar("residualCoeff"))
45{
46 if (volatileData_.empty())
47 {
49 << "Devolatilisation model selected, but no volatiles defined"
50 << nl << endl;
51 }
52 else
53 {
54 Info<< "Participating volatile species:" << endl;
55
56 // Determine mapping between active volatiles and cloud gas components
57 const label idGas = owner.composition().idGas();
58 const scalar YGasTot = owner.composition().YMixture0()[idGas];
59 const scalarField& YGas = owner.composition().Y0(idGas);
60 forAll(volatileData_, i)
61 {
62 const word& specieName = volatileData_[i].name();
63 const label id = owner.composition().localId(idGas, specieName);
64 volatileToGasMap_[i] = id;
65 YVolatile0_[i] = YGasTot*YGas[id];
66
67 Info<< " " << specieName << ": particle mass fraction = "
68 << YVolatile0_[i] << endl;
69 }
70 }
71}
72
73
74// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
75
76template<class CloudType>
78(
79 const scalar dt,
80 const scalar age,
81 const scalar mass0,
82 const scalar mass,
83 const scalar T,
84 const scalarField& YGasEff,
85 const scalarField& YLiquidEff,
86 const scalarField& YSolidEff,
87 label& canCombust,
88 scalarField& dMassDV
89) const
90{
91 bool done = true;
92 forAll(volatileData_, i)
93 {
94 const label id = volatileToGasMap_[i];
95 const scalar massVolatile0 = mass0*YVolatile0_[i];
96 const scalar massVolatile = mass*YGasEff[id];
97
98 // Combustion allowed once all volatile components evolved
99 done = done && (massVolatile <= residualCoeff_*massVolatile0);
100
101 // Model coefficients
102 const scalar A1 = volatileData_[i].A1();
103 const scalar E = volatileData_[i].E();
104
105 // Kinetic rate
106 const scalar kappa = A1*exp(-E/(RR*T));
107
108 // Mass transferred from particle to carrier gas phase
109 dMassDV[id] = min(dt*kappa*massVolatile, massVolatile);
110 }
111
112 if (done && canCombust != -1)
113 {
114 canCombust = 1;
115 }
116}
117
118
119// ************************************************************************* //
const CloudType & owner() const
Return const access to the owner cloud.
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:75
Templated devolatilisation model class.
Single kinetic rate devolatisation model.
bool empty() const noexcept
True if the UList is empty (ie, size() is zero)
Definition: UListI.H:427
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Lookup type of boundary radiation properties.
Definition: lookup.H:66
A class for handling words, derived from Foam::string.
Definition: word.H:68
const volScalarField & T
#define WarningInFunction
Report a warning using Foam::Warning.
dimensionedScalar exp(const dimensionedScalar &ds)
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:33
constexpr char nl
The newline '\n' character (0x0a)
Definition: Ostream.H:53
dictionary dict
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:333