Removed unnecessary return statement
[foam-extend-3.2.git] / applications / solvers / multiphase / barotropicCavitatingFoam / pEqn.H
blob84f5f0910729dfade6fa1b162a374cdbe225a47a
2     surfaceScalarField rUAf = 1.0/fvc::interpolate(UEqn.A());
4     U = UEqn.H()/UEqn.A();
6     phi = fvc::interpolate(U) & mesh.Sf();
8     // Bug fix: must change name of phi on copy to keep objectRegistry happy
9     // HJ, 7/Nov/2010
10     surfaceScalarField phiU
11     (
12         "phiU",
13         phi
14     );
16     surfaceScalarField phip = fvc::interpolate(psiByRho)*phi;
18     for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
19     {
20         fvScalarMatrix pEqn
21         (
22             fvm::laplacian(rUAf, p)
23         );
25         solve
26         (
27              psiByRho*fvm::ddt(p)
28            + fvm::div(phip, p) - fvm::Sp(fvc::div(phip), p)
29            + fvc::div(phi) - pEqn
30         );
32         if (nonOrth == nNonOrthCorr)
33         {
34             phi -= pEqn.flux();
35         }
36     }
38     U += fvc::reconstruct(phi - phiU);
39     U.correctBoundaryConditions();