00001 // Construct the Momentum equation 00002 00003 tmp<fvVectorMatrix> UEqn 00004 ( 00005 fvm::div(phi, U) 00006 + turbulence->divDevRhoReff(U) 00007 ); 00008 00009 UEqn().relax(); 00010 00011 // Include the porous media resistance and solve the momentum equation 00012 // either implicit in the tensorial resistance or transport using by 00013 // including the spherical part of the resistance in the momentum diagonal 00014 00015 tmp<volScalarField> trAU; 00016 tmp<volTensorField> trTU; 00017 00018 if (pressureImplicitPorosity) 00019 { 00020 tmp<volTensorField> tTU = tensor(I)*UEqn().A(); 00021 pZones.addResistance(UEqn(), tTU()); 00022 trTU = inv(tTU()); 00023 trTU().rename("rAU"); 00024 00025 volVectorField gradp = fvc::grad(p); 00026 00027 for (int UCorr=0; UCorr<nUCorr; UCorr++) 00028 { 00029 U = trTU() & (UEqn().H() - gradp); 00030 } 00031 U.correctBoundaryConditions(); 00032 } 00033 else 00034 { 00035 pZones.addResistance(UEqn()); 00036 00037 eqnResidual = solve 00038 ( 00039 UEqn() == -fvc::grad(p) 00040 ). initialResidual(); 00041 00042 maxResidual = max(eqnResidual, maxResidual); 00043 00044 trAU = 1.0/UEqn().A(); 00045 trAU().rename("rAU"); 00046 } 00047 00048 // ************************ vim: set sw=4 sts=4 et: ************************ //