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 {
00002     volScalarField rAU = 1.0/UEqn.A();
00003     surfaceScalarField rAUf = fvc::interpolate(rAU);
00004 
00005     U = rAU*UEqn.H();
00006 
00007     surfaceScalarField phiU
00008     (
00009         "phiU",
00010         (fvc::interpolate(U) & mesh.Sf())
00011       //+ fvc::ddtPhiCorr(rAU, rho, U, phi)
00012     );
00013     mrfZones.relativeFlux(phiU);
00014 
00015     adjustPhi(phiU, U, p_rgh);
00016 
00017     phi = phiU +
00018     (
00019         mixture.surfaceTensionForce()
00020       - ghf*fvc::snGrad(rho)
00021     )*rAUf*mesh.magSf();
00022 
00023     for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
00024     {
00025         fvScalarMatrix p_rghEqn
00026         (
00027             fvm::laplacian(rAUf, p_rgh) == fvc::div(phi)
00028         );
00029 
00030         p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
00031 
00032         p_rghEqn.solve
00033         (
00034             mesh.solver
00035             (
00036                 p_rgh.select(corr == nCorr-1 && nonOrth == nNonOrthCorr)
00037             )
00038         );
00039 
00040         if (nonOrth == nNonOrthCorr)
00041         {
00042             phi -= p_rghEqn.flux();
00043         }
00044     }
00045 
00046     U += rAU*fvc::reconstruct((phi - phiU)/rAUf);
00047     U.correctBoundaryConditions();
00048 
00049     #include <finiteVolume/continuityErrs.H>
00050 
00051     p == p_rgh + rho*gh;
00052 
00053     if (p_rgh.needReference())
00054     {
00055         p += dimensionedScalar
00056         (
00057             "p",
00058             p.dimensions(),
00059             pRefValue - getRefCellValue(p, pRefCell)
00060         );
00061         p_rgh = p - rho*gh;
00062     }
00063 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines