FreeFOAM The Cross-Platform CFD Toolkit
pEqn.H
Go to the documentation of this file.
1 {
2  volScalarField rUA("rUA", 1.0/UEqn.A());
4 
5  U = rUA*UEqn.H();
6 
7  phi = (fvc::interpolate(U) & mesh.Sf())
9 
10  surfaceScalarField buoyancyPhi = rUAf*ghf*fvc::snGrad(rhok)*mesh.magSf();
11  phi -= buoyancyPhi;
12 
13  for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
14  {
15  fvScalarMatrix p_rghEqn
16  (
18  );
19 
20  p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
21 
22  p_rghEqn.solve
23  (
24  mesh.solver
25  (
26  p_rgh.select
27  (
28  (
29  finalIter
30  && corr == nCorr-1
31  && nonOrth == nNonOrthCorr
32  )
33  )
34  )
35  );
36 
37  if (nonOrth == nNonOrthCorr)
38  {
39  // Calculate the conservative fluxes
40  phi -= p_rghEqn.flux();
41 
42  // Explicitly relax pressure for momentum corrector
43  p_rgh.relax();
44 
45  // Correct the momentum source with the pressure gradient flux
46  // calculated from the relaxed pressure
47  U -= rUA*fvc::reconstruct((buoyancyPhi + p_rghEqn.flux())/rUAf);
48  U.correctBoundaryConditions();
49  }
50  }
51 
53 
54  p = p_rgh + rhok*gh;
55 
56  if (p_rgh.needReference())
57  {
59  (
60  "p",
61  p.dimensions(),
63  );
64  p_rgh = p - rhok*gh;
65  }
66 }