2 surfaceScalarField alphaf(fvc::interpolate(alpha));
3 surfaceScalarField betaf(scalar(1) - alphaf);
5 volScalarField rUaA(1.0/UaEqn.A());
6 volScalarField rUbA(1.0/UbEqn.A());
8 phia == (fvc::interpolate(Ua) & mesh.Sf());
9 phib == (fvc::interpolate(Ub) & mesh.Sf());
11 rUaAf = fvc::interpolate(rUaA);
12 surfaceScalarField rUbAf(fvc::interpolate(rUbA));
17 surfaceScalarField phiDraga
19 fvc::interpolate(beta/rhoa*K*rUaA)*phib + rUaAf*(g & mesh.Sf())
24 phiDraga -= ppMagf*fvc::snGrad(alpha)*mesh.magSf();
27 if (kineticTheory.on())
29 phiDraga -= rUaAf*fvc::snGrad(kineticTheory.pa()/rhoa)*mesh.magSf();
32 surfaceScalarField phiDragb
34 fvc::interpolate(alpha/rhob*K*rUbA)*phia + rUbAf*(g & mesh.Sf())
37 // Fix for gravity on outlet boundary.
38 forAll(p.boundaryField(), patchi)
40 if (isA<zeroGradientFvPatchScalarField>(p.boundaryField()[patchi]))
42 phiDraga.boundaryField()[patchi] = 0.0;
43 phiDragb.boundaryField()[patchi] = 0.0;
47 phia = (fvc::interpolate(Ua) & mesh.Sf()) + fvc::ddtPhiCorr(rUaA, Ua, phia)
50 phib = (fvc::interpolate(Ub) & mesh.Sf()) + fvc::ddtPhiCorr(rUbA, Ub, phib)
53 phi = alphaf*phia + betaf*phib;
58 alphaf*rUaAf/rhoa + betaf*rUbAf/rhob
61 for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
65 fvm::laplacian(Dp, p) == fvc::div(phi)
68 pEqn.setReference(pRefCell, pRefValue);
72 mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
75 if (nonOrth == pimple.nNonOrthCorr())
77 surfaceScalarField SfGradp(pEqn.flux()/Dp);
79 phia -= rUaAf*SfGradp/rhoa;
80 phib -= rUbAf*SfGradp/rhob;
81 phi = alphaf*phia + betaf*phib;
84 SfGradp = pEqn.flux()/Dp;
86 Ua += fvc::reconstruct(phiDraga - rUaAf*SfGradp/rhoa);
87 Ua.correctBoundaryConditions();
89 Ub += fvc::reconstruct(phiDragb - rUbAf*SfGradp/rhob);
90 Ub.correctBoundaryConditions();
92 U = alpha*Ua + beta*Ub;
97 #include "continuityErrs.H"