FreeFOAM The Cross-Platform CFD Toolkit
pEqn.H
Go to the documentation of this file.
1 {
2  volScalarField rAU = 1.0/UEqn.A();
4 
5  U = rAU*UEqn.H();
7  (
8  "phiU",
9  (fvc::interpolate(U) & mesh.Sf())
10  + fvc::ddtPhiCorr(rAU, rho, U, phi)
11  );
12 
13  adjustPhi(phiU, U, p_rgh);
14 
15  phi = phiU - ghf*fvc::snGrad(rho)*rAUf*mesh.magSf();
16 
17  for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
18  {
19  fvScalarMatrix p_rghEqn
20  (
21  fvm::laplacian(rAUf, p_rgh) == fvc::div(phi)
22  );
23 
24  p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
25 
26  p_rghEqn.solve
27  (
28  mesh.solver
29  (
30  p_rgh.select
31  (
32  finalIter
33  && corr == nCorr-1
34  && nonOrth == nNonOrthCorr
35  )
36  )
37  );
38 
39  if (nonOrth == nNonOrthCorr)
40  {
41  phi -= p_rghEqn.flux();
42  }
43  }
44 
45  U += rAU*fvc::reconstruct((phi - phiU)/rAUf);
46  U.correctBoundaryConditions();
47 
49 
50  p == p_rgh + rho*gh;
51 
52  if (p_rgh.needReference())
53  {
55  (
56  "p",
57  p.dimensions(),
59  );
60  p_rgh = p - rho*gh;
61  }
62 }