OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

pEqn.H

Go to the documentation of this file.
00001 {
00002     volScalarField rUA = 1.0/UEqn.A();
00003     surfaceScalarField rUAf = fvc::interpolate(rUA);
00004 
00005     U = rUA*UEqn.H();
00006 
00007     surfaceScalarField phiU
00008     (
00009         "phiU",
00010         (fvc::interpolate(U) & mesh.Sf()) + fvc::ddtPhiCorr(rUA, rho, U, phi)
00011     );
00012 
00013     adjustPhi(phiU, U, p);
00014 
00015     phi = phiU +
00016         (
00017             mixture.surfaceTensionForce()*mesh.magSf()
00018           + fvc::interpolate(rho)*(g & mesh.Sf())
00019         )*rUAf;
00020 
00021     for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
00022     {
00023         fvScalarMatrix pEqn
00024         (
00025             fvm::laplacian(rUAf, p) == fvc::div(phi)
00026         );
00027 
00028         pEqn.setReference(pRefCell, pRefValue);
00029 
00030         if (corr == nCorr-1)
00031         {
00032             pEqn.solve(mesh.solver(p.name() + "Final"));
00033         }
00034         else
00035         {
00036             pEqn.solve(mesh.solver(p.name()));
00037         }
00038 
00039         if (nonOrth == nNonOrthCorr)
00040         {
00041             phi -= pEqn.flux();
00042         }
00043     }
00044 
00045     U += rUA*fvc::reconstruct((phi - phiU)/rUAf);
00046     U.correctBoundaryConditions();
00047 }
Copyright © 2000-2009 OpenCFD Ltd