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/interMixingFoam/alphaEqnsSubCycle.H

44 lines
853 B
C
Raw Normal View History

2010-09-22 18:13:13 +00:00
label nAlphaCorr
(
readLabel(pimple.dict().lookup("nAlphaCorr"))
2010-09-22 18:13:13 +00:00
);
label nAlphaSubCycles
(
readLabel(pimple.dict().lookup("nAlphaSubCycles"))
2010-09-22 18:13:13 +00:00
);
if (nAlphaSubCycles > 1)
{
surfaceScalarField rhoPhiSum = 0.0*rhoPhi;
dimensionedScalar totalDeltaT = runTime.deltaT();
for
(
subCycle<volScalarField> alphaSubCycle(alpha1, nAlphaSubCycles);
!(++alphaSubCycle).end();
)
{
# include "alphaEqns.H"
rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi;
}
rhoPhi = rhoPhiSum;
}
else
{
# include "alphaEqns.H"
}
interface.correct();
{
volScalarField rhoNew = alpha1*rho1 + alpha2*rho2 + alpha3*rho3;
//solve(fvm::ddt(rho) + fvc::div(rhoPhi));
//Info<< "density error = "
// << max((mag(rho - rhoNew)/mag(rhoNew))().internalField()) << endl;
rho == rhoNew;
}