FreeFOAM The Cross-Platform CFD Toolkit
UEqn.H
Go to the documentation of this file.
1  // Construct the Momentum equation
2 
3  tmp<fvVectorMatrix> UEqn
4  (
5  fvm::div(phi, U)
6  + turbulence->divDevReff(U)
7  );
8 
9  UEqn().relax();
10 
11  // Include the porous media resistance and solve the momentum equation
12  // either implicit in the tensorial resistance or transport using by
13  // including the spherical part of the resistance in the momentum diagonal
14 
15  tmp<volScalarField> trAU;
16  tmp<volTensorField> trTU;
17 
19  {
20  tmp<volTensorField> tTU = tensor(I)*UEqn().A();
21  pZones.addResistance(UEqn(), tTU());
22  trTU = inv(tTU());
23  trTU().rename("rAU");
24 
25  volVectorField gradp = fvc::grad(p);
26 
27  for (int UCorr=0; UCorr<nUCorr; UCorr++)
28  {
29  U = trTU() & (UEqn().H() - gradp);
30  }
31  U.correctBoundaryConditions();
32  }
33  else
34  {
35  pZones.addResistance(UEqn());
36 
38  (
39  UEqn() == -fvc::grad(p)
40  ). initialResidual();
41 
43 
44  trAU = 1.0/UEqn().A();
45  trAU().rename("rAU");
46  }