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/interPhaseChangeFoam/alphaEqn.H

68 lines
1.9 KiB
C
Raw Normal View History

{
2010-09-22 18:13:13 +00:00
word alphaScheme("div(phi,alpha)");
word alpharScheme("div(phirb,alpha)");
surfaceScalarField phir("phir", phic*interface.nHatf());
2010-09-22 18:13:13 +00:00
for (int gCorr=0; gCorr<nAlphaCorr; gCorr++)
{
2010-09-22 18:13:13 +00:00
surfaceScalarField phiAlpha =
fvc::flux
(
phi,
2010-09-22 18:13:13 +00:00
alpha1,
alphaScheme
)
+ fvc::flux
(
2010-09-22 18:13:13 +00:00
-fvc::flux(-phir, scalar(1) - alpha1, alpharScheme),
alpha1,
alpharScheme
);
Pair<tmp<volScalarField> > vDotAlphal =
twoPhaseProperties->vDotAlphal();
const volScalarField& vDotcAlphal = vDotAlphal[0]();
const volScalarField& vDotvAlphal = vDotAlphal[1]();
volScalarField Sp
(
IOobject
(
"Sp",
runTime.timeName(),
mesh
),
vDotvAlphal - vDotcAlphal
);
volScalarField Su
(
IOobject
(
"Su",
runTime.timeName(),
mesh
),
// Divergence term is handled explicitly to be
// consistent with the explicit transport solution
2010-09-22 18:13:13 +00:00
divU*alpha1
+ vDotcAlphal
);
2010-09-22 18:13:13 +00:00
//MULES::explicitSolve(alpha1, phi, phiAlpha, 1, 0);
//MULES::explicitSolve(geometricOneField(), alpha1, phi, phiAlpha, Sp, Su, 1, 0);
MULES::implicitSolve(geometricOneField(), alpha1, phi, phiAlpha, Sp, Su, 1, 0);
rhoPhi +=
(runTime.deltaT()/totalDeltaT)
2010-09-22 18:13:13 +00:00
*(phiAlpha*(rho1 - rho2) + phi*rho2);
}
Info<< "Liquid phase volume fraction = "
2010-09-22 18:13:13 +00:00
<< alpha1.weightedAverage(mesh.V()).value()
<< " Min(alpha1) = " << min(alpha1).value()
<< " Max(alpha1) = " << max(alpha1).value()
<< endl;
}