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())
00011       + fvc::ddtPhiCorr(rUA, rho, U, phi)
00012     );
00013 
00014     adjustPhi(phiU, U, p);
00015 
00016     phi = phiU +
00017         (
00018             fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)*mesh.magSf()
00019           + fvc::interpolate(rho)*(g & mesh.Sf())
00020         )*rUAf;
00021 
00022     for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
00023     {
00024         fvScalarMatrix pEqn
00025         (
00026             fvm::laplacian(rUAf, p) == fvc::div(phi)
00027         );
00028 
00029         pEqn.setReference(pRefCell, pRefValue);
00030 
00031         if (corr == nCorr-1 && nonOrth == nNonOrthCorr)
00032         {
00033             pEqn.solve(mesh.solver(p.name() + "Final"));
00034         }
00035         else
00036         {
00037             pEqn.solve(mesh.solver(p.name()));
00038         }
00039 
00040         if (nonOrth == nNonOrthCorr)
00041         {
00042             phi -= pEqn.flux();
00043         }
00044     }
00045 
00046     U += rUA*fvc::reconstruct((phi - phiU)/rUAf);
00047     U.correctBoundaryConditions();
00048 }
Copyright © 2000-2009 OpenCFD Ltd