Commit c8b504a6 authored by sergio's avatar sergio
Browse files

BUG: Bound Tsource and pEq sign for condensation. Fix #1682.

parent e1586bda
......@@ -34,7 +34,7 @@
fvc::div(phiHbyA)
- fvm::laplacian(rAUf, p_rgh)
==
vDotv - vDotc
vDotv + vDotc
);
p_rghEqn.setReference(pRefCell, pRefValue);
......
......@@ -122,19 +122,25 @@ Foam::temperaturePhaseChangeTwoPhaseMixtures::constant::mDot() const
const dimensionedScalar T0(dimTemperature, Zero);
if (mesh_.time().outputTime())
{
volScalarField mDot
volScalarField mDotE
(
"mDotE", coeffE_*mixture_.rho1()*limitedAlpha1*max(T - TSat, T0)
);
volScalarField mDotC
(
"mDot", coeffE_*mixture_.rho1()*limitedAlpha1*max(T - TSat, T0)
"mDotC", coeffC_*mixture_.rho2()*limitedAlpha2*max(TSat - T, T0)
);
mDot.write();
if (mesh_.time().outputTime())
{
mDotC.write();
mDotE.write();
}
return Pair<tmp<volScalarField>>
(
coeffC_*mixture_.rho2()*limitedAlpha2*max(TSat - T, T0),
-coeffE_*mixture_.rho1()*limitedAlpha1*max(T - TSat, T0)
tmp<volScalarField>(new volScalarField(mDotC)),
tmp<volScalarField>(new volScalarField(-mDotE))
);
}
......@@ -209,16 +215,16 @@ Foam::temperaturePhaseChangeTwoPhaseMixtures::constant::TSource() const
const volScalarField Vcoeff
(
coeffE_*mixture_.rho1()*limitedAlpha1*L
coeffE_*mixture_.rho1()*limitedAlpha1*L*pos(T - TSat)
);
const volScalarField Ccoeff
(
coeffC_*mixture_.rho2()*limitedAlpha2*L
coeffC_*mixture_.rho2()*limitedAlpha2*L*pos(TSat - T)
);
TSource =
fvm::Sp(Vcoeff, T) - Vcoeff*TSat
- fvm::Sp(Ccoeff, T) + Ccoeff*TSat;
+ fvm::Sp(Ccoeff, T) - Ccoeff*TSat;
return tTSource;
}
......
Markdown is supported
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