Initial commit for version 2.0.x patch release
[OpenFOAM-2.0.x.git] / applications / solvers / combustion / dieselEngineFoam / pEqn.H
blob42228cc7b0e000192884340a7740b83b34f19522
1 rho = thermo.rho();
3 volScalarField A(UEqn.A());
4 U = UEqn.H()/A;
6 if (pimple.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<=pimple.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
27         (
28             mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
29         );
31         if (nonOrth == pimple.nNonOrthCorr())
32         {
33             phi == pEqn.flux();
34         }
35     }
37 else
39     phi = fvc::interpolate(rho)
40          *((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U));
42     for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
43     {
44         fvScalarMatrix pEqn
45         (
46             fvm::ddt(psi, p)
47           + fvc::div(phi)
48           - fvm::laplacian(rho/A, p)
49          ==
50             Sevap
51         );
53         pEqn.solve
54         (
55             mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
56         );
58         if (nonOrth == pimple.nNonOrthCorr())
59         {
60             phi += pEqn.flux();
61         }
62     }
65 #include "rhoEqn.H"
66 #include "compressibleContinuityErrs.H"
68 U -= fvc::grad(p)/A;
69 U.correctBoundaryConditions();
71 DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);