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(),
38 false // Use slices for the couples
42 // Create the complete convection flux for alpha1
43 surfaceScalarField phiAlpha1
53 -fvc::flux(-phir, alpha2, alpharScheme),
59 -fvc::flux(-phir, alpha3, alpharScheme),
65 // Create the bounded (upwind) flux for alpha1
66 surfaceScalarField phiAlpha1BD
68 upwind<scalar>(mesh, phi).flux(alpha1)
71 // Calculate the flux correction for alpha1
72 phiAlpha1 -= phiAlpha1BD;
74 // Calculate the limiter for alpha1
89 // Create the complete flux for alpha2
90 surfaceScalarField phiAlpha2
100 -fvc::flux(phir, alpha1, alpharScheme),
106 // Create the bounded (upwind) flux for alpha2
107 surfaceScalarField phiAlpha2BD
109 upwind<scalar>(mesh, phi).flux(alpha2)
112 // Calculate the flux correction for alpha2
113 phiAlpha2 -= phiAlpha2BD;
115 // Further limit the limiter for alpha2
130 // Construct the limited fluxes
131 phiAlpha1 = phiAlpha1BD + lambda*phiAlpha1;
132 phiAlpha2 = phiAlpha2BD + lambda*phiAlpha2;
135 solve(fvm::ddt(alpha1) + fvc::div(phiAlpha1));
137 // Create the diffusion coefficients for alpha2<->alpha3
138 volScalarField Dc23(D23*max(alpha3, scalar(0))*pos(alpha2));
139 volScalarField Dc32(D23*max(alpha2, scalar(0))*pos(alpha3));
141 // Add the diffusive flux for alpha3->alpha2
142 phiAlpha2 -= fvc::interpolate(Dc32)*mesh.magSf()*fvc::snGrad(alpha1);
145 fvScalarMatrix alpha2Eqn
148 + fvc::div(phiAlpha2)
149 - fvm::laplacian(Dc23 + Dc32, alpha2)
153 // Construct the complete mass flux
155 phiAlpha1*(rho1 - rho3)
156 + (phiAlpha2 + alpha2Eqn.flux())*(rho2 - rho3)
159 alpha3 = 1.0 - alpha1 - alpha2;
162 Info<< "Air phase volume fraction = "
163 << alpha1.weightedAverage(mesh.V()).value()
164 << " Min(alpha1) = " << min(alpha1).value()
165 << " Max(alpha1) = " << max(alpha1).value()
168 Info<< "Liquid phase volume fraction = "
169 << alpha2.weightedAverage(mesh.V()).value()
170 << " Min(alpha2) = " << min(alpha2).value()
171 << " Max(alpha2) = " << max(alpha2).value()