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 -------------------------------------------------------------------------------
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>
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 
76 template<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 // ************************************************************************* //
Foam::constant::thermodynamic::RR
const scalar RR
Universal gas constant: default in [J/(kmol K)].
Definition: thermodynamicConstants.C:46
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
SingleKineticRateDevolatilisation.H
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
Foam::exp
dimensionedScalar exp(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:261
Foam::constant::electromagnetic::kappa
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
Foam::min
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:33
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
Foam::SingleKineticRateDevolatilisation::SingleKineticRateDevolatilisation
SingleKineticRateDevolatilisation(const dictionary &dict, CloudType &owner)
Construct from dictionary.
Definition: SingleKineticRateDevolatilisation.C:35
Foam::Field< scalar >
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
Foam::DevolatilisationModel
Templated devolatilisation model class.
Definition: ReactingMultiphaseCloud.H:58
Foam::radiation::lookup
Lookup type of boundary radiation properties.
Definition: lookup.H:63
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
T
const volScalarField & T
Definition: createFieldRefs.H:2
Foam::SingleKineticRateDevolatilisation::calculate
virtual void calculate(const scalar dt, const scalar age, const scalar mass0, const scalar mass, const scalar T, const scalarField &YGasEff, const scalarField &YLiquidEff, const scalarField &YSolidEff, label &canCombust, scalarField &dMassDV) const
Update model.
Definition: SingleKineticRateDevolatilisation.C:78
Foam::nl
constexpr char nl
Definition: Ostream.H:404
WarningInFunction
#define WarningInFunction
Report a warning using Foam::Warning.
Definition: messageStream.H:328