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

correctPhi.H

Go to the documentation of this file.
00001 {
00002     #include "continuityErrs.H"
00003 
00004     volScalarField pcorr
00005     (
00006         IOobject
00007         (
00008             "pcorr",
00009             runTime.timeName(),
00010             mesh,
00011             IOobject::NO_READ,
00012             IOobject::NO_WRITE
00013         ),
00014         mesh,
00015         dimensionedScalar("pcorr", p.dimensions(), 0.0),
00016         pcorrTypes
00017     );
00018 
00019     dimensionedScalar rAUf("(1|A(U))", dimTime/rho.dimensions(), 1.0);
00020 
00021     adjustPhi(phi, U, pcorr);
00022 
00023     for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
00024     {
00025         fvScalarMatrix pcorrEqn
00026         (
00027             fvm::laplacian(rAUf, pcorr) == fvc::div(phi) - divU
00028         );
00029 
00030         pcorrEqn.solve();
00031 
00032         if (nonOrth == nNonOrthCorr)
00033         {
00034             phi -= pcorrEqn.flux();
00035         }
00036     }
00037 
00038     #include "continuityErrs.H"
00039 }
Copyright © 2000-2009 OpenCFD Ltd