This repository has been archived on 2023-11-20. You can view files and clone it, but cannot push or open issues or pull requests.
foam-extend4.1-coherent-io/applications/solvers/multiphase/compressibleInterDyMFoam/alphaEqnsSubCycle.H

46 lines
968 B
C++
Raw Normal View History

{
label nAlphaCorr
(
readLabel(pimple.dict().lookup("nAlphaCorr"))
);
label nAlphaSubCycles
(
readLabel(pimple.dict().lookup("nAlphaSubCycles"))
);
surfaceScalarField phic = mag(phi/mesh.magSf());
2010-09-22 18:13:13 +00:00
phic = min(interface.cAlpha()*phic, max(phic));
2010-09-22 18:13:13 +00:00
fvc::makeAbsolute(phi, U);
volScalarField divU = fvc::div(phi);
2010-09-22 18:13:13 +00:00
fvc::makeRelative(phi, U);
if (nAlphaSubCycles > 1)
{
dimensionedScalar totalDeltaT = runTime.deltaT();
surfaceScalarField rhoPhiSum = 0.0*rhoPhi;
for
(
subCycle<volScalarField> alphaSubCycle(alpha1, nAlphaSubCycles);
!(++alphaSubCycle).end();
)
{
# include "alphaEqns.H"
rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi;
}
rhoPhi = rhoPhiSum;
}
else
{
# include "alphaEqns.H"
}
if (pimple.firstIter())
{
interface.correct();
}
}