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();
12 adjustPhi(phi, U, p);
13 
14 for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
15 {
16  tmp<fvScalarMatrix> tpEqn;
17 
19  {
20  tpEqn = (fvm::laplacian(trTU(), p) == fvc::div(phi));
21  }
22  else
23  {
24  tpEqn = (fvm::laplacian(trAU(), p) == fvc::div(phi));
25  }
26 
27  tpEqn().setReference(pRefCell, pRefValue);
28  // retain the residual from the first iteration
29  if (nonOrth == 0)
30  {
31  eqnResidual = tpEqn().solve().initialResidual();
33  }
34  else
35  {
36  tpEqn().solve();
37  }
38 
39  if (nonOrth == nNonOrthCorr)
40  {
41  phi -= tpEqn().flux();
42  }
43 }
44 
46 
47 // Explicitly relax pressure for momentum corrector
48 p.relax();
49 
51 {
52  U -= trTU()&fvc::grad(p);
53 }
54 else
55 {
56  U -= trAU()*fvc::grad(p);
57 }
58 
59 U.correctBoundaryConditions();