1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "ConstantRateDevolatilisation.H"
28 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
30 template<class CloudType>
31 Foam::ConstantRateDevolatilisation<CloudType>::ConstantRateDevolatilisation
33 const dictionary& dict,
37 DevolatilisationModel<CloudType>(dict, owner, typeName),
38 volatileData_(this->coeffDict().lookup("volatileData")),
39 YVolatile0_(volatileData_.size()),
40 volatileToGasMap_(volatileData_.size()),
41 residualCoeff_(readScalar(this->coeffDict().lookup("residualCoeff")))
43 if (volatileData_.empty())
47 "Foam::ConstantRateDevolatilisation<CloudType>::"
48 "ConstantRateDevolatilisation"
50 "const dictionary& dict, "
53 ) << "Devolatilisation model selected, but no volatiles defined"
58 Info<< "Participating volatile species:" << endl;
60 // Determine mapping between active volatiles and cloud gas components
61 const label idGas = owner.composition().idGas();
62 const scalar YGasTot = owner.composition().YMixture0()[idGas];
63 const scalarField& YGas = owner.composition().Y0(idGas);
64 forAll(volatileData_, i)
66 const word& specieName = volatileData_[i].first();
67 const label id = owner.composition().localId(idGas, specieName);
68 volatileToGasMap_[i] = id;
69 YVolatile0_[i] = YGasTot*YGas[id];
71 Info<< " " << specieName << ": particle mass fraction = "
72 << YVolatile0_[i] << endl;
78 template<class CloudType>
79 Foam::ConstantRateDevolatilisation<CloudType>::ConstantRateDevolatilisation
81 const ConstantRateDevolatilisation<CloudType>& dm
84 DevolatilisationModel<CloudType>(dm),
85 volatileData_(dm.volatileData_),
86 YVolatile0_(dm.YVolatile0_),
87 volatileToGasMap_(dm.volatileToGasMap_),
88 residualCoeff_(dm.residualCoeff_)
92 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
94 template<class CloudType>
95 Foam::ConstantRateDevolatilisation<CloudType>::~ConstantRateDevolatilisation()
99 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
101 template<class CloudType>
102 void Foam::ConstantRateDevolatilisation<CloudType>::calculate
108 const scalarField& YGasEff,
114 forAll(volatileData_, i)
116 const label id = volatileToGasMap_[i];
117 const scalar massVolatile0 = mass0*YVolatile0_[i];
118 const scalar massVolatile = mass*YGasEff[id];
120 // Combustion allowed once all volatile components evolved
121 done = done && (massVolatile <= residualCoeff_*massVolatile0);
123 // Model coefficients
124 const scalar A0 = volatileData_[i].second();
126 // Mass transferred from particle to carrier gas phase
127 dMassDV[id] = min(dt*A0*massVolatile0, massVolatile);
134 // ************************************************************************* //