2 word alphaScheme("div(phi,alpha)");
3 word alpharScheme("div(phirb,alpha)");
5 surfaceScalarField phir
15 interface.cAlpha()*mag(phi/mesh.magSf())*interface.nHatf()
18 for (int gCorr=0; gCorr<nAlphaCorr; gCorr++)
20 // Create the limiter to be used for all phase-fractions
21 scalarField allLambda(mesh.nFaces(), 1.0);
23 // Split the limiter into a surfaceScalarField
24 slicedSurfaceScalarField lambda
29 mesh.time().timeName(),
41 // Create the complete convection flux for alpha1
42 surfaceScalarField phiAlpha1 =
51 -fvc::flux(-phir, alpha2, alpharScheme),
57 -fvc::flux(-phir, alpha3, alpharScheme),
62 // Create the bounded (upwind) flux for alpha1
63 surfaceScalarField phiAlpha1BD =
64 upwind<scalar>(mesh, phi).flux(alpha1);
66 // Calculate the flux correction for alpha1
67 phiAlpha1 -= phiAlpha1BD;
69 // Calculate the limiter for alpha1
84 // Create the complete flux for alpha2
85 surfaceScalarField phiAlpha2 =
94 -fvc::flux(phir, alpha1, alpharScheme),
99 // Create the bounded (upwind) flux for alpha2
100 surfaceScalarField phiAlpha2BD =
101 upwind<scalar>(mesh, phi).flux(alpha2);
103 // Calculate the flux correction for alpha2
104 phiAlpha2 -= phiAlpha2BD;
106 // Further limit the limiter for alpha2
121 // Construct the limited fluxes
122 phiAlpha1 = phiAlpha1BD + lambda*phiAlpha1;
123 phiAlpha2 = phiAlpha2BD + lambda*phiAlpha2;
126 solve(fvm::ddt(alpha1) + fvc::div(phiAlpha1));
128 // Create the diffusion coefficients for alpha2<->alpha3
129 volScalarField Dc23 = D23*max(alpha3, scalar(0))*pos(alpha2);
130 volScalarField Dc32 = D23*max(alpha2, scalar(0))*pos(alpha3);
132 // Add the diffusive flux for alpha3->alpha2
133 phiAlpha2 -= fvc::interpolate(Dc32)*mesh.magSf()*fvc::snGrad(alpha1);
136 fvScalarMatrix alpha2Eqn
139 + fvc::div(phiAlpha2)
140 - fvm::laplacian(Dc23 + Dc32, alpha2)
144 // Construct the complete mass flux
146 phiAlpha1*(rho1 - rho3)
147 + (phiAlpha2 + alpha2Eqn.flux())*(rho2 - rho3)
150 alpha3 = 1.0 - alpha1 - alpha2;
153 Info<< "Air phase volume fraction = "
154 << alpha1.weightedAverage(mesh.V()).value()
155 << " Min(alpha1) = " << min(alpha1).value()
156 << " Max(alpha1) = " << max(alpha1).value()
159 Info<< "Liquid phase volume fraction = "
160 << alpha2.weightedAverage(mesh.V()).value()
161 << " Min(alpha2) = " << min(alpha2).value()
162 << " Max(alpha2) = " << max(alpha2).value()