From 17890e028237b4b15657ffae6bae6abc7fcb10a6 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 20 Oct 2010 17:07:48 +0100 Subject: [PATCH] ENH: Updated devolatilisation models to operate on a per-specie basis --- .../ReactingMultiphaseParcel.C | 27 ++- .../ReactingMultiphaseParcel.H | 4 +- .../ConstantRateDevolatilisation.C | 102 ++++++++---- .../ConstantRateDevolatilisation.H | 20 ++- .../DevolatilisationModel.C | 14 +- .../DevolatilisationModel.H | 8 +- .../NoDevolatilisation/NoDevolatilisation.C | 10 +- .../NoDevolatilisation/NoDevolatilisation.H | 16 +- .../SingleKineticRateDevolatilisation.C | 106 ++++++++---- .../SingleKineticRateDevolatilisation.H | 156 ++++++++++++++++-- 10 files changed, 333 insertions(+), 130 deletions(-) diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C index dba3409a12..1402304f13 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C @@ -287,9 +287,7 @@ void Foam::ReactingMultiphaseParcel::calc T0, mass0, this->mass0_, - idG, - YMix[GAS], - YGas_, + YMix[GAS]*YGas_, canCombust_, dMassDV, Sh, @@ -494,9 +492,7 @@ void Foam::ReactingMultiphaseParcel::calcDevolatilisation const scalar T, const scalar mass, const scalar mass0, - const label idVolatile, - const scalar YVolatileTot, - const scalarField& YVolatile, + const scalarField& YGasEff, bool& canCombust, scalarField& dMassDV, scalar& Sh, @@ -510,30 +506,29 @@ void Foam::ReactingMultiphaseParcel::calcDevolatilisation if ( !td.cloud().devolatilisation().active() - || T < td.constProps().Tvap() + || T < td.cloud().constProps().Tvap() ) { return; } // Total mass of volatiles evolved - const scalar dMassTot = td.cloud().devolatilisation().calculate + td.cloud().devolatilisation().calculate ( dt, mass0, mass, T, - td.cloud().composition().YMixture0()[idVolatile], - YVolatileTot, - canCombust + YGasEff, + canCombust, + dMassDV ); - // Volatile mass transfer - equal components of each volatile specie - dMassDV = YVolatile*dMassTot; + scalar dMassTot = sum(dMassDV); td.cloud().addToMassDevolatilisation(this->nParticle_*dMassTot); - Sh -= dMassTot*td.constProps().LDevol()/dt; + Sh -= dMassTot*td.cloud().constProps().LDevol()/dt; // Molar average molecular weight of carrier mix const scalar Wc = this->rhoc_*specie::RR*this->Tc_/this->pc_; @@ -546,8 +541,8 @@ void Foam::ReactingMultiphaseParcel::calcDevolatilisation const scalar beta = sqr(cbrt(15.0) + cbrt(15.0)); const label id = td.cloud().composition().localToGlobalCarrierId(GAS, i); - const scalar Cp = td.cloud().thermo().carrier().Cp(id, Ts); - const scalar W = td.cloud().thermo().carrier().W(id); + const scalar Cp = td.cloud().mcCarrierThermo().speciesData()[id].Cp(Ts); + const scalar W = td.cloud().mcCarrierThermo().speciesData()[id].W(); const scalar Ni = dMassDV[i]/(this->areaS(d)*dt*W); // Dab calc'd using API vapour mass diffusivity function diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H index 97cfb935dc..67041d5eb1 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H @@ -225,9 +225,7 @@ protected: const scalar T, // temperature const scalar mass, // mass const scalar mass0, // mass (initial on injection) - const label idVolatile, // id of volatile phase - const scalar YVolatileTot, // total volatile mass fraction - const scalarField& YVolatile, // volatile component mass fractions + const scalarField& YGasEff,// Gas component mass fractions bool& canCombust, // 'can combust' flag scalarField& dMassDV, // mass transfer - local to particle scalar& Sh, // explicit particle enthalpy source diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/ConstantRateDevolatilisation/ConstantRateDevolatilisation.C b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/ConstantRateDevolatilisation/ConstantRateDevolatilisation.C index ca73a935a5..e277e0c327 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/ConstantRateDevolatilisation/ConstantRateDevolatilisation.C +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/ConstantRateDevolatilisation/ConstantRateDevolatilisation.C @@ -8,10 +8,10 @@ License This file is part of OpenFOAM. - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @@ -19,7 +19,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA \*---------------------------------------------------------------------------*/ @@ -27,7 +28,7 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template +template Foam::ConstantRateDevolatilisation::ConstantRateDevolatilisation ( const dictionary& dict, @@ -35,29 +36,65 @@ Foam::ConstantRateDevolatilisation::ConstantRateDevolatilisation ) : DevolatilisationModel(dict, owner, typeName), - A0_(dimensionedScalar(this->coeffDict().lookup("A0")).value()), - volatileResidualCoeff_ - ( - readScalar(this->coeffDict().lookup("volatileResidualCoeff")) - ) -{} + volatileData_(this->coeffDict().lookup("volatileData")), + YVolatile0_(volatileData_.size()), + volatileToGasMap_(volatileData_.size()), + residualCoeff_(readScalar(this->coeffDict().lookup("residualCoeff"))) +{ + if (volatileData_.empty()) + { + WarningIn + ( + "Foam::ConstantRateDevolatilisation::" + "ConstantRateDevolatilisation" + "(" + "const dictionary& dict, " + "CloudType& owner" + ")" + ) << "Devolatilisation model selected, but no volatiles defined" + << nl << endl; + } + else + { + Info<< "Participating volatile species:" << endl; + + // Determine mapping between active volatiles and cloud gas components + const label idGas = owner.composition().idGas(); + const scalar YGasTot = owner.composition().YMixture0()[idGas]; + const scalarField& YGas = owner.composition().Y0(idGas); + forAll(volatileData_, i) + { + const word& specieName = volatileData_[i].first(); + Info<< " " << specieName << endl; + + const label id = owner.composition().localId(idGas, specieName); + volatileToGasMap_[i] = id; + YVolatile0_[i] = YGasTot*YGas[id]; + + Info<< " " << specieName << ": particle mass fraction = " + << YVolatile0_[i] << endl; + } + } +} -template +template Foam::ConstantRateDevolatilisation::ConstantRateDevolatilisation ( const ConstantRateDevolatilisation& dm ) : DevolatilisationModel(dm), - A0_(dm.A0_), - volatileResidualCoeff_(dm.volatileResidualCoeff_) + volatileData_(dm.volatileData_), + YVolatile0_(dm.YVolatile0_), + volatileToGasMap_(dm.volatileToGasMap_), + residualCoeff_(dm.residualCoeff_) {} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -template +template Foam::ConstantRateDevolatilisation::~ConstantRateDevolatilisation() {} @@ -65,29 +102,34 @@ Foam::ConstantRateDevolatilisation::~ConstantRateDevolatilisation() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -Foam::scalar Foam::ConstantRateDevolatilisation::calculate +void Foam::ConstantRateDevolatilisation::calculate ( const scalar dt, const scalar mass0, const scalar mass, const scalar T, - const scalar YVolatile0, - const scalar YVolatile, - bool& canCombust + const scalarField& YGasEff, + bool& canCombust, + scalarField& dMassDV ) const { - const scalar massVolatile0 = YVolatile0*mass0; - const scalar massVolatile = YVolatile*mass; - - if (massVolatile <= volatileResidualCoeff_*massVolatile0) + forAll(volatileData_, i) { - canCombust = true; + const label id = volatileToGasMap_[i]; + const scalar massVolatile0 = mass0*YVolatile0_[id]; + const scalar massVolatile = mass*YGasEff[id]; + + // Combustion allowed once all volatile components evolved + canCombust = + canCombust + && (massVolatile <= residualCoeff_*massVolatile0); + + // Model coefficients + const scalar A0 = volatileData_[i].second(); + + // Mass transferred from particle to carrier gas phase + dMassDV = min(dt*A0*massVolatile0, massVolatile); } - - // Volatile devolatilisation from particle to carrier gas phase - const scalar dMass = min(dt*A0_*massVolatile0, massVolatile); - - return dMass; } diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/ConstantRateDevolatilisation/ConstantRateDevolatilisation.H b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/ConstantRateDevolatilisation/ConstantRateDevolatilisation.H index 9477ca5d25..98f664a5b0 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/ConstantRateDevolatilisation/ConstantRateDevolatilisation.H +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/ConstantRateDevolatilisation/ConstantRateDevolatilisation.H @@ -52,13 +52,19 @@ class ConstantRateDevolatilisation // Model constants - //- Rate constant (suggested default = 12) [1/s] - const scalar A0_; + //- List of volatile data - (name A0) + List > volatileData_; + + //- List of initial volatile mass fractions + List YVolatile0_; + + //- Mapping between local and cloud gaseous species + List