1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation, either version 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "COxidationDiffusionLimitedRate.H"
27 #include "mathematicalConstants.H"
29 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31 template<class CloudType>
32 Foam::COxidationDiffusionLimitedRate<CloudType>::COxidationDiffusionLimitedRate
34 const dictionary& dict,
38 SurfaceReactionModel<CloudType>(dict, owner, typeName),
39 Sb_(dimensionedScalar(this->coeffDict().lookup("Sb")).value()),
40 D_(dimensionedScalar(this->coeffDict().lookup("D")).value()),
42 O2GlobalId_(owner.composition().globalCarrierId("O2")),
43 CO2GlobalId_(owner.composition().globalCarrierId("CO2")),
49 label idSolid = owner.composition().idSolid();
50 CsLocalId_ = owner.composition().localId(idSolid, "C");
52 // Set local copies of thermo properties
53 WO2_ = owner.mcCarrierThermo().speciesData()[O2GlobalId_].W();
54 scalar WCO2 = owner.mcCarrierThermo().speciesData()[CO2GlobalId_].W();
56 HcCO2_ = owner.mcCarrierThermo().speciesData()[CO2GlobalId_].Hc();
62 "COxidationDiffusionLimitedRate<CloudType>"
67 ) << "Stoichiometry of reaction, Sb, must be greater than zero" << nl
73 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
75 template<class CloudType>
76 Foam::COxidationDiffusionLimitedRate<CloudType>::
77 ~COxidationDiffusionLimitedRate()
81 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
83 template<class CloudType>
84 bool Foam::COxidationDiffusionLimitedRate<CloudType>::active() const
90 template<class CloudType>
91 Foam::scalar Foam::COxidationDiffusionLimitedRate<CloudType>::calculate
101 const scalarField& YGas,
102 const scalarField& YLiquid,
103 const scalarField& YSolid,
104 const scalarField& YMixture,
106 scalarField& dMassGas,
107 scalarField& dMassLiquid,
108 scalarField& dMassSolid,
109 scalarField& dMassSRCarrier
112 // Fraction of remaining combustible material
113 const label idSolid = CloudType::parcelType::SLD;
114 const scalar fComb = YMixture[idSolid]*YSolid[CsLocalId_];
116 // Surface combustion active combustible fraction is consumed
122 // Local mass fraction of O2 in the carrier phase
123 const scalar YO2 = this->owner().mcCarrierThermo().Y(O2GlobalId_)[cellI];
125 // Change in C mass [kg]
127 4.0*mathematicalConstant::pi*d*D_*YO2*Tc*rhoc/(Sb_*(T + Tc))*dt;
129 // Limit mass transfer by availability of C
130 dmC = min(mass*fComb, dmC);
132 // Change in O2 mass [kg]
133 const scalar dmO2 = dmC/WC_*Sb_*WO2_;
135 // Mass of newly created CO2 [kg]
136 const scalar dmCO2 = dmC + dmO2;
138 // Update local particle C mass
139 dMassSolid[CsLocalId_] += dmC;
141 // Update carrier O2 and CO2 mass
142 dMassSRCarrier[O2GlobalId_] -= dmO2;
143 dMassSRCarrier[CO2GlobalId_] += dmCO2;
145 // Heat of reaction [J]
146 return -HcCO2_*dmCO2;
150 // ************************************************************************* //