Skip to content
Snippets Groups Projects
Commit e9723544 authored by andy's avatar andy
Browse files

BUG: ReactingParcel - updated evaluation of vapourisation temperature - mantis #945

parent e28694fe
Branches
Tags
No related merge requests found
...@@ -26,6 +26,7 @@ License ...@@ -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 ...@@ -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 ...@@ -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;
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment