phase change update

This commit is contained in:
andy
2009-02-27 18:59:45 +00:00
parent aa84d7dd1a
commit f613354d3d
11 changed files with 97 additions and 41 deletions

View File

@ -100,7 +100,8 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calcCoupled
// ~~~~~~~~~~~~~~~~~~~~~~
// Calculate phase change
// ~~~~~~~~~~~~~~~~~~~~~~
calcPhaseChange(td, dt, T0, dMassMT);
scalarField X = td.cloud().composition().X(idLiquid, YLiquid_);
calcPhaseChange(td, dt, T0, X, dMassMT);
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -271,7 +272,8 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calcUncoupled
// ~~~~~~~~~~~~~~~~~~~~~~
// Calculate phase change
// ~~~~~~~~~~~~~~~~~~~~~~
calcPhaseChange(td, dt, T0, dMassMT);
scalarField X = td.cloud().composition().X(idLiquid, YLiquid_);
calcPhaseChange(td, dt, T0, YLiquid_, dMassMT);
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -347,7 +349,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calcDevolatilisation
(
"void Foam::ReactingMultiphaseParcel<ParcelType>::"
"calcDevolatilisation \n"
"("
"(\n"
" TrackData&,\n"
" const scalar,\n"
" const scalar,\n"

View File

@ -97,7 +97,8 @@ void Foam::ReactingParcel<ParcelType>::calcCoupled
// ~~~~~~~~~~~~~~~~~~~~~~
// Calculate phase change
// ~~~~~~~~~~~~~~~~~~~~~~
calcPhaseChange(td, dt, T, dMassMT);
scalarField X = td.cliud().composition().X(0, YMixture_);
calcPhaseChange(td, dt, T, X, dMassMT);
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -229,7 +230,8 @@ void Foam::ReactingParcel<ParcelType>::calcUncoupled
// ~~~~~~~~~~~~~~~~~~~~~~
// Calculate phase change
// ~~~~~~~~~~~~~~~~~~~~~~
calcPhaseChange(td, dt, T, dMassMT);
scalarField X = td.cloud().composition().X(0, YMixture_);
calcPhaseChange(td, dt, T, X, dMassMT);
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -286,6 +288,7 @@ void Foam::ReactingParcel<ParcelType>::calcPhaseChange
TrackData& td,
const scalar dt,
const scalar T,
scalarField& X,
scalarList& dMassMT
)
{
@ -296,35 +299,22 @@ void Foam::ReactingParcel<ParcelType>::calcPhaseChange
// TODO: separate treatment for boiling
/*
// Determine mass to add to carrier phase
const scalar mass = this->mass();
const scalar dMassTot = td.cloud().devolatilisation().calculate
scalar dMassTot = td.cloud().phaseChange().calculate
(
dt,
mass0_,
mass,
td.cloud().composition().YMixture0(),
YMixture_,
T0,
canCombust_
T,
this->d_,
X,
dMassMT,
this->U_ - this->Uc_,
this->Tc_,
pc_,
this->muc_/this->rhoc_,
dt
);
// Update (total) mass fractions
YMixture_[0] = (YMixture_[0]*mass - dMassTot)/(mass - dMassTot);
YMixture_[1] = YMixture_[1]*mass/(mass - dMassTot);
YMixture_[2] = 1.0 - YMixture_[0] - YMixture_[1];
// TODO: Re-calculate mass fractions
// Add to cummulative mass transfer
forAll (YGas_, i)
{
label id = td.cloud().composition().gasGlobalIds()[i];
// Volatiles mass transfer
scalar volatileMass = YGas_[i]*dMassTot;
dMassMT[id] += volatileMass;
}
*/
}

View File

@ -175,6 +175,7 @@ protected:
TrackData& td,
const scalar dt,
const scalar T,
scalarField& X,
scalarList& dMassMT
);

View File

@ -29,7 +29,6 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::phaseProperties::phaseProperties(Istream& is)
:
phase_(UNKNOWN),

View File

@ -241,6 +241,56 @@ const Foam::scalarField& Foam::CompositionModel<CloudType>::Y0
}
template<class CloudType>
Foam::scalarField Foam::CompositionModel<CloudType>::X
(
const label phaseI,
const scalarField& Y
) const
{
const phaseProperties& props = phaseProps_[phaseI];
scalarField X(Y.size(), 0.0);
scalar WInv = 0.0;
switch (props.phase())
{
case phaseProperties::GAS:
{
forAll(Y, i)
{
label gid = props.globalIds()[i];
WInv += Y[i]/this->gases()[gid].W();
X[i] = Y[i]/this->gases()[gid].W();
}
break;
}
case phaseProperties::LIQUID:
{
forAll(Y, i)
{
label gid = props.globalIds()[i];
WInv += Y[i]/this->liquids().properties()[gid].W();
X[i] += Y[i]/this->liquids().properties()[gid].W();
}
break;
}
default:
{
FatalErrorIn
(
"Foam::scalarField Foam::CompositionModel<CloudType>::X\n"
"(\n"
" const label phaseI,\n"
" const scalarField Y\n"
") const"
) << "Only possible to convert gas and liquid mass fractions"
<< nl << abort(FatalError);
}
}
return X/WInv;
}
template<class CloudType>
Foam::scalar Foam::CompositionModel<CloudType>::H
(

View File

@ -187,6 +187,14 @@ public:
//- Return the list of phase phaseI mass fractions
const scalarField& Y0(const label phaseI) const;
//- Return the list of phase phaseI volume fractions fractions
// based on supplied mass fractions Y
scalarField X
(
const label phaseI,
const scalarField& Y
) const;
// Mixture properties

View File

@ -61,8 +61,8 @@ Foam::scalar Foam::NoPhaseChange<CloudType>::calculate
const scalar,
const scalar,
const scalarField&,
const scalarField&,
const vector,
const scalarList&,
const vector&,
const scalar,
const scalar,
const scalar,

View File

@ -79,8 +79,8 @@ public:
const scalar T,
const scalar d,
const scalarField& Xc,
const scalarField& dMassMT,
const vector Ur,
const scalarList& dMassMT,
const vector& Ur,
const scalar Tc,
const scalar pc,
const scalar nuc,

View File

@ -138,8 +138,8 @@ public:
const scalar T,
const scalar d,
const scalarField& Xc,
const scalarField& dMassMT,
const vector Ur,
const scalarList& dMassMT,
const vector& Ur,
const scalar Tc,
const scalar pc,
const scalar nuc,

View File

@ -146,14 +146,16 @@ Foam::scalar Foam::liquidEvaporation<CloudType>::calculate
const scalar T,
const scalar d,
const scalarField& Xc,
const scalarField& dMassMT,
const vector Ur
const scalarList& dMassMT,
const vector& Ur
const scalar Tc,
const scalar pc,
const scalar nuc
const scalar dt,
) const
{
scalar dMassTot = 0.0;
if (T < Tvap_)
{
// not reached temperature threshold
@ -192,9 +194,13 @@ Foam::scalar Foam::liquidEvaporation<CloudType>::calculate
scalar Ni = max(kc*(Cs - Cinf), 0.0);
// mass transfer
dMassMT[i] -= Ni*A*liquids_.properies()[i].W()*dt;
scalar dm = Ni*A*liquids_.properies()[i].W()*dt;
dMassMT[i] -= dm;
dMassTot += dm;
}
}
return dMassTot;
}

View File

@ -111,8 +111,8 @@ public:
const scalar T,
const scalar d,
const scalarField& Xc,
const scalarField& dMassMT,
const vector Ur,
const scalarList& dMassMT,
const vector& Ur,
const scalar Tc,
const scalar pc,
const scalar nuc,