Clean up
[ShipHydroSIG.git] / src / navalFoam / pEqn.H
blobcb3856dc1abae06daadcae2c6579155a296428b2
1 if (implicitP)
3     // Add gravity term, re-using the momentum equation
4     UEqn += interface.sigmaK()*fvc::grad(alpha1) - rho*g;
6     volScalarField rUAPres = 1.0/UEqn.A();
8     // Pick up velocity boundary conditions
9     volVectorField Upres
10     (
11         "Upres",
12         U
13     );
14     Upres = rUAPres*UEqn.H();
16     surfaceScalarField phiPres = fvc::interpolate(Upres) & mesh.Sf();
18     adjustPhi(phiPres, Upres, p);
20     p.storePrevIter();
22     for(int nonOrth = 0; nonOrth <= nNonOrthCorr; nonOrth++)
23     {
24         fvScalarMatrix pEqn
25         (
26             fvm::laplacian(rUAPres, p) == fvc::div(phiPres)
27         );
29         pEqn.setReference(pRefCell, pRefValue);
30         pEqn.solve(mesh.solver(pd.name()));
31     }
33     Info << "Relaxation: p = " << mesh.relaxationFactor(p.name()) << endl;
34     p.relax();
36 else
38     p = pd + rho*gh;