FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

pEqn.H

Go to the documentation of this file.
00001 rho = thermo.rho();
00002 
00003 volScalarField rUA = 1.0/UEqn.A();
00004 U = rUA*UEqn.H();
00005 
00006 if (transonic)
00007 {
00008     surfaceScalarField phid
00009     (
00010         "phid",
00011         fvc::interpolate(psi)
00012        *((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U))
00013     );
00014 
00015     for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
00016     {
00017         fvScalarMatrix pEqn
00018         (
00019             fvm::ddt(psi, p)
00020           + fvm::div(phid, p, "div(phid,p)")
00021           - fvm::laplacian(rho*rUA, p)
00022         );
00023 
00024         pEqn.solve();
00025 
00026         if (nonOrth == nNonOrthCorr)
00027         {
00028             phi == pEqn.flux();
00029         }
00030     }
00031 }
00032 else
00033 {
00034     phi = fvc::interpolate(rho)
00035          *((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U));
00036 
00037     for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
00038     {
00039         fvScalarMatrix pEqn
00040         (
00041             fvm::ddt(psi, p)
00042           + fvc::div(phi)
00043           - fvm::laplacian(rho*rUA, p)
00044         );
00045 
00046         pEqn.solve();
00047 
00048         if (nonOrth == nNonOrthCorr)
00049         {
00050             phi += pEqn.flux();
00051         }
00052     }
00053 }
00054 
00055 #include <finiteVolume/rhoEqn.H>
00056 #include <finiteVolume/compressibleContinuityErrs.H>
00057 
00058 U -= rUA*fvc::grad(p);
00059 U.correctBoundaryConditions();
00060 
00061 DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
00062 
00063 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines