ENH: Adding functionality to scalarTransport FO and residence time tutorials for VOF

and single phase cases. Registration of the compressed flux in interFoam as it is
needed for the FO if used.
This commit is contained in:
sergio
2016-11-21 09:21:45 -08:00
parent dfbb9d0900
commit 143e99194f
16 changed files with 601 additions and 40 deletions

View File

@ -126,35 +126,35 @@
{
surfaceScalarField phir(phic*mixture.nHatf());
tmp<surfaceScalarField> talphaPhiUn
(
fvc::flux
alphaPhiUn =
(
phi,
alpha1,
alphaScheme
)
+ fvc::flux
(
-fvc::flux(-phir, alpha2, alpharScheme),
alpha1,
alpharScheme
)
);
fvc::flux
(
phi,
alpha1,
alphaScheme
)
+ fvc::flux
(
-fvc::flux(-phir, alpha2, alpharScheme),
alpha1,
alpharScheme
)
);
// Calculate the Crank-Nicolson off-centred alpha flux
if (ocCoeff > 0)
{
talphaPhiUn =
cnCoeff*talphaPhiUn + (1.0 - cnCoeff)*alphaPhi.oldTime();
alphaPhiUn =
cnCoeff*alphaPhiUn + (1.0 - cnCoeff)*alphaPhi.oldTime();
}
if (MULESCorr)
{
tmp<surfaceScalarField> talphaPhiCorr(talphaPhiUn() - alphaPhi);
tmp<surfaceScalarField> talphaPhiCorr(alphaPhiUn - alphaPhi);
volScalarField alpha10("alpha10", alpha1);
MULES::correct(alpha1, talphaPhiUn(), talphaPhiCorr.ref(), 1, 0);
MULES::correct(alpha1, alphaPhiUn, talphaPhiCorr.ref(), 1, 0);
// Under-relax the correction for all but the 1st corrector
if (aCorr == 0)
@ -169,7 +169,7 @@
}
else
{
alphaPhi = talphaPhiUn;
alphaPhi = alphaPhiUn;
MULES::explicitSolve(alpha1, phiCN, alphaPhi, 1, 0);
}

View File

@ -135,6 +135,21 @@ surfaceScalarField alphaPhi
phi*fvc::interpolate(alpha1)
);
// MULES compressed flux is registered in case scalarTransport FO needs it.
surfaceScalarField alphaPhiUn
(
IOobject
(
"alphaPhiUn",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar("zero", phi.dimensions(), 0.0)
);
// MULES Correction
tmp<surfaceScalarField> talphaPhiCorr0;