Updates to phase change model and ethalpy coupling

- Using parcel chemical enthalpy to update cloud chemical enthalpy transfer
  instead of total parcel enthalpy.
- Added functionality to allow enthalpy transfer to be user-controlled,
  either using latent heat, or instanteous enthalpy difference
This commit is contained in:
andy
2009-12-10 15:09:18 +00:00
parent d058c7ceb8
commit 7a46fea0d0
4 changed files with 108 additions and 12 deletions

View File

@ -344,7 +344,7 @@ void Foam::ReactingParcel<ParcelType>::calc
td.cloud().hcTrans()[cellI] +=
np0
*dMassPC[i]
*td.cloud().mcCarrierThermo().speciesData()[gid].H(T0);
*td.cloud().mcCarrierThermo().speciesData()[gid].Hc();
}
// Update momentum transfer
@ -423,6 +423,11 @@ void Foam::ReactingParcel<ParcelType>::calcPhaseChange
scalarField& Cs
)
{
typedef PhaseChangeModel
<
typename ReactingParcel<ParcelType>::trackData::cloudType
> phaseChangeModelType;
if
(
!td.cloud().phaseChange().active()
@ -464,17 +469,26 @@ void Foam::ReactingParcel<ParcelType>::calcPhaseChange
td.cloud().composition().localToGlobalCarrierId(idPhase, i);
const label idl = td.cloud().composition().globalIds(idPhase)[i];
const scalar hv = td.cloud().mcCarrierThermo().speciesData()[idc].H(Ts);
const scalar hl =
td.cloud().composition().liquids().properties()[idl].h(pc_, Ts);
if
(
td.cloud().phaseChange().enthalpyTransfer()
== phaseChangeModelType::etLatentHeat
)
{
scalar hlp =
td.cloud().composition().liquids().properties()[idl].hl(pc_, T);
// Enthalphy transfer to carrier phase - method 1 using enthalpy diff
Sh += dMassPC[i]*(hl - hv)/dt;
Sh -= dMassPC[i]*hlp/dt;
}
else
{
// Note: enthalpies of both phases must use the same reference
scalar hc = td.cloud().mcCarrierThermo().speciesData()[idc].H(T);
scalar hp =
td.cloud().composition().liquids().properties()[idl].h(pc_, T);
// Enthalphy transfer to carrier phase - method 2 using latent heat
// const scalar hl =
// td.cloud().composition().liquids().properties()[idl].hl(pc_, Ts);
// Sh -= dMassPC[i]*hl/dt;
Sh -= dMassPC[i]*(hc - hp)/dt;
}
// Update particle surface thermo properties
const scalar Dab =

View File

@ -136,6 +136,9 @@ public:
public:
typedef ReactingCloud<ParcelType> cloudType;
// Constructors
//- Construct from components

View File

@ -26,6 +26,48 @@ License
#include "PhaseChangeModel.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template<class CloudType>
const Foam::wordList Foam::PhaseChangeModel<CloudType>::
enthalpyTransferTypeNames
(
IStringStream
(
"("
"latentHeat "
"enthalpyDifference"
")"
)()
);
// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
template<class CloudType>
typename Foam::PhaseChangeModel<CloudType>::enthalpyTransferType
Foam::PhaseChangeModel<CloudType>::wordToEnthalpyTransfer(const word& etName)
const
{
forAll(enthalpyTransferTypeNames, i)
{
if (etName == enthalpyTransferTypeNames[i])
{
return enthalpyTransferType(i);
}
}
FatalErrorIn
(
"PhaseChangeModel<CloudType>::enthalpyTransferType"
"PhaseChangeModel<CloudType>::wordToEnthalpyTransfer(const word&) const"
) << "Unknown enthalpyType " << etName << ". Valid selections are:" << nl
<< enthalpyTransferTypeNames << exit(FatalError);
return enthalpyTransferType(0);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CloudType>
@ -36,7 +78,8 @@ Foam::PhaseChangeModel<CloudType>::PhaseChangeModel
:
dict_(dictionary::null),
owner_(owner),
coeffDict_(dictionary::null)
coeffDict_(dictionary::null),
enthalpyTransfer_(etLatentHeat)
{}
@ -50,7 +93,11 @@ Foam::PhaseChangeModel<CloudType>::PhaseChangeModel
:
dict_(dict),
owner_(owner),
coeffDict_(dict.subDict(type + "Coeffs"))
coeffDict_(dict.subDict(type + "Coeffs")),
enthalpyTransfer_
(
wordToEnthalpyTransfer(coeffDict_.lookup("enthalpyTransfer"))
)
{}
@ -83,6 +130,14 @@ const Foam::dictionary& Foam::PhaseChangeModel<CloudType>::coeffDict() const
}
template<class CloudType>
const typename Foam::PhaseChangeModel<CloudType>::enthalpyTransferType&
Foam::PhaseChangeModel<CloudType>::enthalpyTransfer() const
{
return enthalpyTransfer_;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "NewPhaseChangeModel.C"

View File

@ -53,6 +53,21 @@ namespace Foam
template<class CloudType>
class PhaseChangeModel
{
public:
// Public enumerations
//- Enthalpy transfer type
enum enthalpyTransferType
{
etLatentHeat,
etEnthalpyDifference
};
//- Name representations of enthalpy transfer types
static const Foam::wordList enthalpyTransferTypeNames;
protected:
// Protected data
@ -66,9 +81,15 @@ protected:
//- The coefficient dictionary
const dictionary coeffDict_;
//- Enthalpy transfer type enumeration
enthalpyTransferType enthalpyTransfer_;
// Protected member functions
//- Convert word to enthalpy transfer type
enthalpyTransferType wordToEnthalpyTransfer(const word& etName) const;
//- Sherwood number
scalar Sh() const;
@ -129,6 +150,9 @@ public:
//- Return the coefficient dictionary
const dictionary& coeffDict() const;
//- Return the enthalpy transfer type enumeration
const enthalpyTransferType& enthalpyTransfer() const;
// Member Functions