|
|
|
pEqn.HGo to the documentation of this file.00001 { 00002 volScalarField rUA("rUA", 1.0/UEqn().A()); 00003 surfaceScalarField rUAf("(1|A(U))", fvc::interpolate(rUA)); 00004 00005 U = rUA*UEqn().H(); 00006 UEqn.clear(); 00007 00008 phi = fvc::interpolate(U) & mesh.Sf(); 00009 adjustPhi(phi, U, p); 00010 00011 surfaceScalarField buoyancyPhi = 00012 rUAf*fvc::interpolate(rhok)*(g & mesh.Sf()); 00013 phi += buoyancyPhi; 00014 00015 for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) 00016 { 00017 fvScalarMatrix pEqn 00018 ( 00019 fvm::laplacian(rUAf, p) == fvc::div(phi) 00020 ); 00021 00022 pEqn.setReference(pRefCell, pRefValue); 00023 00024 // retain the residual from the first iteration 00025 if (nonOrth == 0) 00026 { 00027 eqnResidual = pEqn.solve().initialResidual(); 00028 maxResidual = max(eqnResidual, maxResidual); 00029 } 00030 else 00031 { 00032 pEqn.solve(); 00033 } 00034 00035 if (nonOrth == nNonOrthCorr) 00036 { 00037 // Calculate the conservative fluxes 00038 phi -= pEqn.flux(); 00039 00040 // Explicitly relax pressure for momentum corrector 00041 p.relax(); 00042 00043 // Correct the momentum source with the pressure gradient flux 00044 // calculated from the relaxed pressure 00045 U += rUA*fvc::reconstruct((buoyancyPhi - pEqn.flux())/rUAf); 00046 U.correctBoundaryConditions(); 00047 } 00048 } 00049 00050 #include "continuityErrs.H" 00051 } |