pEqn.H
Go to the documentation of this file.
00001 {
00002     rho = thermo.rho();
00003 
00004     // Thermodynamic density needs to be updated by psi*d(p) after the
00005     // pressure solution - done in 2 parts. Part 1:
00006     thermo.rho() -= psi*p;
00007 
00008     volScalarField rAU(1.0/UEqn.A());
00009     volVectorField HbyA("HbyA", U);
00010     HbyA = rAU*UEqn.H();
00011 
00012     surfaceScalarField phiHbyA
00013     (
00014         "phiHbyA",
00015         fvc::interpolate(rho)
00016        *(
00017             (fvc::interpolate(HbyA) & mesh.Sf())
00018           + fvc::ddtPhiCorr(rAU, rho, U, phi)
00019         )
00020     );
00021 
00022     fvOptions.relativeFlux(fvc::interpolate(rho), phiHbyA);
00023 
00024     fvScalarMatrix pDDtEqn
00025     (
00026         fvc::ddt(rho) + psi*correction(fvm::ddt(p))
00027       + fvc::div(phiHbyA)
00028      ==
00029         parcels.Srho()
00030       + fvOptions(psi, p, rho.name())
00031     );
00032 
00033     while (pimple.correctNonOrthogonal())
00034     {
00035         fvScalarMatrix pEqn
00036         (
00037             pDDtEqn
00038           - fvm::laplacian(rho*rAU, p)
00039         );
00040 
00041         fvOptions.constrain(pEqn);
00042 
00043         pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
00044 
00045         if (pimple.finalNonOrthogonalIter())
00046         {
00047             phi = phiHbyA + pEqn.flux();
00048         }
00049     }
00050 
00051     p.relax();
00052 
00053     // Second part of thermodynamic density update
00054     thermo.rho() += psi*p;
00055 
00056     #include "rhoEqn.H" // NOTE: flux and time scales now inconsistent
00057     #include "compressibleContinuityErrs.H"
00058 
00059     U = HbyA - rAU*fvc::grad(p);
00060     U.correctBoundaryConditions();
00061     fvOptions.correct(U);
00062     K = 0.5*magSqr(U);
00063 
00064     if (thermo.dpdt())
00065     {
00066         dpdt = fvc::ddt(p);
00067     }
00068 
00069     rho = thermo.rho();
00070     rho = max(rho, rhoMin);
00071     rho = min(rho, rhoMax);
00072 
00073     Info<< "p min/max = " << min(p).value() << ", " << max(p).value() << endl;
00074 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines