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 if (pressureImplicitPorosity)
00002 {
00003     U = trTU()&UEqn().H();
00004 }
00005 else
00006 {
00007     U = trAU()*UEqn().H();
00008 }
00009 
00010 UEqn.clear();
00011 phi = fvc::interpolate(U) & mesh.Sf();
00012 adjustPhi(phi, U, p);
00013 
00014 for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
00015 {
00016     tmp<fvScalarMatrix> tpEqn;
00017 
00018     if (pressureImplicitPorosity)
00019     {
00020         tpEqn = (fvm::laplacian(trTU(), p) == fvc::div(phi));
00021     }
00022     else
00023     {
00024         tpEqn = (fvm::laplacian(trAU(), p) == fvc::div(phi));
00025     }
00026 
00027     tpEqn().setReference(pRefCell, pRefValue);
00028     // retain the residual from the first iteration
00029     if (nonOrth == 0)
00030     {
00031         eqnResidual = tpEqn().solve().initialResidual();
00032         maxResidual = max(eqnResidual, maxResidual);
00033     }
00034     else
00035     {
00036         tpEqn().solve();
00037     }
00038 
00039     if (nonOrth == nNonOrthCorr)
00040     {
00041         phi -= tpEqn().flux();
00042     }
00043 }
00044 
00045 #include <finiteVolume/continuityErrs.H>
00046 
00047 // Explicitly relax pressure for momentum corrector
00048 p.relax();
00049 
00050 if (pressureImplicitPorosity)
00051 {
00052     U -= trTU()&fvc::grad(p);
00053 }
00054 else
00055 {
00056     U -= trAU()*fvc::grad(p);
00057 }
00058 
00059 U.correctBoundaryConditions();
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines