mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
@ -344,7 +344,7 @@ void Foam::ReactingParcel<ParcelType>::calc
|
|||||||
td.cloud().hcTrans()[cellI] +=
|
td.cloud().hcTrans()[cellI] +=
|
||||||
np0
|
np0
|
||||||
*dMassPC[i]
|
*dMassPC[i]
|
||||||
*td.cloud().mcCarrierThermo().speciesData()[gid].H(T0);
|
*td.cloud().mcCarrierThermo().speciesData()[gid].Hc();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update momentum transfer
|
// Update momentum transfer
|
||||||
@ -423,6 +423,11 @@ void Foam::ReactingParcel<ParcelType>::calcPhaseChange
|
|||||||
scalarField& Cs
|
scalarField& Cs
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
typedef PhaseChangeModel
|
||||||
|
<
|
||||||
|
typename ReactingParcel<ParcelType>::trackData::cloudType
|
||||||
|
> phaseChangeModelType;
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
!td.cloud().phaseChange().active()
|
!td.cloud().phaseChange().active()
|
||||||
@ -464,17 +469,26 @@ void Foam::ReactingParcel<ParcelType>::calcPhaseChange
|
|||||||
td.cloud().composition().localToGlobalCarrierId(idPhase, i);
|
td.cloud().composition().localToGlobalCarrierId(idPhase, i);
|
||||||
const label idl = td.cloud().composition().globalIds(idPhase)[i];
|
const label idl = td.cloud().composition().globalIds(idPhase)[i];
|
||||||
|
|
||||||
const scalar hv = td.cloud().mcCarrierThermo().speciesData()[idc].H(Ts);
|
if
|
||||||
const scalar hl =
|
(
|
||||||
td.cloud().composition().liquids().properties()[idl].h(pc_, Ts);
|
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]*hlp/dt;
|
||||||
Sh += dMassPC[i]*(hl - hv)/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
|
Sh -= dMassPC[i]*(hc - hp)/dt;
|
||||||
// const scalar hl =
|
}
|
||||||
// td.cloud().composition().liquids().properties()[idl].hl(pc_, Ts);
|
|
||||||
// Sh -= dMassPC[i]*hl/dt;
|
|
||||||
|
|
||||||
// Update particle surface thermo properties
|
// Update particle surface thermo properties
|
||||||
const scalar Dab =
|
const scalar Dab =
|
||||||
|
|||||||
@ -136,6 +136,9 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
typedef ReactingCloud<ParcelType> cloudType;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from components
|
//- Construct from components
|
||||||
|
|||||||
@ -26,6 +26,48 @@ License
|
|||||||
|
|
||||||
#include "PhaseChangeModel.H"
|
#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 * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
@ -36,7 +78,8 @@ Foam::PhaseChangeModel<CloudType>::PhaseChangeModel
|
|||||||
:
|
:
|
||||||
dict_(dictionary::null),
|
dict_(dictionary::null),
|
||||||
owner_(owner),
|
owner_(owner),
|
||||||
coeffDict_(dictionary::null)
|
coeffDict_(dictionary::null),
|
||||||
|
enthalpyTransfer_(etLatentHeat)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -50,7 +93,11 @@ Foam::PhaseChangeModel<CloudType>::PhaseChangeModel
|
|||||||
:
|
:
|
||||||
dict_(dict),
|
dict_(dict),
|
||||||
owner_(owner),
|
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"
|
#include "NewPhaseChangeModel.C"
|
||||||
|
|||||||
@ -53,6 +53,21 @@ namespace Foam
|
|||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
class PhaseChangeModel
|
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:
|
||||||
|
|
||||||
// Protected data
|
// Protected data
|
||||||
@ -66,9 +81,15 @@ protected:
|
|||||||
//- The coefficient dictionary
|
//- The coefficient dictionary
|
||||||
const dictionary coeffDict_;
|
const dictionary coeffDict_;
|
||||||
|
|
||||||
|
//- Enthalpy transfer type enumeration
|
||||||
|
enthalpyTransferType enthalpyTransfer_;
|
||||||
|
|
||||||
|
|
||||||
// Protected member functions
|
// Protected member functions
|
||||||
|
|
||||||
|
//- Convert word to enthalpy transfer type
|
||||||
|
enthalpyTransferType wordToEnthalpyTransfer(const word& etName) const;
|
||||||
|
|
||||||
//- Sherwood number
|
//- Sherwood number
|
||||||
scalar Sh() const;
|
scalar Sh() const;
|
||||||
|
|
||||||
@ -129,6 +150,9 @@ public:
|
|||||||
//- Return the coefficient dictionary
|
//- Return the coefficient dictionary
|
||||||
const dictionary& coeffDict() const;
|
const dictionary& coeffDict() const;
|
||||||
|
|
||||||
|
//- Return the enthalpy transfer type enumeration
|
||||||
|
const enthalpyTransferType& enthalpyTransfer() const;
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user