BUG: Condensation mass transfer in interfaceHeatResistance. Fixes #2216

This commit is contained in:
sergio
2021-10-28 14:31:33 -07:00
parent 7d5dc29e53
commit 36bb99da9b

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
Copyright (C) 2020 Henning Scheufler
-------------------------------------------------------------------------------
License
@ -269,14 +269,14 @@ correct()
// interface heat resistance
mDotc_ = interfaceArea_*R_*max(TSat - T, T0)/L;
mDote_ = interfaceArea_*R_*(T - TSat)/L;
mDote_ = interfaceArea_*R_*max(T - TSat, T0)/L;
// Limiting max condensation
forAll(mDotc_, celli)
{
scalar rhobyDt = mixture_.rho1().value()/mesh_.time().deltaTValue();
scalar maxEvap = mixture_.alpha1()[celli]*rhobyDt; // positive
scalar maxCond = -mixture_.alpha2()[celli]*rhobyDt; // negative
mDote_[celli] = min(max(mDote_[celli], maxCond), maxEvap);
mDotc_[celli] = min(max(mDotc_[celli], maxCond), maxEvap);
}
@ -326,14 +326,6 @@ correct()
void Foam::temperaturePhaseChangeTwoPhaseMixtures::interfaceHeatResistance::
updateInterface()
{
const volScalarField& T = mesh_.lookupObject<volScalarField>("T");
const twoPhaseMixtureEThermo& thermo =
refCast<const twoPhaseMixtureEThermo>
(
mesh_.lookupObject<basicThermo>(basicThermo::dictName)
);
const dimensionedScalar& TSat = thermo.TSat();
// interface heat resistance
// Interpolating alpha1 cell centre values to mesh points (vertices)
@ -354,30 +346,6 @@ updateInterface()
mag(cutCell.faceArea())/mesh_.V()[celli];
}
}
const polyBoundaryMesh& pbm = mesh_.boundaryMesh();
forAll(pbm, patchi)
{
if (isA<wallPolyPatch>(pbm[patchi]))
{
const polyPatch& pp = pbm[patchi];
forAll(pp.faceCells(),i)
{
const label pCelli = pp.faceCells()[i];
if
(
(TSat.value() - T[pCelli]) > 0
&& mixture_.alpha1()[pCelli] < 0.9
)
{
interfaceArea_[pCelli] =
mag(pp.faceAreas()[i])/mesh_.V()[pCelli];
}
}
}
}
}