FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

correctPhi.H

Go to the documentation of this file.
00001 {
00002     if (mesh.changing())
00003     {
00004         forAll(U.boundaryField(), patchi)
00005         {
00006             if (U.boundaryField()[patchi].fixesValue())
00007             {
00008                 U.boundaryField()[patchi].initEvaluate();
00009             }
00010         }
00011 
00012         forAll(U.boundaryField(), patchi)
00013         {
00014             if (U.boundaryField()[patchi].fixesValue())
00015             {
00016                 U.boundaryField()[patchi].evaluate();
00017 
00018                 phi.boundaryField()[patchi] =
00019                 U.boundaryField()[patchi] & mesh.Sf().boundaryField()[patchi];
00020             }
00021         }
00022     }
00023 
00024     #include <finiteVolume/continuityErrs.H>
00025 
00026     volScalarField pcorr
00027     (
00028         IOobject
00029         (
00030             "pcorr",
00031             runTime.timeName(),
00032             mesh,
00033             IOobject::NO_READ,
00034             IOobject::NO_WRITE
00035         ),
00036         mesh,
00037         dimensionedScalar("pcorr", p.dimensions(), 0.0),
00038         pcorrTypes
00039     );
00040 
00041     dimensionedScalar rAUf("(1|A(U))", dimTime/rho.dimensions(), 1.0);
00042 
00043     adjustPhi(phi, U, pcorr);
00044 
00045     for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
00046     {
00047         fvScalarMatrix pcorrEqn
00048         (
00049             fvm::laplacian(rAUf, pcorr) == fvc::div(phi) - divU
00050         );
00051 
00052         pcorrEqn.solve();
00053 
00054         if (nonOrth == nNonOrthCorr)
00055         {
00056             phi -= pcorrEqn.flux();
00057         }
00058     }
00059 
00060     #include <finiteVolume/continuityErrs.H>
00061 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines