FreeFOAM The Cross-Platform CFD Toolkit
pEqn.H
Go to the documentation of this file.
1  p.boundaryField().updateCoeffs();
2 
4  U = UEqn().H()/AU;
5  UEqn.clear();
7  adjustPhi(phi, U, p);
8 
9  // Non-orthogonal pressure corrector loop
10  for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
11  {
12  fvScalarMatrix pEqn
13  (
14  fvm::laplacian(1.0/AU, p) == fvc::div(phi)
15  );
16 
17  pEqn.setReference(pRefCell, pRefValue);
18  // retain the residual from the first iteration
19  if (nonOrth == 0)
20  {
21  eqnResidual = pEqn.solve().initialResidual();
23  }
24  else
25  {
26  pEqn.solve();
27  }
28 
29  if (nonOrth == nNonOrthCorr)
30  {
31  phi -= pEqn.flux();
32  }
33  }
34 
36 
37  // Explicitly relax pressure for momentum corrector
38  p.relax();
39 
40  // Momentum corrector
41  U -= fvc::grad(p)/AU;
42  U.correctBoundaryConditions();
43 
44 // ************************ vim: set sw=4 sts=4 et: ************************ //