Merge branch 'upstream/OpenFOAM' into master
[freefoam.git] / applications / solvers / combustion / XiFoam / pEqn.H
blob8a5303b1429348db4797ac6846fa00767de8f6d6
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 <finiteVolume/rhoEqn.H>
63 #include <finiteVolume/compressibleContinuityErrs.H>
65 U -= rUA*fvc::grad(p);
66 U.correctBoundaryConditions();
68 DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
70 // ************************ vim: set sw=4 sts=4 et: ************************ //