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 rUaAf = fvc::interpolate(rUaA);
9 surfaceScalarField rUbAf = fvc::interpolate(rUbA);
14 surfaceScalarField phiDraga =
15 fvc::interpolate(beta/rhoa*K*rUaA)*phib + rUaAf*(g & mesh.Sf());
19 phiDraga -= ppMagf*fvc::snGrad(alpha)*mesh.magSf();
22 if (kineticTheory.on())
24 phiDraga -= rUaAf*fvc::snGrad(kineticTheory.pa()/rhoa)*mesh.magSf();
27 surfaceScalarField phiDragb =
28 fvc::interpolate(alpha/rhob*K*rUbA)*phia + rUbAf*(g & mesh.Sf());
30 // Fix for gravity on outlet boundary.
31 forAll(p.boundaryField(), patchi)
33 if (isA<zeroGradientFvPatchScalarField>(p.boundaryField()[patchi]))
35 phiDraga.boundaryField()[patchi] = 0.0;
36 phiDragb.boundaryField()[patchi] = 0.0;
40 phia = (fvc::interpolate(Ua) & mesh.Sf()) + fvc::ddtPhiCorr(rUaA, Ua, phia)
43 phib = (fvc::interpolate(Ub) & mesh.Sf()) + fvc::ddtPhiCorr(rUbA, Ub, phib)
46 phi = alphaf*phia + betaf*phib;
48 surfaceScalarField Dp("(rho*(1|A(U)))", alphaf*rUaAf/rhoa + betaf*rUbAf/rhob);
50 for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
54 fvm::laplacian(Dp, p) == fvc::div(phi)
57 pEqn.setReference(pRefCell, pRefValue);
60 if (nonOrth == nNonOrthCorr)
62 surfaceScalarField SfGradp = pEqn.flux()/Dp;
64 phia -= rUaAf*SfGradp/rhoa;
65 phib -= rUbAf*SfGradp/rhob;
66 phi = alphaf*phia + betaf*phib;
69 SfGradp = pEqn.flux()/Dp;
71 Ua += fvc::reconstruct(phiDraga - rUaAf*SfGradp/rhoa);
72 Ua.correctBoundaryConditions();
74 Ub += fvc::reconstruct(phiDragb - rUbAf*SfGradp/rhob);
75 Ub.correctBoundaryConditions();
77 U = alpha*Ua + beta*Ub;
82 #include "continuityErrs.H"