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

This commit is contained in:
sergio
2020-04-17 11:30:10 -07:00
parent e1586bdaa0
commit c8b504a680
2 changed files with 17 additions and 11 deletions

View File

@ -34,7 +34,7 @@
fvc::div(phiHbyA) fvc::div(phiHbyA)
- fvm::laplacian(rAUf, p_rgh) - fvm::laplacian(rAUf, p_rgh)
== ==
vDotv - vDotc vDotv + vDotc
); );
p_rghEqn.setReference(pRefCell, pRefValue); p_rghEqn.setReference(pRefCell, pRefValue);

View File

@ -122,19 +122,25 @@ Foam::temperaturePhaseChangeTwoPhaseMixtures::constant::mDot() const
const dimensionedScalar T0(dimTemperature, Zero); const dimensionedScalar T0(dimTemperature, Zero);
volScalarField mDotE
(
"mDotE", coeffE_*mixture_.rho1()*limitedAlpha1*max(T - TSat, T0)
);
volScalarField mDotC
(
"mDotC", coeffC_*mixture_.rho2()*limitedAlpha2*max(TSat - T, T0)
);
if (mesh_.time().outputTime()) if (mesh_.time().outputTime())
{ {
volScalarField mDot mDotC.write();
( mDotE.write();
"mDot", coeffE_*mixture_.rho1()*limitedAlpha1*max(T - TSat, T0)
);
mDot.write();
} }
return Pair<tmp<volScalarField>> return Pair<tmp<volScalarField>>
( (
coeffC_*mixture_.rho2()*limitedAlpha2*max(TSat - T, T0), tmp<volScalarField>(new volScalarField(mDotC)),
-coeffE_*mixture_.rho1()*limitedAlpha1*max(T - TSat, T0) tmp<volScalarField>(new volScalarField(-mDotE))
); );
} }
@ -209,16 +215,16 @@ Foam::temperaturePhaseChangeTwoPhaseMixtures::constant::TSource() const
const volScalarField Vcoeff const volScalarField Vcoeff
( (
coeffE_*mixture_.rho1()*limitedAlpha1*L coeffE_*mixture_.rho1()*limitedAlpha1*L*pos(T - TSat)
); );
const volScalarField Ccoeff const volScalarField Ccoeff
( (
coeffC_*mixture_.rho2()*limitedAlpha2*L coeffC_*mixture_.rho2()*limitedAlpha2*L*pos(TSat - T)
); );
TSource = TSource =
fvm::Sp(Vcoeff, T) - Vcoeff*TSat fvm::Sp(Vcoeff, T) - Vcoeff*TSat
- fvm::Sp(Ccoeff, T) + Ccoeff*TSat; + fvm::Sp(Ccoeff, T) - Ccoeff*TSat;
return tTSource; return tTSource;
} }