initial commit for version 1.5.x patch release
[OpenFOAM-1.5.x.git] / applications / solvers / combustion / dieselFoam / pEqn.H
blob37e63e8635cfa1bdef7ec2021711add2c9b7b464
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(thermo->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          ==
26             Sevap
27         );
29         pEqn.solve();
31         if (nonOrth == nNonOrthCorr)
32         {
33             phi == pEqn.flux();
34         }
35     }
37 else
39     phi = 
40         fvc::interpolate(rho)*
41         (
42             (fvc::interpolate(U) & mesh.Sf())
43           + fvc::ddtPhiCorr(rUA, rho, U, phi)
44         );
46     for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
47     {
48         fvScalarMatrix pEqn
49         (
50             fvm::ddt(psi, p)
51           + fvc::div(phi)
52           - fvm::laplacian(rho*rUA, p)
53          ==
54             Sevap
55         );
57         pEqn.solve();
59         if (nonOrth == nNonOrthCorr)
60         {
61             phi += pEqn.flux();
62         }
63     }
66 #include "rhoEqn.H"
67 #include "compressibleContinuityErrs.H"
69 U -= rUA*fvc::grad(p);
70 U.correctBoundaryConditions();
72 DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);