initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / applications / solvers / combustion / engineFoam / pEqn.H
blob39b4967312055a320025d3ca3ba70b809fafe762
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        *((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U))
13     );
15     for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
16     {
17         fvScalarMatrix pEqn
18         (
19             fvm::ddt(psi, p)
20           + fvm::div(phid, p, "div(phid,p)")
21           - fvm::laplacian(rho*rUA, p)
22         );
24         pEqn.solve();
26         if (nonOrth == nNonOrthCorr)
27         {
28             phi == pEqn.flux();
29         }
30     }
32 else
34     phi = fvc::interpolate(rho)
35          *((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U));
37     for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
38     {
39         fvScalarMatrix pEqn
40         (
41             fvm::ddt(psi, p)
42           + fvc::div(phi)
43           - fvm::laplacian(rho*rUA, p)
44         );
46         pEqn.solve();
48         if (nonOrth == nNonOrthCorr)
49         {
50             phi += pEqn.flux();
51         }
52     }
55 #include "rhoEqn.H"
56 #include "compressibleContinuityErrs.H"
58 U -= rUA*fvc::grad(p);
59 U.correctBoundaryConditions();
61 DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);