Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / applications / solvers / compressible / rhoPisoFoam / pEqn.H
blob280842ecc3874e9ba634fd997b194fd940635a57
1 rho = thermo.rho();
3 volScalarField rUA = 1.0/UEqn.A();
4 U = rUA*UEqn.H();
6 if (transonic)
8     surfaceScalarField phid
9     (
10         "phid",
11         fvc::interpolate(psi)
12        *(
13             (fvc::interpolate(U) & mesh.Sf())
14           + fvc::ddtPhiCorr(rUA, rho, U, phi)
15         )
16     );
18     for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
19     {
20         fvScalarMatrix pEqn
21         (
22             fvm::ddt(psi, p)
23           + fvm::div(phid, p)
24           - fvm::laplacian(rho*rUA, p)
25         );
27         pEqn.solve();
29         if (nonOrth == nNonOrthCorr)
30         {
31             phi == pEqn.flux();
32         }
33     }
35 else
37     phi =
38         fvc::interpolate(rho)*
39         (
40             (fvc::interpolate(U) & mesh.Sf())
41           + fvc::ddtPhiCorr(rUA, rho, U, phi)
42         );
44     for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
45     {
46         fvScalarMatrix pEqn
47         (
48             fvm::ddt(psi, p)
49           + fvc::div(phi)
50           - fvm::laplacian(rho*rUA, p)
51         );
53         pEqn.solve();
55         if (nonOrth == nNonOrthCorr)
56         {
57             phi += pEqn.flux();
58         }
59     }
62 #include "rhoEqn.H"
63 #include "compressibleContinuityErrs.H"
65 U -= rUA*fvc::grad(p);
66 U.correctBoundaryConditions();
68 DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);