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        *(
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             fvm::ddt(psi, p)
00023           + fvm::div(phid, p)
00024           - fvm::laplacian(rho*rUA, p)
00025          ==
00026             parcels.Srho()
00027         );
00028 
00029         pEqn.solve();
00030 
00031         if (nonOrth == nNonOrthCorr)
00032         {
00033             phi == pEqn.flux();
00034         }
00035     }
00036 }
00037 else
00038 {
00039     phi =
00040         fvc::interpolate(rho)
00041        *(
00042             (fvc::interpolate(U) & mesh.Sf())
00043           + fvc::ddtPhiCorr(rUA, rho, U, phi)
00044         );
00045 
00046     for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
00047     {
00048         fvScalarMatrix pEqn
00049         (
00050             fvm::ddt(psi, p)
00051           + fvc::div(phi)
00052           - fvm::laplacian(rho*rUA, p)
00053          ==
00054             parcels.Srho()
00055         );
00056 
00057         pEqn.solve();
00058 
00059         if (nonOrth == nNonOrthCorr)
00060         {
00061             phi += pEqn.flux();
00062         }
00063     }
00064 }
00065 
00066 #include "rhoEqn.H"
00067 #include <finiteVolume/compressibleContinuityErrs.H>
00068 
00069 U -= rUA*fvc::grad(p);
00070 U.correctBoundaryConditions();
00071 
00072 DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines