Transferred copyright to the OpenFOAM Foundation
[OpenFOAM-2.0.x.git] / applications / solvers / combustion / PDRFoam / pEqn.H
blob3c6a6341f9dd55765189db50542f413ce38f6bee
1 rho = thermo.rho();
3 volScalarField rAU(1.0/UEqn.A());
4 U = invA & UEqn.H();
6 if (pimple.transonic())
8     surfaceScalarField phid
9     (
10         "phid",
11         fvc::interpolate(psi)
12        *(
13             (fvc::interpolate(U) & mesh.Sf())
14           + fvc::ddtPhiCorr(rAU, rho, U, phi)
15         )
16     );
18     for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
19     {
20         fvScalarMatrix pEqn
21         (
22             betav*fvm::ddt(psi, p)
23           + fvm::div(phid, p)
24           - fvm::laplacian(rho*invA, p)
25         );
27         pEqn.solve
28         (
29             mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
30         );
32         if (nonOrth == pimple.nNonOrthCorr())
33         {
34             phi == pEqn.flux();
35         }
36     }
38 else
40     phi =
41         fvc::interpolate(rho)*
42         (
43             (fvc::interpolate(U) & mesh.Sf())
44           + fvc::ddtPhiCorr(rAU, rho, U, phi)
45         );
47     for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++)
48     {
49         fvScalarMatrix pEqn
50         (
51             betav*fvm::ddt(psi, p)
52           + fvc::div(phi)
53           - fvm::laplacian(rho*invA, p)
54         );
56         pEqn.solve
57         (
58             mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth)))
59         );
61         if (nonOrth == pimple.nNonOrthCorr())
62         {
63             phi += pEqn.flux();
64         }
65     }
68 #include "rhoEqn.H"
69 #include "continuityErrs.H"
71 U -= invA & (betav*fvc::grad(p));
72 U.correctBoundaryConditions();
74 DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);