initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / applications / solvers / combustion / dieselEngineFoam / pEqn.H
blobb68ae732962c2e1f26c46876b69efae206eaaa45
1 rho = thermo.rho();
3 volScalarField A = UEqn.A();
4 U = UEqn.H()/A;
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)
21           - fvm::laplacian(rho/A, p)
22          ==
23             Sevap
24         );
26         pEqn.solve();
28         if (nonOrth == nNonOrthCorr)
29         {
30             phi == pEqn.flux();
31         }
32     }
34 else
36     phi = fvc::interpolate(rho)
37          *((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U));
39     for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
40     {
41         fvScalarMatrix pEqn
42         (
43             fvm::ddt(psi, p)
44           + fvc::div(phi)
45           - fvm::laplacian(rho/A, p)
46          ==
47             Sevap
48         );
50         pEqn.solve();
52         if (nonOrth == nNonOrthCorr)
53         {
54             phi += pEqn.flux();
55         }
56     }
59 #include "rhoEqn.H"
60 #include "compressibleContinuityErrs.H"
62 U -= fvc::grad(p)/A;
63 U.correctBoundaryConditions();
65 DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);