pEqn.H
Go to the documentation of this file.
1{
2 rAU = 1.0/UEqn.A();
3 //mesh.interpolate(rAU);
4
5 surfaceScalarField faceMask(localMin<scalar>(mesh).interpolate(cellMask));
6
7 surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU));
8
9 volVectorField H("H", UEqn.H());
10
11 volVectorField HbyA("HbyA", U);
12 //HbyA = rAU*UEqn.H();
14
16 {
17 #include "interpolatedFaces.H"
18 }
19
20 surfaceScalarField phiHbyA("phiHbyA", fvc::flux(HbyA));
21
23 {
24 surfaceScalarField faceMaskOld
25 (
26 localMin<scalar>(mesh).interpolate(cellMask.oldTime())
27 );
28 phiHbyA +=
29 fvc::interpolate(rho*rAU)*faceMaskOld*fvc::ddtCorr(U, Uf);
30 }
31 MRF.makeRelative(phiHbyA);
32
33 if (p_rgh.needReference())
34 {
35 fvc::makeRelative(phiHbyA, U);
37 fvc::makeAbsolute(phiHbyA, U);
38 }
39
41 {
42 fvc::makeRelative(phiHbyA, U);
43 oversetAdjustPhi(phiHbyA, U);
44 fvc::makeAbsolute(phiHbyA, U);
45 }
46
47 surfaceScalarField phig
48 (
49 (
50 mixture.surfaceTensionForce()
51 - ghf*fvc::snGrad(rho)
52 )*faceMask*rAUf*mesh.magSf()
53 );
54
56
57 if (adjustFringe)
58 {
59 fvc::makeRelative(phiHbyA, U);
60 oversetAdjustPhi(phiHbyA, U);
61 fvc::makeAbsolute(phiHbyA, U);
62 }
63
64 // Update the pressure BCs to ensure flux consistency
66
67 while (pimple.correctNonOrthogonal())
68 {
69 fvScalarMatrix p_rghEqn
70 (
71 fvm::laplacian(rAUf, p_rgh) == fvc::div(phiHbyA)
72 );
73
74 p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
75
76 p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
77
78 if (pimple.finalNonOrthogonalIter())
79 {
80 phi = phiHbyA - p_rghEqn.flux();
81
82 p_rgh.relax();
83
84 U =
85 cellMask*
86 (
87 HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rAUf)
88 );
89
90 U.correctBoundaryConditions();
91 fvOptions.correct(U);
92 }
93 }
94
95 #include "continuityErrs.H"
96
97 {
98 Uf = fvc::interpolate(U);
99 surfaceVectorField n(mesh.Sf()/mesh.magSf());
100 Uf += n*(phi/mesh.magSf() - (n & Uf));
101 }
102
103 // Make the fluxes relative to the mesh motion
104 fvc::makeRelative(phi, U);
105
106 // Zero faces H-I for transport Eq after pEq
107 phi *= faceMask;
108
109 p == p_rgh + rho*gh;
110
111 if (p_rgh.needReference())
112 {
113 p_rgh += dimensionedScalar
114 (
115 "p_rgh",
116 p.dimensions(),
117 pRefValue - getRefCellValue(p_rgh, pRefCell)
118 );
119 p == p_rgh + rho*gh;
120 }
121}
label n
volScalarField & p_rgh
fv::options & fvOptions
surfaceScalarField & phi
const scalar pRefValue
const surfaceScalarField & ghf
const label pRefCell
IOMRFZoneList & MRF
const volScalarField & gh
pimpleControl & pimple
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
surfaceScalarField faceMask(localMin< scalar >(mesh).interpolate(cellMask))
mesh interpolate(rAU)
ddtCorr
Definition: readControls.H:9
dynamicFvMesh & mesh
autoPtr< surfaceVectorField > Uf
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU))
adjustPhi(phiHbyA, U, p_rgh)
volVectorField H("H", UEqn.H())
massFluxInterpolation
Definition: readControls.H:7
tmp< volScalarField > rAU
Definition: initCorrectPhi.H:1
adjustFringe
Definition: readControls.H:16
Info<< "Creating temperaturePhaseChangeTwoPhaseMixture\n"<< endl;autoPtr< temperaturePhaseChangeTwoPhaseMixture > mixture
Definition: createFields.H:39
Calculates and prints the continuity errors.