From c819974315cd375ba5c50b37a3406195a6a306d6 Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 3 May 2013 11:35:48 +0100 Subject: [PATCH] ENH: Updated handling of canCombust flag to suppress devolatilisation and surface combustion --- .../ReactingMultiphaseParcel.C | 7 +- .../ReactingMultiphaseParcel.H | 20 +- .../ReactingMultiphaseParcelI.H | 11 +- .../ReactingMultiphaseParcelIO.C | 4 +- .../Templates/ReactingParcel/ReactingParcel.C | 326 +++++++++--------- .../Templates/ReactingParcel/ReactingParcel.H | 2 +- ...keBasicReactingMultiphaseParcelSubmodels.C | 14 +- .../makeBasicReactingParcelSubmodels.C | 8 +- .../ConstantRateDevolatilisation.C | 9 +- .../ConstantRateDevolatilisation.H | 4 +- .../DevolatilisationModel.C | 6 +- .../DevolatilisationModel.H | 4 +- .../SingleKineticRateDevolatilisation.C | 9 +- .../SingleKineticRateDevolatilisation.H | 4 +- 14 files changed, 223 insertions(+), 205 deletions(-) diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C index 9350e1251e..aab07b4d7d 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C @@ -498,7 +498,7 @@ void Foam::ReactingMultiphaseParcel::calcDevolatilisation const scalarField& YGasEff, const scalarField& YLiquidEff, const scalarField& YSolidEff, - bool& canCombust, + label& canCombust, scalarField& dMassDV, scalar& Sh, scalar& N, @@ -512,6 +512,7 @@ void Foam::ReactingMultiphaseParcel::calcDevolatilisation ( !td.cloud().devolatilisation().active() || T < td.cloud().constProps().Tvap() + || canCombust == -1 ) { return; @@ -588,7 +589,7 @@ void Foam::ReactingMultiphaseParcel::calcSurfaceReactions const scalar d, const scalar T, const scalar mass, - const bool canCombust, + const label canCombust, const scalar N, const scalarField& YMix, const scalarField& YGas, @@ -603,7 +604,7 @@ void Foam::ReactingMultiphaseParcel::calcSurfaceReactions ) const { // Check that model is active - if (!td.cloud().surfaceReaction().active() || !canCombust) + if (!td.cloud().surfaceReaction().active() || (canCombust != 1)) { return; } diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H index db20b8d9c7..ff13d240b9 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -183,9 +183,13 @@ protected: //- Mass fractions of solids [] scalarField YSolid_; - //- Flag to say that the particle is allowed to combust - // Only true after volatile content falls below threshold value - bool canCombust_; + //- Flag to identify if the particle can devolatilise and combust + // Combustion possible only after volatile content falls below + // threshold value. States include: + // 0 = can devolatilise, cannot combust but can change + // 1 = can devolatilise, can combust + // -1 = cannot devolatilise or combust, and cannot change + label canCombust_; // Protected Member Functions @@ -205,7 +209,7 @@ protected: const scalarField& YGasEff,// gas component mass fractions const scalarField& YLiquidEff,// liquid component mass fractions const scalarField& YSolidEff,// solid component mass fractions - bool& canCombust, // 'can combust' flag + label& canCombust, // 'can combust' flag scalarField& dMassDV, // mass transfer - local to particle scalar& Sh, // explicit particle enthalpy source scalar& N, // flux of species emitted from particle @@ -223,7 +227,7 @@ protected: const scalar d, // diameter const scalar T, // temperature const scalar mass, // mass - const bool canCombust, // 'can combust' flag + const label canCombust, // 'can combust' flag const scalar N, // flux of species emitted from particle const scalarField& YMix, // mixture mass fractions const scalarField& YGas, // gas-phase mass fractions @@ -362,7 +366,7 @@ public: inline const scalarField& YSolid() const; //- Return const access to the canCombust flag - inline bool canCombust() const; + inline label canCombust() const; // Edit @@ -377,7 +381,7 @@ public: inline scalarField& YSolid(); //- Return access to the canCombust flag - inline bool& canCombust(); + inline label& canCombust(); // Main calculation loop diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelI.H b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelI.H index e610de174e..4a4a97eddf 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelI.H +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -94,7 +94,7 @@ inline Foam::ReactingMultiphaseParcel::ReactingMultiphaseParcel YGas_(0), YLiquid_(0), YSolid_(0), - canCombust_(false) + canCombust_(0) {} @@ -142,7 +142,7 @@ inline Foam::ReactingMultiphaseParcel::ReactingMultiphaseParcel YGas_(YGas0), YLiquid_(YLiquid0), YSolid_(YSolid0), - canCombust_(false) + canCombust_(0) {} @@ -192,7 +192,8 @@ YSolid() const template -inline bool Foam::ReactingMultiphaseParcel::canCombust() const +inline Foam::label +Foam::ReactingMultiphaseParcel::canCombust() const { return canCombust_; } @@ -220,7 +221,7 @@ inline Foam::scalarField& Foam::ReactingMultiphaseParcel::YSolid() template -inline bool& Foam::ReactingMultiphaseParcel::canCombust() +inline Foam::label& Foam::ReactingMultiphaseParcel::canCombust() { return canCombust_; } diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelIO.C b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelIO.C index fa1e6e0428..9495376322 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelIO.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelIO.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -47,7 +47,7 @@ Foam::ReactingMultiphaseParcel::ReactingMultiphaseParcel YGas_(0), YLiquid_(0), YSolid_(0), - canCombust_(false) + canCombust_(0) { if (readFields) { diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C index 4906280cf9..efb73ecae8 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C @@ -32,6 +32,169 @@ using namespace Foam::constant::mathematical; // * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * // +template +template +void Foam::ReactingParcel::calcPhaseChange +( + TrackData& td, + const scalar dt, + const label cellI, + const scalar Re, + const scalar Pr, + const scalar Ts, + const scalar nus, + const scalar d, + const scalar T, + const scalar mass, + const label idPhase, + const scalar YPhase, + const scalarField& YComponents, + scalarField& dMassPC, + scalar& Sh, + scalar& N, + scalar& NCpW, + scalarField& Cs +) +{ + if + ( + !td.cloud().phaseChange().active() + || T < td.cloud().constProps().Tvap() + || YPhase < SMALL + ) + { + return; + } + + typedef typename TrackData::cloudType::reactingCloudType reactingCloudType; + const CompositionModel& composition = + td.cloud().composition(); + + const scalar TMax = td.cloud().phaseChange().TMax(pc_, this->Tc_); + const scalar Tdash = min(T, TMax); + const scalar Tsdash = min(Ts, TMax); + + // Calculate mass transfer due to phase change + td.cloud().phaseChange().calculate + ( + dt, + cellI, + Re, + Pr, + d, + nus, + Tdash, + Tsdash, + pc_, + this->Tc_, + YComponents, + dMassPC + ); + + // Limit phase change mass by availability of each specie + dMassPC = min(mass*YPhase*YComponents, dMassPC); + + const scalar dMassTot = sum(dMassPC); + + // Add to cumulative phase change mass + td.cloud().phaseChange().addToPhaseChangeMass(this->nParticle_*dMassTot); + + forAll(dMassPC, i) + { + const label idc = composition.localToGlobalCarrierId(idPhase, i); + const label idl = composition.globalIds(idPhase)[i]; + + const scalar dh = td.cloud().phaseChange().dh(idc, idl, pc_, Tdash); + Sh -= dMassPC[i]*dh/dt; + } + + + // Update molar emissions + if (td.cloud().heatTransfer().BirdCorrection()) + { + // Average molecular weight of carrier mix - assumes perfect gas + const scalar Wc = this->rhoc_*specie::RR*this->Tc_/this->pc_; + + + forAll(dMassPC, i) + { + const label idc = composition.localToGlobalCarrierId(idPhase, i); + const label idl = composition.globalIds(idPhase)[i]; + + const scalar Cp = composition.carrier().Cp(idc, pc_, Tsdash); + const scalar W = composition.carrier().W(idc); + const scalar Ni = dMassPC[i]/(this->areaS(d)*dt*W); + + const scalar Dab = + composition.liquids().properties()[idl].D(pc_, Tsdash, Wc); + + // Molar flux of species coming from the particle (kmol/m^2/s) + N += Ni; + + // Sum of Ni*Cpi*Wi of emission species + NCpW += Ni*Cp*W; + + // Concentrations of emission species + Cs[idc] += Ni*d/(2.0*Dab); + } + } +} + + +template +Foam::scalar Foam::ReactingParcel::updateMassFraction +( + const scalar mass0, + const scalarField& dMass, + scalarField& Y +) const +{ + scalar mass1 = mass0 - sum(dMass); + + // only update the mass fractions if the new particle mass is finite + if (mass1 > ROOTVSMALL) + { + forAll(Y, i) + { + Y[i] = (Y[i]*mass0 - dMass[i])/mass1; + } + } + + return mass1; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::ReactingParcel::ReactingParcel +( + const ReactingParcel& p +) +: + ParcelType(p), + mass0_(p.mass0_), + Y_(p.Y_), + pc_(p.pc_) +{} + + +template +Foam::ReactingParcel::ReactingParcel +( + const ReactingParcel& p, + const polyMesh& mesh +) +: + ParcelType(p, mesh), + mass0_(p.mass0_), + Y_(p.Y_), + pc_(p.pc_) +{} + + +// * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * * // + template template void Foam::ReactingParcel::setCellValues @@ -165,7 +328,7 @@ void Foam::ReactingParcel::correctSurfaceValues const SLGThermo& thermo = td.cloud().thermo(); // Far field carrier molar fractions - scalarField Xinf(td.cloud().thermo().carrier().species().size()); + scalarField Xinf(thermo.carrier().species().size()); forAll(Xinf, i) { @@ -234,29 +397,6 @@ void Foam::ReactingParcel::correctSurfaceValues } -template -Foam::scalar Foam::ReactingParcel::updateMassFraction -( - const scalar mass0, - const scalarField& dMass, - scalarField& Y -) const -{ - scalar mass1 = mass0 - sum(dMass); - - // only update the mass fractions if the new particle mass is finite - if (mass1 > ROOTVSMALL) - { - forAll(Y, i) - { - Y[i] = (Y[i]*mass0 - dMass[i])/mass1; - } - } - - return mass1; -} - - template template void Foam::ReactingParcel::calc @@ -472,144 +612,6 @@ void Foam::ReactingParcel::calc } -template -template -void Foam::ReactingParcel::calcPhaseChange -( - TrackData& td, - const scalar dt, - const label cellI, - const scalar Re, - const scalar Pr, - const scalar Ts, - const scalar nus, - const scalar d, - const scalar T, - const scalar mass, - const label idPhase, - const scalar YPhase, - const scalarField& YComponents, - scalarField& dMassPC, - scalar& Sh, - scalar& N, - scalar& NCpW, - scalarField& Cs -) -{ - if - ( - !td.cloud().phaseChange().active() - || T < td.cloud().constProps().Tvap() - || YPhase < SMALL - ) - { - return; - } - - typedef typename TrackData::cloudType::reactingCloudType reactingCloudType; - const CompositionModel& composition = - td.cloud().composition(); - - const scalar TMax = td.cloud().phaseChange().TMax(pc_, this->Tc_); - const scalar Tdash = min(T, TMax); - const scalar Tsdash = min(Ts, TMax); - - // Calculate mass transfer due to phase change - td.cloud().phaseChange().calculate - ( - dt, - cellI, - Re, - Pr, - d, - nus, - Tdash, - Tsdash, - pc_, - this->Tc_, - YComponents, - dMassPC - ); - - // Limit phase change mass by availability of each specie - dMassPC = min(mass*YPhase*YComponents, dMassPC); - - const scalar dMassTot = sum(dMassPC); - - // Add to cumulative phase change mass - td.cloud().phaseChange().addToPhaseChangeMass(this->nParticle_*dMassTot); - - forAll(dMassPC, i) - { - const label idc = composition.localToGlobalCarrierId(idPhase, i); - const label idl = composition.globalIds(idPhase)[i]; - - const scalar dh = td.cloud().phaseChange().dh(idc, idl, pc_, Tdash); - Sh -= dMassPC[i]*dh/dt; - } - - - // Update molar emissions - if (td.cloud().heatTransfer().BirdCorrection()) - { - // Average molecular weight of carrier mix - assumes perfect gas - const scalar Wc = this->rhoc_*specie::RR*this->Tc_/this->pc_; - - - forAll(dMassPC, i) - { - const label idc = composition.localToGlobalCarrierId(idPhase, i); - const label idl = composition.globalIds(idPhase)[i]; - - const scalar Cp = composition.carrier().Cp(idc, pc_, Tsdash); - const scalar W = composition.carrier().W(idc); - const scalar Ni = dMassPC[i]/(this->areaS(d)*dt*W); - - const scalar Dab = - composition.liquids().properties()[idl].D(pc_, Tsdash, Wc); - - // Molar flux of species coming from the particle (kmol/m^2/s) - N += Ni; - - // Sum of Ni*Cpi*Wi of emission species - NCpW += Ni*Cp*W; - - // Concentrations of emission species - Cs[idc] += Ni*d/(2.0*Dab); - } - } -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template -Foam::ReactingParcel::ReactingParcel -( - const ReactingParcel& p -) -: - ParcelType(p), - mass0_(p.mass0_), - Y_(p.Y_), - pc_(p.pc_) -{} - - -template -Foam::ReactingParcel::ReactingParcel -( - const ReactingParcel& p, - const polyMesh& mesh -) -: - ParcelType(p, mesh), - mass0_(p.mass0_), - Y_(p.Y_), - pc_(p.pc_) -{} - - // * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * // #include "ReactingParcelIO.C" diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H index 0bb8f3704e..7b4fea251a 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelSubmodels.C b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelSubmodels.C index b14f905032..bafe2cdd26 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelSubmodels.C +++ b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelSubmodels.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -32,6 +32,8 @@ License #include "makeParcelDispersionModels.H" #include "makeReactingMultiphaseParcelInjectionModels.H" // MP variant #include "makeParcelPatchInteractionModels.H" +#include "makeReactingMultiphaseParcelStochasticCollisionModels.H" // MP variant +#include "makeReactingParcelSurfaceFilmModels.H" // Reacting variant // Thermodynamic #include "makeParcelHeatTransferModels.H" @@ -39,7 +41,6 @@ License // Reacting #include "makeReactingMultiphaseParcelCompositionModels.H" // MP Variant #include "makeReactingParcelPhaseChangeModels.H" -#include "makeReactingParcelSurfaceFilmModels.H" // Reacting multiphase #include "makeReactingMultiphaseParcelDevolatilisationModels.H" @@ -56,6 +57,11 @@ namespace Foam makeParcelDispersionModels(basicReactingMultiphaseCloud); makeReactingMultiphaseParcelInjectionModels(basicReactingMultiphaseCloud); makeParcelPatchInteractionModels(basicReactingMultiphaseCloud); + makeReactingMultiphaseParcelStochasticCollisionModels + ( + basicReactingMultiphaseCloud + ); + makeReactingParcelSurfaceFilmModels(basicReactingMultiphaseCloud); // Thermo sub-models makeParcelHeatTransferModels(basicReactingMultiphaseCloud); @@ -72,10 +78,6 @@ namespace Foam ( basicReactingMultiphaseCloud ); - makeReactingParcelSurfaceFilmModels - ( - basicReactingMultiphaseCloud - ); makeReactingMultiphaseParcelSurfaceReactionModels ( basicReactingMultiphaseCloud diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/makeBasicReactingParcelSubmodels.C b/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/makeBasicReactingParcelSubmodels.C index bd425895b6..e9eb87a2cd 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/makeBasicReactingParcelSubmodels.C +++ b/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/makeBasicReactingParcelSubmodels.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -32,6 +32,8 @@ License #include "makeParcelDispersionModels.H" #include "makeReactingParcelInjectionModels.H" // Reacting variant #include "makeParcelPatchInteractionModels.H" +#include "makeParcelStochasticCollisionModels.H" +#include "makeReactingParcelSurfaceFilmModels.H" // Reacting variant // Thermodynamic #include "makeParcelHeatTransferModels.H" @@ -39,7 +41,6 @@ License // Reacting #include "makeReactingParcelCompositionModels.H" #include "makeReactingParcelPhaseChangeModels.H" -#include "makeReactingParcelSurfaceFilmModels.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -52,6 +53,8 @@ namespace Foam makeParcelDispersionModels(basicReactingCloud); makeReactingParcelInjectionModels(basicReactingCloud); makeParcelPatchInteractionModels(basicReactingCloud); + makeParcelStochasticCollisionModels(basicReactingCloud); + makeReactingParcelSurfaceFilmModels(basicReactingCloud); // Thermo sub-models makeParcelHeatTransferModels(basicReactingCloud); @@ -59,7 +62,6 @@ namespace Foam // Reacting sub-models makeReactingParcelCompositionModels(basicReactingCloud); makeReactingParcelPhaseChangeModels(basicReactingCloud); - makeReactingParcelSurfaceFilmModels(basicReactingCloud); } diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/ConstantRateDevolatilisation/ConstantRateDevolatilisation.C b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/ConstantRateDevolatilisation/ConstantRateDevolatilisation.C index 0de0772381..a98e959392 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/ConstantRateDevolatilisation/ConstantRateDevolatilisation.C +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/ConstantRateDevolatilisation/ConstantRateDevolatilisation.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -109,7 +109,7 @@ void Foam::ConstantRateDevolatilisation::calculate const scalarField& YGasEff, const scalarField& YLiquidEff, const scalarField& YSolidEff, - bool& canCombust, + label& canCombust, scalarField& dMassDV ) const { @@ -130,7 +130,10 @@ void Foam::ConstantRateDevolatilisation::calculate dMassDV[id] = min(dt*A0*massVolatile0, massVolatile); } - canCombust = done; + if (done && canCombust != -1) + { + canCombust = 1; + } } diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/ConstantRateDevolatilisation/ConstantRateDevolatilisation.H b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/ConstantRateDevolatilisation/ConstantRateDevolatilisation.H index 7faffb990d..4b61de316d 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/ConstantRateDevolatilisation/ConstantRateDevolatilisation.H +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/ConstantRateDevolatilisation/ConstantRateDevolatilisation.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -111,7 +111,7 @@ public: const scalarField& YGasEff, const scalarField& YLiquidEff, const scalarField& YSolidEff, - bool& canCombust, + label& canCombust, scalarField& dMassDV ) const; }; diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModel.C b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModel.C index 6b4325db4f..48a0a4ee5f 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModel.C +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -82,7 +82,7 @@ void Foam::DevolatilisationModel::calculate const scalarField&, const scalarField&, const scalarField&, - bool&, + label&, scalarField& ) const { @@ -98,7 +98,7 @@ void Foam::DevolatilisationModel::calculate "const scalarField&, " "const scalarField&, " "const scalarField&, " - "bool&, " + "label&, " "scalarField&" ") const" ); diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModel.H b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModel.H index 7cff8d426a..f467aa7470 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModel.H +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -133,7 +133,7 @@ public: const scalarField& YGasEff, const scalarField& YLiquidEff, const scalarField& YSolidEff, - bool& canCombust, + label& canCombust, scalarField& dMassDV ) const; diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/SingleKineticRateDevolatilisation/SingleKineticRateDevolatilisation.C b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/SingleKineticRateDevolatilisation/SingleKineticRateDevolatilisation.C index fe4b856cfb..d3a8ca8aed 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/SingleKineticRateDevolatilisation/SingleKineticRateDevolatilisation.C +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/SingleKineticRateDevolatilisation/SingleKineticRateDevolatilisation.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -112,7 +112,7 @@ void Foam::SingleKineticRateDevolatilisation::calculate const scalarField& YGasEff, const scalarField& YLiquidEff, const scalarField& YSolidEff, - bool& canCombust, + label& canCombust, scalarField& dMassDV ) const { @@ -137,7 +137,10 @@ void Foam::SingleKineticRateDevolatilisation::calculate dMassDV[id] = min(dt*kappa*massVolatile, massVolatile); } - canCombust = done; + if (done && canCombust != -1) + { + canCombust = 1; + } } diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/SingleKineticRateDevolatilisation/SingleKineticRateDevolatilisation.H b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/SingleKineticRateDevolatilisation/SingleKineticRateDevolatilisation.H index d9c3064ce9..6b4802c8f6 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/SingleKineticRateDevolatilisation/SingleKineticRateDevolatilisation.H +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/SingleKineticRateDevolatilisation/SingleKineticRateDevolatilisation.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -236,7 +236,7 @@ public: const scalarField& YGasEff, const scalarField& YLiquidEff, const scalarField& YSolidEff, - bool& canCombust, + label& canCombust, scalarField& dMassDV ) const; };