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();
6  surfaceScalarField phiU("phiU", (fvc::interpolate(U) & mesh.Sf()));
7 
8  if (p_rgh.needReference())
9  {
11  adjustPhi(phiU, U, p_rgh);
13  }
14 
15  phi = phiU +
16  (
17  fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
19  )*rAUf*mesh.magSf();
20 
21  for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
22  {
23  fvScalarMatrix p_rghEqn
24  (
25  fvm::laplacian(rAUf, p_rgh) == fvc::div(phi)
26  );
27 
28  p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
29 
30  p_rghEqn.solve
31  (
32  mesh.solver
33  (
34  p_rgh.select(corr == nCorr-1 && nonOrth == nNonOrthCorr)
35  )
36  );
37 
38  if (nonOrth == nNonOrthCorr)
39  {
40  phi -= p_rghEqn.flux();
41  }
42  }
43 
44  U += rAU*fvc::reconstruct((phi - phiU)/rAUf);
45  U.correctBoundaryConditions();
46 
48 
49  // Make the fluxes relative to the mesh motion
51 
52  p == p_rgh + rho*gh;
53 
54  if (p_rgh.needReference())
55  {
57  (
58  "p",
59  p.dimensions(),
61  );
62  p_rgh = p - rho*gh;
63  }
64 }