pEqn.H
Go to the documentation of this file.
1{
2 if (correctPhi)
3 {
4 rAU.ref() = 1.0/UEqn.A();
5 }
6 else
7 {
8 rAU = 1.0/UEqn.A();
9 }
10
11 surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU()));
12
13 volVectorField HbyA("HbyA", U);
14 HbyA = rAU()*UEqn.H();
15
16 surfaceScalarField phiHbyA
17 (
18 "phiHbyA",
19 (fvc::interpolate(HbyA) & mesh.Sf())
20 + fvc::interpolate(rho*rAU())*fvc::ddtCorr(U, phi)
21 );
22
23 if (p_rgh.needReference())
24 {
25 fvc::makeRelative(phiHbyA, U);
27 fvc::makeAbsolute(phiHbyA, U);
28 }
29
30 surfaceScalarField phig
31 (
32 (
33 fluid.surfaceTensionForce()
34 - ghf*fvc::snGrad(rho)
35 )*rAUf*mesh.magSf()
36 );
37
39
40 // Update the fixedFluxPressure BCs to ensure flux consistency
42
43 while (pimple.correctNonOrthogonal())
44 {
45
46 fvScalarMatrix p_rghEqn
47 (
48 fvc::div(phiHbyA)
49 - fvm::laplacian(rAUf, p_rgh)
50 );
51
52 if (fluid.includeVolChange())
53 {
54 p_rghEqn += fluid.volTransfer(p_rgh);
55 }
56
57 p_rghEqn.setReference(pRefCell, pRefValue);
58
59 p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
60
61 if (pimple.finalNonOrthogonalIter())
62 {
63 phi = phiHbyA + p_rghEqn.flux();
64
65 p_rgh.relax();
66
67 U = HbyA + rAU()*fvc::reconstruct((phig + p_rghEqn.flux())/rAUf);
68
69 U.correctBoundaryConditions();
70 fvOptions.correct(U);
71 K = 0.5*magSqr(U);
72 }
73 }
74
75 #include "continuityErrs.H"
76
77 // Correct Uf if the mesh is moving
78 fvc::correctUf(Uf, U, phi);
79
80 // Make the fluxes relative to the mesh motion
81 fvc::makeRelative(phi, U);
82
83 p == p_rgh + rho*gh;
84
85 if (p_rgh.needReference())
86 {
87 p += dimensionedScalar
88 (
89 "p",
90 p.dimensions(),
91 pRefValue - getRefCellValue(p, pRefCell)
92 );
93 p_rgh = p - rho*gh;
94 }
95
97 {
98 rAU.clear();
99 }
100}
CGAL::Exact_predicates_exact_constructions_kernel K
volScalarField & p_rgh
fv::options & fvOptions
surfaceScalarField & phi
const scalar pRefValue
const surfaceScalarField & ghf
const label pRefCell
const volScalarField & gh
pimpleControl & pimple
twoPhaseSystem & fluid
U
Definition: pEqn.H:72
volScalarField & p
surfaceScalarField phig("phig", -rhorAUf *ghf *fvc::snGrad(rho) *mesh.magSf())
fvVectorMatrix & UEqn
Definition: UEqn.H:13
phiHbyA
Definition: pcEqn.H:73
HbyA
Definition: pcEqn.H:74
dynamicFvMesh & mesh
autoPtr< surfaceVectorField > Uf
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU))
adjustPhi(phiHbyA, U, p_rgh)
tmp< volScalarField > rAU
Definition: initCorrectPhi.H:1
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
correctPhi