mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
@ -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);
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user