initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / tutorials / lagrangian / rhoPisoTwinParcelFoam / rhoPisoTwinParcelFoam / pEqn.H
blob9443f909a356699185bfbc8497cf46e26fd1ed3b
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);