FreeFOAM The Cross-Platform CFD Toolkit
pEqn.H
Go to the documentation of this file.
2 {
3  U = trTU()&UEqn().H();
4 }
5 else
6 {
7  U = trAU()*UEqn().H();
8 }
9 
10 UEqn.clear();
11 
14 
15 for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
16 {
17  tmp<fvScalarMatrix> tpEqn;
18 
20  {
21  tpEqn = (fvm::laplacian(rho*trTU(), p) == fvc::div(phi));
22  }
23  else
24  {
25  tpEqn = (fvm::laplacian(rho*trAU(), p) == fvc::div(phi));
26  }
27 
28  tpEqn().setReference(pRefCell, pRefValue);
29  // retain the residual from the first iteration
30  if (nonOrth == 0)
31  {
32  eqnResidual = tpEqn().solve().initialResidual();
34  }
35  else
36  {
37  tpEqn().solve();
38  }
39 
40  if (nonOrth == nNonOrthCorr)
41  {
42  phi -= tpEqn().flux();
43  }
44 }
45 
47 
48 // Explicitly relax pressure for momentum corrector
49 p.relax();
50 
52 {
53  U -= trTU()&fvc::grad(p);
54 }
55 else
56 {
57  U -= trAU()*fvc::grad(p);
58 }
59 
60 U.correctBoundaryConditions();
61 
62 bound(p, pMin);
63 
64 // For closed-volume cases adjust the pressure and density levels
65 // to obey overall mass continuity
66 if (closedVolume)
67 {
70 }
71 
72 rho = thermo.rho();
73 rho.relax();
74 Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() << endl;
75 
76 // ************************ vim: set sw=4 sts=4 et: ************************ //