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