openfoam/applications/solvers/multiphase/compressibleInterIsoFoam/compressibleAlphaEqnSubCycle.H
Henning Scheufler 44a84d4778 CONT: Addition of compressibleIsoInterFOam and PLIC
1) Implementation of the compressibleIsoInterFOam solver
   2) Implementation of a new PLIC interpolation scheme.
   3) New tutorials associated with the solvers

This implementation was carried out by Henning Scheufler (DLR) and Johan
Roenby (DHI), following :

\verbatim

Henning Scheufler, Johan Roenby,
Accurate and efficient surface reconstruction from volume fraction data
on general meshes, Journal of Computational Physics, 2019, doi
10.1016/j.jcp.2019.01.009

\endverbatim

The integration of the code was carried out by Andy Heather and Sergio
Ferraris from OpenCFD Ltd.
2020-06-09 08:11:04 +01:00

71 lines
1.5 KiB
C

if (pimple.nCorrPIMPLE() > 1)
{
if (!pimple.firstIter())
{
// Resetting alpha1 to value before advection in first PIMPLE
// iteration.
alpha1 = alpha1.oldTime();
}
}
tmp<surfaceScalarField> talphaPhi1(alphaPhi10);
if (nAlphaSubCycles > 1)
{
dimensionedScalar totalDeltaT = runTime.deltaT();
talphaPhi1 = new surfaceScalarField
(
IOobject
(
"alphaPhi1",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar(alphaPhi10.dimensions(), Zero)
);
surfaceScalarField rhoPhiSum
(
IOobject
(
"rhoPhiSum",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar(rhoPhi.dimensions(), Zero)
);
for
(
subCycle<volScalarField> alphaSubCycle(alpha1, nAlphaSubCycles);
!(++alphaSubCycle).end();
)
{
#include "alphaEqn.H"
talphaPhi1.ref() += (runTime.deltaT()/totalDeltaT)*alphaPhi10;
rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi;
}
rhoPhi = rhoPhiSum;
}
else
{
#include "alphaEqn.H"
}
rho == alpha1*rho1 + alpha2*rho2;
const surfaceScalarField& alphaPhi1 = talphaPhi1();
surfaceScalarField alphaPhi2("alphaPhi2", phi - alphaPhi1);
volScalarField::Internal contErr
(
(
fvc::ddt(rho) + fvc::div(rhoPhi)
- (fvOptions(alpha1, mixture.thermo1().rho())&rho1)
- (fvOptions(alpha2, mixture.thermo2().rho())&rho2)
)()
);