mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -79,8 +79,13 @@ void writeWeights(const polyMesh& mesh)
|
|||||||
|
|
||||||
if (cpp.owner())
|
if (cpp.owner())
|
||||||
{
|
{
|
||||||
|
Info<< "Calculating AMI weights between owner patch: "
|
||||||
|
<< cpp.name() << " and neighbour patch: "
|
||||||
|
<< cpp.neighbPatch().name() << endl;
|
||||||
|
|
||||||
const AMIPatchToPatchInterpolation& ami =
|
const AMIPatchToPatchInterpolation& ami =
|
||||||
cpp.AMI();
|
cpp.AMI();
|
||||||
|
|
||||||
writeWeights
|
writeWeights
|
||||||
(
|
(
|
||||||
ami.tgtWeightsSum(),
|
ami.tgtWeightsSum(),
|
||||||
|
|||||||
@ -28,7 +28,23 @@ Group
|
|||||||
grpRASTurbulence
|
grpRASTurbulence
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Standard k-epsilon turbulence model
|
Mixture k-epsilon turbulence model for two-phase gas-liquid systems
|
||||||
|
|
||||||
|
The basic structure of the model is based on:
|
||||||
|
\verbatim
|
||||||
|
"Modelling of dispersed bubble and droplet ow at high phase fractions"
|
||||||
|
A. Behzadi, R.I. Issa , H. Rusche,
|
||||||
|
Chemical Engineering Science (59) 2004 pp.759-770.
|
||||||
|
\endverbatim
|
||||||
|
|
||||||
|
but an effective density for the gas is used in the averaging and an
|
||||||
|
alternative model for bubble-generated turbulence from:
|
||||||
|
\verbatim
|
||||||
|
"The simulation of multidimensional multiphase flows",
|
||||||
|
Lahey R.T.,
|
||||||
|
Nucl. Eng. & Design
|
||||||
|
(235) 2005 pp.1043-1060.
|
||||||
|
\endverbatim
|
||||||
|
|
||||||
The default model coefficients correspond to the following:
|
The default model coefficients correspond to the following:
|
||||||
\verbatim
|
\verbatim
|
||||||
@ -37,7 +53,7 @@ Description
|
|||||||
Cmu 0.09;
|
Cmu 0.09;
|
||||||
C1 1.44;
|
C1 1.44;
|
||||||
C2 1.92;
|
C2 1.92;
|
||||||
C3 -0.33;
|
C3 C2;
|
||||||
sigmak 1.0;
|
sigmak 1.0;
|
||||||
sigmaEps 1.3;
|
sigmaEps 1.3;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -511,7 +511,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calcDevolatilisation
|
|||||||
if
|
if
|
||||||
(
|
(
|
||||||
!td.cloud().devolatilisation().active()
|
!td.cloud().devolatilisation().active()
|
||||||
|| T < td.cloud().constProps().Tvap()
|
|| T < td.cloud().constProps().TDevol()
|
||||||
|| canCombust == -1
|
|| canCombust == -1
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -81,6 +81,9 @@ public:
|
|||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
|
//- Devolatilisation activation temperature [K]
|
||||||
|
scalar TDevol_;
|
||||||
|
|
||||||
//- Latent heat of devolatilisation [J/kg]
|
//- Latent heat of devolatilisation [J/kg]
|
||||||
scalar LDevol_;
|
scalar LDevol_;
|
||||||
|
|
||||||
@ -106,9 +109,32 @@ public:
|
|||||||
const bool readFields = true
|
const bool readFields = true
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//- Construct from components
|
||||||
|
constantProperties
|
||||||
|
(
|
||||||
|
const label parcelTypeId,
|
||||||
|
const scalar rhoMin,
|
||||||
|
const scalar rho0,
|
||||||
|
const scalar minParticleMass,
|
||||||
|
const scalar youngsModulus,
|
||||||
|
const scalar poissonsRatio,
|
||||||
|
const scalar T0,
|
||||||
|
const scalar TMin,
|
||||||
|
const scalar TMax,
|
||||||
|
const scalar Cp0,
|
||||||
|
const scalar epsilon0,
|
||||||
|
const scalar f0,
|
||||||
|
const scalar Pr,
|
||||||
|
const scalar pMin,
|
||||||
|
const Switch& constantVolume,
|
||||||
|
const scalar TDevol
|
||||||
|
);
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
|
//- Return const access to the devolatilisation temperature
|
||||||
|
inline scalar TDevol() const;
|
||||||
|
|
||||||
//- Return const access to the latent heat of devolatilisation
|
//- Return const access to the latent heat of devolatilisation
|
||||||
inline scalar LDevol() const;
|
inline scalar LDevol() const;
|
||||||
|
|
||||||
|
|||||||
@ -30,6 +30,7 @@ inline Foam::ReactingMultiphaseParcel<ParcelType>::constantProperties::
|
|||||||
constantProperties()
|
constantProperties()
|
||||||
:
|
:
|
||||||
ParcelType::constantProperties(),
|
ParcelType::constantProperties(),
|
||||||
|
TDevol_(0.0),
|
||||||
LDevol_(0.0),
|
LDevol_(0.0),
|
||||||
hRetentionCoeff_(0.0)
|
hRetentionCoeff_(0.0)
|
||||||
{}
|
{}
|
||||||
@ -43,6 +44,7 @@ constantProperties
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
ParcelType::constantProperties(cp),
|
ParcelType::constantProperties(cp),
|
||||||
|
TDevol_(cp.TDevol_),
|
||||||
LDevol_(cp.LDevol_),
|
LDevol_(cp.LDevol_),
|
||||||
hRetentionCoeff_(cp.hRetentionCoeff_)
|
hRetentionCoeff_(cp.hRetentionCoeff_)
|
||||||
{}
|
{}
|
||||||
@ -57,11 +59,13 @@ constantProperties
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
ParcelType::constantProperties(parentDict, readFields),
|
ParcelType::constantProperties(parentDict, readFields),
|
||||||
|
TDevol_(0.0),
|
||||||
LDevol_(0.0),
|
LDevol_(0.0),
|
||||||
hRetentionCoeff_(0.0)
|
hRetentionCoeff_(0.0)
|
||||||
{
|
{
|
||||||
if (readFields)
|
if (readFields)
|
||||||
{
|
{
|
||||||
|
this->dict().lookup("TDevol") >> TDevol_;
|
||||||
this->dict().lookup("LDevol") >> LDevol_;
|
this->dict().lookup("LDevol") >> LDevol_;
|
||||||
this->dict().lookup("hRetentionCoeff") >> hRetentionCoeff_;
|
this->dict().lookup("hRetentionCoeff") >> hRetentionCoeff_;
|
||||||
|
|
||||||
@ -80,6 +84,50 @@ constantProperties
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ParcelType>
|
||||||
|
inline Foam::ReactingMultiphaseParcel<ParcelType>::constantProperties::
|
||||||
|
constantProperties
|
||||||
|
(
|
||||||
|
const label parcelTypeId,
|
||||||
|
const scalar rhoMin,
|
||||||
|
const scalar rho0,
|
||||||
|
const scalar minParticleMass,
|
||||||
|
const scalar youngsModulus,
|
||||||
|
const scalar poissonsRatio,
|
||||||
|
const scalar T0,
|
||||||
|
const scalar TMin,
|
||||||
|
const scalar TMax,
|
||||||
|
const scalar Cp0,
|
||||||
|
const scalar epsilon0,
|
||||||
|
const scalar f0,
|
||||||
|
const scalar Pr,
|
||||||
|
const scalar pMin,
|
||||||
|
const Switch& constantVolume,
|
||||||
|
const scalar TDevol
|
||||||
|
)
|
||||||
|
:
|
||||||
|
ParcelType::constantProperties
|
||||||
|
(
|
||||||
|
parcelTypeId,
|
||||||
|
rhoMin,
|
||||||
|
rho0,
|
||||||
|
minParticleMass,
|
||||||
|
youngsModulus,
|
||||||
|
poissonsRatio,
|
||||||
|
T0,
|
||||||
|
TMin,
|
||||||
|
TMax,
|
||||||
|
Cp0,
|
||||||
|
epsilon0,
|
||||||
|
f0,
|
||||||
|
Pr,
|
||||||
|
pMin,
|
||||||
|
constantVolume
|
||||||
|
),
|
||||||
|
TDevol_(TDevol)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
template<class ParcelType>
|
template<class ParcelType>
|
||||||
inline Foam::ReactingMultiphaseParcel<ParcelType>::ReactingMultiphaseParcel
|
inline Foam::ReactingMultiphaseParcel<ParcelType>::ReactingMultiphaseParcel
|
||||||
(
|
(
|
||||||
@ -148,6 +196,14 @@ inline Foam::ReactingMultiphaseParcel<ParcelType>::ReactingMultiphaseParcel
|
|||||||
|
|
||||||
// * * * * * * * * * constantProperties Member Functions * * * * * * * * * * //
|
// * * * * * * * * * constantProperties Member Functions * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class ParcelType>
|
||||||
|
inline Foam::scalar
|
||||||
|
Foam::ReactingMultiphaseParcel<ParcelType>::constantProperties::TDevol() const
|
||||||
|
{
|
||||||
|
return TDevol_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class ParcelType>
|
template<class ParcelType>
|
||||||
inline Foam::scalar
|
inline Foam::scalar
|
||||||
Foam::ReactingMultiphaseParcel<ParcelType>::constantProperties::LDevol() const
|
Foam::ReactingMultiphaseParcel<ParcelType>::constantProperties::LDevol() const
|
||||||
|
|||||||
@ -26,6 +26,7 @@ License
|
|||||||
#include "ReactingParcel.H"
|
#include "ReactingParcel.H"
|
||||||
#include "specie.H"
|
#include "specie.H"
|
||||||
#include "CompositionModel.H"
|
#include "CompositionModel.H"
|
||||||
|
#include "PhaseChangeModel.H"
|
||||||
#include "mathematicalConstants.H"
|
#include "mathematicalConstants.H"
|
||||||
|
|
||||||
using namespace Foam::constant::mathematical;
|
using namespace Foam::constant::mathematical;
|
||||||
@ -56,26 +57,22 @@ void Foam::ReactingParcel<ParcelType>::calcPhaseChange
|
|||||||
scalarField& Cs
|
scalarField& Cs
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if
|
typedef typename TrackData::cloudType::reactingCloudType reactingCloudType;
|
||||||
(
|
PhaseChangeModel<reactingCloudType>& phaseChange = td.cloud().phaseChange();
|
||||||
!td.cloud().phaseChange().active()
|
|
||||||
|| T < td.cloud().constProps().Tvap()
|
scalar Tvap = phaseChange.Tvap(YComponents);
|
||||||
|| YPhase < SMALL
|
|
||||||
)
|
if (!phaseChange.active() || T < Tvap || YPhase < SMALL)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef typename TrackData::cloudType::reactingCloudType reactingCloudType;
|
const scalar TMax = phaseChange.TMax(pc_, YComponents);
|
||||||
const CompositionModel<reactingCloudType>& composition =
|
|
||||||
td.cloud().composition();
|
|
||||||
|
|
||||||
const scalar TMax = td.cloud().phaseChange().TMax(pc_);
|
|
||||||
const scalar Tdash = min(T, TMax);
|
const scalar Tdash = min(T, TMax);
|
||||||
const scalar Tsdash = min(Ts, TMax);
|
const scalar Tsdash = min(Ts, TMax);
|
||||||
|
|
||||||
// Calculate mass transfer due to phase change
|
// Calculate mass transfer due to phase change
|
||||||
td.cloud().phaseChange().calculate
|
phaseChange.calculate
|
||||||
(
|
(
|
||||||
dt,
|
dt,
|
||||||
cellI,
|
cellI,
|
||||||
@ -97,14 +94,17 @@ void Foam::ReactingParcel<ParcelType>::calcPhaseChange
|
|||||||
const scalar dMassTot = sum(dMassPC);
|
const scalar dMassTot = sum(dMassPC);
|
||||||
|
|
||||||
// Add to cumulative phase change mass
|
// Add to cumulative phase change mass
|
||||||
td.cloud().phaseChange().addToPhaseChangeMass(this->nParticle_*dMassTot);
|
phaseChange.addToPhaseChangeMass(this->nParticle_*dMassTot);
|
||||||
|
|
||||||
|
const CompositionModel<reactingCloudType>& composition =
|
||||||
|
td.cloud().composition();
|
||||||
|
|
||||||
forAll(dMassPC, i)
|
forAll(dMassPC, i)
|
||||||
{
|
{
|
||||||
const label idc = composition.localToGlobalCarrierId(idPhase, i);
|
const label idc = composition.localToGlobalCarrierId(idPhase, i);
|
||||||
const label idl = composition.globalIds(idPhase)[i];
|
const label idl = composition.globalIds(idPhase)[i];
|
||||||
|
|
||||||
const scalar dh = td.cloud().phaseChange().dh(idc, idl, pc_, Tdash);
|
const scalar dh = phaseChange.dh(idc, idl, pc_, Tdash);
|
||||||
Sh -= dMassPC[i]*dh/dt;
|
Sh -= dMassPC[i]*dh/dt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -80,9 +80,6 @@ public:
|
|||||||
//- Constant volume flag - e.g. during mass transfer
|
//- Constant volume flag - e.g. during mass transfer
|
||||||
Switch constantVolume_;
|
Switch constantVolume_;
|
||||||
|
|
||||||
//- Vaporisation temperature [K]
|
|
||||||
scalar Tvap_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -118,8 +115,7 @@ public:
|
|||||||
const scalar f0,
|
const scalar f0,
|
||||||
const scalar Pr,
|
const scalar Pr,
|
||||||
const scalar pMin,
|
const scalar pMin,
|
||||||
const Switch& constantVolume,
|
const Switch& constantVolume
|
||||||
const scalar Tvap
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -130,9 +126,6 @@ public:
|
|||||||
|
|
||||||
//- Return const access to the constant volume flag
|
//- Return const access to the constant volume flag
|
||||||
inline Switch constantVolume() const;
|
inline Switch constantVolume() const;
|
||||||
|
|
||||||
//- Return const access to the vaporisation temperature
|
|
||||||
inline scalar Tvap() const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -31,8 +31,7 @@ Foam::ReactingParcel<ParcelType>::constantProperties::constantProperties()
|
|||||||
:
|
:
|
||||||
ParcelType::constantProperties(),
|
ParcelType::constantProperties(),
|
||||||
pMin_(0.0),
|
pMin_(0.0),
|
||||||
constantVolume_(false),
|
constantVolume_(false)
|
||||||
Tvap_(0.0)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -44,8 +43,7 @@ inline Foam::ReactingParcel<ParcelType>::constantProperties::constantProperties
|
|||||||
:
|
:
|
||||||
ParcelType::constantProperties(cp),
|
ParcelType::constantProperties(cp),
|
||||||
pMin_(cp.pMin_),
|
pMin_(cp.pMin_),
|
||||||
constantVolume_(cp.constantVolume_),
|
constantVolume_(cp.constantVolume_)
|
||||||
Tvap_(cp.Tvap_)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -58,8 +56,7 @@ inline Foam::ReactingParcel<ParcelType>::constantProperties::constantProperties
|
|||||||
:
|
:
|
||||||
ParcelType::constantProperties(parentDict, readFields),
|
ParcelType::constantProperties(parentDict, readFields),
|
||||||
pMin_(1000.0),
|
pMin_(1000.0),
|
||||||
constantVolume_(false),
|
constantVolume_(false)
|
||||||
Tvap_(0.0)
|
|
||||||
{
|
{
|
||||||
if (readFields)
|
if (readFields)
|
||||||
{
|
{
|
||||||
@ -69,7 +66,6 @@ inline Foam::ReactingParcel<ParcelType>::constantProperties::constantProperties
|
|||||||
}
|
}
|
||||||
|
|
||||||
this->dict().lookup("constantVolume") >> constantVolume_;
|
this->dict().lookup("constantVolume") >> constantVolume_;
|
||||||
this->dict().lookup("Tvap") >> Tvap_;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,8 +87,7 @@ inline Foam::ReactingParcel<ParcelType>::constantProperties::constantProperties
|
|||||||
const scalar f0,
|
const scalar f0,
|
||||||
const scalar Pr,
|
const scalar Pr,
|
||||||
const scalar pMin,
|
const scalar pMin,
|
||||||
const Switch& constantVolume,
|
const Switch& constantVolume
|
||||||
const scalar Tvap
|
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
ParcelType::constantProperties
|
ParcelType::constantProperties
|
||||||
@ -112,8 +107,7 @@ inline Foam::ReactingParcel<ParcelType>::constantProperties::constantProperties
|
|||||||
Pr
|
Pr
|
||||||
),
|
),
|
||||||
pMin_(pMin),
|
pMin_(pMin),
|
||||||
constantVolume_(constantVolume),
|
constantVolume_(constantVolume)
|
||||||
Tvap_(Tvap)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -198,14 +192,6 @@ Foam::ReactingParcel<ParcelType>::constantProperties::constantVolume() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class ParcelType>
|
|
||||||
inline Foam::scalar
|
|
||||||
Foam::ReactingParcel<ParcelType>::constantProperties::Tvap() const
|
|
||||||
{
|
|
||||||
return Tvap_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * ThermoParcel Member Functions * * * * * * * * * * * * //
|
// * * * * * * * * * * ThermoParcel Member Functions * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class ParcelType>
|
template<class ParcelType>
|
||||||
|
|||||||
@ -151,6 +151,44 @@ void Foam::LiquidEvaporation<CloudType>::calculate
|
|||||||
scalarField& dMassPC
|
scalarField& dMassPC
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
|
// liquid volume fraction
|
||||||
|
const scalarField X(liquids_.X(Yl));
|
||||||
|
|
||||||
|
// immediately evaporate mass that has reached critical condition
|
||||||
|
if (mag(T - liquids_.Tc(X)) < SMALL)
|
||||||
|
{
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
WarningIn
|
||||||
|
(
|
||||||
|
"void Foam::LiquidEvaporation<CloudType>::calculate"
|
||||||
|
"("
|
||||||
|
"const scalar, "
|
||||||
|
"const label, "
|
||||||
|
"const scalar, "
|
||||||
|
"const scalar, "
|
||||||
|
"const scalar, "
|
||||||
|
"const scalar, "
|
||||||
|
"const scalar, "
|
||||||
|
"const scalar, "
|
||||||
|
"const scalar, "
|
||||||
|
"const scalar, "
|
||||||
|
"const scalarField&, "
|
||||||
|
"scalarField&"
|
||||||
|
") const"
|
||||||
|
) << "Parcel reached critical conditions: "
|
||||||
|
<< "evaporating all avaliable mass" << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
forAll(activeLiquids_, i)
|
||||||
|
{
|
||||||
|
const label lid = liqToLiqMap_[i];
|
||||||
|
dMassPC[lid] = GREAT;
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// construct carrier phase species volume fractions for cell, cellI
|
// construct carrier phase species volume fractions for cell, cellI
|
||||||
const scalarField Xc(calcXc(cellI));
|
const scalarField Xc(calcXc(cellI));
|
||||||
|
|
||||||
@ -242,9 +280,27 @@ Foam::scalar Foam::LiquidEvaporation<CloudType>::dh
|
|||||||
|
|
||||||
|
|
||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
Foam::scalar Foam::LiquidEvaporation<CloudType>::TMax(const scalar pIn) const
|
Foam::scalar Foam::LiquidEvaporation<CloudType>::Tvap
|
||||||
|
(
|
||||||
|
const scalarField& Y
|
||||||
|
) const
|
||||||
{
|
{
|
||||||
return liquids_.TMax(pIn);
|
const scalarField X(liquids_.X(Y));
|
||||||
|
|
||||||
|
return liquids_.Tpt(X);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class CloudType>
|
||||||
|
Foam::scalar Foam::LiquidEvaporation<CloudType>::TMax
|
||||||
|
(
|
||||||
|
const scalar p,
|
||||||
|
const scalarField& Y
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
const scalarField X(liquids_.X(Y));
|
||||||
|
|
||||||
|
return liquids_.pvInvert(p, X);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -131,8 +131,11 @@ public:
|
|||||||
const scalar T
|
const scalar T
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
//- Return vapourisation temperature
|
||||||
|
virtual scalar Tvap(const scalarField& Y) const;
|
||||||
|
|
||||||
//- Return maximum/limiting temperature
|
//- Return maximum/limiting temperature
|
||||||
virtual scalar TMax(const scalar pIn) const;
|
virtual scalar TMax(const scalar p, const scalarField& Y) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -151,18 +151,53 @@ void Foam::LiquidEvaporationBoil<CloudType>::calculate
|
|||||||
scalarField& dMassPC
|
scalarField& dMassPC
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
// construct carrier phase species volume fractions for cell, cellI
|
|
||||||
const scalarField XcMix(calcXc(cellI));
|
|
||||||
|
|
||||||
// liquid volume fraction
|
// liquid volume fraction
|
||||||
const scalarField X(liquids_.X(Yl));
|
const scalarField X(liquids_.X(Yl));
|
||||||
|
|
||||||
|
// immediately evaporate mass that has reached critical condition
|
||||||
|
if (mag(T - liquids_.Tc(X)) < SMALL)
|
||||||
|
{
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
WarningIn
|
||||||
|
(
|
||||||
|
"void Foam::LiquidEvaporationBoil<CloudType>::calculate"
|
||||||
|
"("
|
||||||
|
"const scalar, "
|
||||||
|
"const label, "
|
||||||
|
"const scalar, "
|
||||||
|
"const scalar, "
|
||||||
|
"const scalar, "
|
||||||
|
"const scalar, "
|
||||||
|
"const scalar, "
|
||||||
|
"const scalar, "
|
||||||
|
"const scalar, "
|
||||||
|
"const scalar, "
|
||||||
|
"const scalarField&, "
|
||||||
|
"scalarField&"
|
||||||
|
") const"
|
||||||
|
) << "Parcel reached critical conditions: "
|
||||||
|
<< "evaporating all avaliable mass" << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
forAll(activeLiquids_, i)
|
||||||
|
{
|
||||||
|
const label lid = liqToLiqMap_[i];
|
||||||
|
dMassPC[lid] = GREAT;
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// droplet surface pressure assumed to surface vapour pressure
|
// droplet surface pressure assumed to surface vapour pressure
|
||||||
scalar ps = liquids_.pv(pc, Ts, X);
|
scalar ps = liquids_.pv(pc, Ts, X);
|
||||||
|
|
||||||
// vapour density at droplet surface [kg/m3]
|
// vapour density at droplet surface [kg/m3]
|
||||||
scalar rhos = ps*liquids_.W(X)/(specie::RR*Ts);
|
scalar rhos = ps*liquids_.W(X)/(specie::RR*Ts);
|
||||||
|
|
||||||
|
// construct carrier phase species volume fractions for cell, cellI
|
||||||
|
const scalarField XcMix(calcXc(cellI));
|
||||||
|
|
||||||
// carrier thermo properties
|
// carrier thermo properties
|
||||||
scalar Hsc = 0.0;
|
scalar Hsc = 0.0;
|
||||||
scalar Hc = 0.0;
|
scalar Hc = 0.0;
|
||||||
@ -341,12 +376,27 @@ Foam::scalar Foam::LiquidEvaporationBoil<CloudType>::dh
|
|||||||
|
|
||||||
|
|
||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
Foam::scalar Foam::LiquidEvaporationBoil<CloudType>::TMax
|
Foam::scalar Foam::LiquidEvaporationBoil<CloudType>::Tvap
|
||||||
(
|
(
|
||||||
const scalar pIn
|
const scalarField& Y
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return liquids_.TMax(pIn);
|
const scalarField X(liquids_.X(Y));
|
||||||
|
|
||||||
|
return liquids_.Tpt(X);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class CloudType>
|
||||||
|
Foam::scalar Foam::LiquidEvaporationBoil<CloudType>::TMax
|
||||||
|
(
|
||||||
|
const scalar p,
|
||||||
|
const scalarField& Y
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
const scalarField X(liquids_.X(Y));
|
||||||
|
|
||||||
|
return liquids_.pvInvert(p, X);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -141,8 +141,11 @@ public:
|
|||||||
const scalar T
|
const scalar T
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
//- Return vapourisation temperature
|
||||||
|
virtual scalar Tvap(const scalarField& Y) const;
|
||||||
|
|
||||||
//- Return maximum/limiting temperature
|
//- Return maximum/limiting temperature
|
||||||
virtual scalar TMax(const scalar pIn) const;
|
virtual scalar TMax(const scalar p, const scalarField& Y) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -179,12 +179,23 @@ Foam::scalar Foam::PhaseChangeModel<CloudType>::dh
|
|||||||
|
|
||||||
|
|
||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
Foam::scalar Foam::PhaseChangeModel<CloudType>::TMax(const scalar) const
|
Foam::scalar Foam::PhaseChangeModel<CloudType>::TMax
|
||||||
|
(
|
||||||
|
const scalar,
|
||||||
|
const scalarField&
|
||||||
|
) const
|
||||||
{
|
{
|
||||||
return GREAT;
|
return GREAT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class CloudType>
|
||||||
|
Foam::scalar Foam::PhaseChangeModel<CloudType>::Tvap(const scalarField& Y) const
|
||||||
|
{
|
||||||
|
return -GREAT;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
void Foam::PhaseChangeModel<CloudType>::addToPhaseChangeMass(const scalar dMass)
|
void Foam::PhaseChangeModel<CloudType>::addToPhaseChangeMass(const scalar dMass)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -184,8 +184,11 @@ public:
|
|||||||
const scalar T
|
const scalar T
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
//- Return vapourisation temperature
|
||||||
|
virtual scalar Tvap(const scalarField& Y) const;
|
||||||
|
|
||||||
//- Return maximum/limiting temperature
|
//- Return maximum/limiting temperature
|
||||||
virtual scalar TMax(const scalar pIn) const;
|
virtual scalar TMax(const scalar p, const scalarField& Y) const;
|
||||||
|
|
||||||
//- Add to phase change mass
|
//- Add to phase change mass
|
||||||
void addToPhaseChangeMass(const scalar dMass);
|
void addToPhaseChangeMass(const scalar dMass);
|
||||||
|
|||||||
@ -64,47 +64,62 @@ void Foam::SprayParcel<ParcelType>::calc
|
|||||||
const label cellI
|
const label cellI
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
typedef typename TrackData::cloudType::reactingCloudType reactingCloudType;
|
||||||
|
const CompositionModel<reactingCloudType>& composition =
|
||||||
|
td.cloud().composition();
|
||||||
|
|
||||||
bool coupled = td.cloud().solution().coupled();
|
bool coupled = td.cloud().solution().coupled();
|
||||||
|
|
||||||
// check if parcel belongs to liquid core
|
// check if parcel belongs to liquid core
|
||||||
if (liquidCore() > 0.5)
|
if (liquidCore() > 0.5)
|
||||||
{
|
{
|
||||||
// liquid core parcels should not interact with the gas
|
// liquid core parcels should not interact with the gas
|
||||||
if (td.cloud().solution().coupled())
|
td.cloud().solution().coupled() = false;
|
||||||
{
|
}
|
||||||
td.cloud().solution().coupled() = false;
|
|
||||||
}
|
// get old mixture composition
|
||||||
|
const scalarField& Y0(this->Y());
|
||||||
|
scalarField X0(composition.liquids().X(Y0));
|
||||||
|
|
||||||
|
// check if we have critical or boiling conditions
|
||||||
|
scalar TMax = composition.liquids().Tc(X0);
|
||||||
|
const scalar T0 = this->T();
|
||||||
|
const scalar pc0 = this->pc_;
|
||||||
|
if (composition.liquids().pv(pc0, T0, X0) >= pc0*0.999)
|
||||||
|
{
|
||||||
|
// set TMax to boiling temperature
|
||||||
|
TMax = composition.liquids().pvInvert(pc0, X0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// set the maximum temperature limit
|
// set the maximum temperature limit
|
||||||
const scalar TMax = td.cloud().composition().liquids().TMax(this->pc_);
|
|
||||||
td.cloud().constProps().TMax() = TMax;
|
td.cloud().constProps().TMax() = TMax;
|
||||||
|
|
||||||
// store the parcel properties
|
// store the parcel properties
|
||||||
const scalarField& Y(this->Y());
|
const scalarField& Y(this->Y());
|
||||||
scalarField X(td.cloud().composition().liquids().X(Y));
|
scalarField X(composition.liquids().X(Y));
|
||||||
|
|
||||||
scalar T0 = this->T();
|
this->Cp() = composition.liquids().Cp(this->pc_, T0, X);
|
||||||
this->Cp() = td.cloud().composition().liquids().Cp(this->pc_, T0, X);
|
sigma_ = composition.liquids().sigma(this->pc_, T0, X);
|
||||||
sigma_ = td.cloud().composition().liquids().sigma(this->pc_, T0, X);
|
scalar rho0 = composition.liquids().rho(this->pc_, T0, X);
|
||||||
scalar rho0 = td.cloud().composition().liquids().rho(this->pc_, T0, X);
|
|
||||||
this->rho() = rho0;
|
this->rho() = rho0;
|
||||||
|
|
||||||
ParcelType::calc(td, dt, cellI);
|
ParcelType::calc(td, dt, cellI);
|
||||||
|
|
||||||
if (td.keepParticle)
|
if (td.keepParticle)
|
||||||
{
|
{
|
||||||
// update Cp, sigma, diameter and density due to change in temperature
|
// update Cp, sigma, density and diameter due to change in temperature
|
||||||
// and/or composition
|
// and/or composition
|
||||||
scalar T1 = this->T();
|
scalar T1 = this->T();
|
||||||
const scalarField& Y1(this->Y());
|
const scalarField& Y1(this->Y());
|
||||||
scalarField X1(td.cloud().composition().liquids().X(Y1));
|
scalarField X1(composition.liquids().X(Y1));
|
||||||
|
|
||||||
this->Cp() = td.cloud().composition().liquids().Cp(this->pc_, T1, X1);
|
this->Cp() = composition.liquids().Cp(this->pc_, T1, X1);
|
||||||
sigma_ = td.cloud().composition().liquids().sigma(this->pc_, T1, X);
|
|
||||||
|
|
||||||
scalar rho1 = td.cloud().composition().liquids().rho(this->pc_, T1, X1);
|
sigma_ = composition.liquids().sigma(this->pc_, T1, X);
|
||||||
|
|
||||||
|
scalar rho1 = composition.liquids().rho(this->pc_, T1, X1);
|
||||||
this->rho() = rho1;
|
this->rho() = rho1;
|
||||||
|
|
||||||
scalar d1 = this->d()*cbrt(rho0/rho1);
|
scalar d1 = this->d()*cbrt(rho0/rho1);
|
||||||
this->d() = d1;
|
this->d() = d1;
|
||||||
|
|
||||||
|
|||||||
@ -103,12 +103,62 @@ Foam::scalar Foam::liquidMixtureProperties::Tc(const scalarField& x) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::scalar Foam::liquidMixtureProperties::TMax(const scalar p) const
|
Foam::scalar Foam::liquidMixtureProperties::Tpt(const scalarField& x) const
|
||||||
{
|
{
|
||||||
scalar T = -GREAT;
|
scalar Tpt = 0.0;
|
||||||
forAll(properties_, i)
|
forAll(properties_, i)
|
||||||
{
|
{
|
||||||
T = max(T, properties_[i].pvInvert(p));
|
Tpt += x[i]*properties_[i].Tt();
|
||||||
|
}
|
||||||
|
|
||||||
|
return Tpt;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalar Foam::liquidMixtureProperties::pvInvert
|
||||||
|
(
|
||||||
|
const scalar p,
|
||||||
|
const scalarField& x
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
// Set upper and lower bounds
|
||||||
|
scalar Thi = Tc(x);
|
||||||
|
scalar Tlo = Tpt(x);
|
||||||
|
|
||||||
|
// Check for critical and solid phase conditions
|
||||||
|
if (p >= pv(p, Thi, x))
|
||||||
|
{
|
||||||
|
return Thi;
|
||||||
|
}
|
||||||
|
else if (p < pv(p, Tlo, x))
|
||||||
|
{
|
||||||
|
WarningIn
|
||||||
|
(
|
||||||
|
"Foam::scalar Foam::liquidMixtureProperties::pvInvert"
|
||||||
|
"("
|
||||||
|
" const scalar,"
|
||||||
|
" const scalarField&"
|
||||||
|
") const"
|
||||||
|
) << "Pressure below triple point pressure: "
|
||||||
|
<< "p = " << p << " < Pt = " << pv(p, Tlo, x) << nl << endl;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set initial guess
|
||||||
|
scalar T = (Thi + Tlo)*0.5;
|
||||||
|
|
||||||
|
while ((Thi - Tlo) > 1.0e-4)
|
||||||
|
{
|
||||||
|
if ((pv(p, T, x) - p) <= 0.0)
|
||||||
|
{
|
||||||
|
Tlo = T;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Thi = T;
|
||||||
|
}
|
||||||
|
|
||||||
|
T = (Thi + Tlo)*0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
return T;
|
return T;
|
||||||
|
|||||||
@ -141,8 +141,9 @@ public:
|
|||||||
//- Calculate the critical temperature of mixture
|
//- Calculate the critical temperature of mixture
|
||||||
scalar Tc(const scalarField& x) const;
|
scalar Tc(const scalarField& x) const;
|
||||||
|
|
||||||
//- Calculate the maximum temperature of mixture at given pressure
|
//- Invert the vapour pressure relationship to retrieve the boiling
|
||||||
scalar TMax(const scalar p) const;
|
// temperature of the mixture as a function of pressure
|
||||||
|
scalar pvInvert(const scalar p, const scalarField& x) const;
|
||||||
|
|
||||||
//- Return pseudocritical temperature according to Kay's rule
|
//- Return pseudocritical temperature according to Kay's rule
|
||||||
scalar Tpc(const scalarField& x) const;
|
scalar Tpc(const scalarField& x) const;
|
||||||
@ -150,6 +151,9 @@ public:
|
|||||||
//- Return pseudocritical pressure (modified Prausnitz and Gunn)
|
//- Return pseudocritical pressure (modified Prausnitz and Gunn)
|
||||||
scalar Ppc(const scalarField& x) const;
|
scalar Ppc(const scalarField& x) const;
|
||||||
|
|
||||||
|
//- Return pseudo triple point temperature (mole averaged formulation)
|
||||||
|
scalar Tpt(const scalarField& x) const;
|
||||||
|
|
||||||
//- Return mixture accentric factor
|
//- Return mixture accentric factor
|
||||||
scalar omega(const scalarField& x) const;
|
scalar omega(const scalarField& x) const;
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -252,7 +252,7 @@ public:
|
|||||||
virtual scalar D(scalar p, scalar T, scalar Wb) const;
|
virtual scalar D(scalar p, scalar T, scalar Wb) const;
|
||||||
|
|
||||||
//- Invert the vapour pressure relationship to retrieve the
|
//- Invert the vapour pressure relationship to retrieve the
|
||||||
// boiling temperuture as a function of temperature
|
// boiling temperuture as a function of pressure
|
||||||
virtual scalar pvInvert(scalar p) const;
|
virtual scalar pvInvert(scalar p) const;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user