ENH: autoLayerDriver: better layering information message
[OpenFOAM-2.0.x.git] / applications / solvers / compressible / rhoSimpleFoam / rhoPorousMRFSimpleFoam / UEqn.H
blobc0e087b536c3ffdffb01214e7204b13abfba8a46
1     // Construct the Momentum equation
3     tmp<fvVectorMatrix> UEqn
4     (
5         fvm::div(phi, U)
6       + turbulence->divDevRhoReff(U)
7     );
9     UEqn().relax();
11     mrfZones.addCoriolis(rho, UEqn());
13     // Include the porous media resistance and solve the momentum equation
14     // either implicit in the tensorial resistance or transport using by
15     // including the spherical part of the resistance in the momentum diagonal
17     tmp<volScalarField> trAU;
18     tmp<volTensorField> trTU;
20     if (pressureImplicitPorosity)
21     {
22         tmp<volTensorField> tTU = tensor(I)*UEqn().A();
23         pZones.addResistance(UEqn(), tTU());
24         trTU = inv(tTU());
25         trTU().rename("rAU");
27         volVectorField gradp(fvc::grad(p));
29         for (int UCorr=0; UCorr<nUCorr; UCorr++)
30         {
31             U = trTU() & (UEqn().H() - gradp);
32         }
33         U.correctBoundaryConditions();
34     }
35     else
36     {
37         pZones.addResistance(UEqn());
39         solve(UEqn() == -fvc::grad(p));
41         trAU = 1.0/UEqn().A();
42         trAU().rename("rAU");
43     }