00001 p.boundaryField().updateCoeffs(); 00002 00003 volScalarField AU = UEqn().A(); 00004 U = UEqn().H()/AU; 00005 UEqn.clear(); 00006 phi = fvc::interpolate(U) & mesh.Sf(); 00007 adjustPhi(phi, U, p); 00008 00009 // Non-orthogonal pressure corrector loop 00010 for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) 00011 { 00012 fvScalarMatrix pEqn 00013 ( 00014 fvm::laplacian(1.0/AU, p) == fvc::div(phi) 00015 ); 00016 00017 pEqn.setReference(pRefCell, pRefValue); 00018 // retain the residual from the first iteration 00019 if (nonOrth == 0) 00020 { 00021 eqnResidual = pEqn.solve().initialResidual(); 00022 maxResidual = max(eqnResidual, maxResidual); 00023 } 00024 else 00025 { 00026 pEqn.solve(); 00027 } 00028 00029 if (nonOrth == nNonOrthCorr) 00030 { 00031 phi -= pEqn.flux(); 00032 } 00033 } 00034 00035 # include <finiteVolume/continuityErrs.H> 00036 00037 // Explicitly relax pressure for momentum corrector 00038 p.relax(); 00039 00040 // Momentum corrector 00041 U -= fvc::grad(p)/AU; 00042 U.correctBoundaryConditions(); 00043 00044 // ************************ vim: set sw=4 sts=4 et: ************************ //