ENH: Updated handling of canCombust flag to suppress devolatilisation and surface combustion

This commit is contained in:
andy
2013-05-03 11:35:48 +01:00
parent a1f3c95f9c
commit c819974315
14 changed files with 223 additions and 205 deletions

View File

@ -498,7 +498,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::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<ParcelType>::calcDevolatilisation
(
!td.cloud().devolatilisation().active()
|| T < td.cloud().constProps().Tvap()
|| canCombust == -1
)
{
return;
@ -588,7 +589,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::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<ParcelType>::calcSurfaceReactions
) const
{
// Check that model is active
if (!td.cloud().surfaceReaction().active() || !canCombust)
if (!td.cloud().surfaceReaction().active() || (canCombust != 1))
{
return;
}

View File

@ -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

View File

@ -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<ParcelType>::ReactingMultiphaseParcel
YGas_(0),
YLiquid_(0),
YSolid_(0),
canCombust_(false)
canCombust_(0)
{}
@ -142,7 +142,7 @@ inline Foam::ReactingMultiphaseParcel<ParcelType>::ReactingMultiphaseParcel
YGas_(YGas0),
YLiquid_(YLiquid0),
YSolid_(YSolid0),
canCombust_(false)
canCombust_(0)
{}
@ -192,7 +192,8 @@ YSolid() const
template<class ParcelType>
inline bool Foam::ReactingMultiphaseParcel<ParcelType>::canCombust() const
inline Foam::label
Foam::ReactingMultiphaseParcel<ParcelType>::canCombust() const
{
return canCombust_;
}
@ -220,7 +221,7 @@ inline Foam::scalarField& Foam::ReactingMultiphaseParcel<ParcelType>::YSolid()
template<class ParcelType>
inline bool& Foam::ReactingMultiphaseParcel<ParcelType>::canCombust()
inline Foam::label& Foam::ReactingMultiphaseParcel<ParcelType>::canCombust()
{
return canCombust_;
}

View File

@ -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<ParcelType>::ReactingMultiphaseParcel
YGas_(0),
YLiquid_(0),
YSolid_(0),
canCombust_(false)
canCombust_(0)
{
if (readFields)
{

View File

@ -32,6 +32,169 @@ using namespace Foam::constant::mathematical;
// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
template<class ParcelType>
template<class TrackData>
void Foam::ReactingParcel<ParcelType>::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<reactingCloudType>& 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<class ParcelType>
Foam::scalar Foam::ReactingParcel<ParcelType>::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<class ParcelType>
Foam::ReactingParcel<ParcelType>::ReactingParcel
(
const ReactingParcel<ParcelType>& p
)
:
ParcelType(p),
mass0_(p.mass0_),
Y_(p.Y_),
pc_(p.pc_)
{}
template<class ParcelType>
Foam::ReactingParcel<ParcelType>::ReactingParcel
(
const ReactingParcel<ParcelType>& p,
const polyMesh& mesh
)
:
ParcelType(p, mesh),
mass0_(p.mass0_),
Y_(p.Y_),
pc_(p.pc_)
{}
// * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * * //
template<class ParcelType>
template<class TrackData>
void Foam::ReactingParcel<ParcelType>::setCellValues
@ -165,7 +328,7 @@ void Foam::ReactingParcel<ParcelType>::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<ParcelType>::correctSurfaceValues
}
template<class ParcelType>
Foam::scalar Foam::ReactingParcel<ParcelType>::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<class ParcelType>
template<class TrackData>
void Foam::ReactingParcel<ParcelType>::calc
@ -472,144 +612,6 @@ void Foam::ReactingParcel<ParcelType>::calc
}
template<class ParcelType>
template<class TrackData>
void Foam::ReactingParcel<ParcelType>::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<reactingCloudType>& 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<class ParcelType>
Foam::ReactingParcel<ParcelType>::ReactingParcel
(
const ReactingParcel<ParcelType>& p
)
:
ParcelType(p),
mass0_(p.mass0_),
Y_(p.Y_),
pc_(p.pc_)
{}
template<class ParcelType>
Foam::ReactingParcel<ParcelType>::ReactingParcel
(
const ReactingParcel<ParcelType>& p,
const polyMesh& mesh
)
:
ParcelType(p, mesh),
mass0_(p.mass0_),
Y_(p.Y_),
pc_(p.pc_)
{}
// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
#include "ReactingParcelIO.C"

View File

@ -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

View File

@ -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

View File

@ -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);
}

View File

@ -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<CloudType>::calculate
const scalarField& YGasEff,
const scalarField& YLiquidEff,
const scalarField& YSolidEff,
bool& canCombust,
label& canCombust,
scalarField& dMassDV
) const
{
@ -130,7 +130,10 @@ void Foam::ConstantRateDevolatilisation<CloudType>::calculate
dMassDV[id] = min(dt*A0*massVolatile0, massVolatile);
}
canCombust = done;
if (done && canCombust != -1)
{
canCombust = 1;
}
}

View File

@ -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;
};

View File

@ -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<CloudType>::calculate
const scalarField&,
const scalarField&,
const scalarField&,
bool&,
label&,
scalarField&
) const
{
@ -98,7 +98,7 @@ void Foam::DevolatilisationModel<CloudType>::calculate
"const scalarField&, "
"const scalarField&, "
"const scalarField&, "
"bool&, "
"label&, "
"scalarField&"
") const"
);

View File

@ -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;

View File

@ -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<CloudType>::calculate
const scalarField& YGasEff,
const scalarField& YLiquidEff,
const scalarField& YSolidEff,
bool& canCombust,
label& canCombust,
scalarField& dMassDV
) const
{
@ -137,7 +137,10 @@ void Foam::SingleKineticRateDevolatilisation<CloudType>::calculate
dMassDV[id] = min(dt*kappa*massVolatile, massVolatile);
}
canCombust = done;
if (done && canCombust != -1)
{
canCombust = 1;
}
}

View File

@ -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;
};