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 volVectorField HbyA(constrainHbyA(rAU()*UEqn.H(), U, p_rgh));
13 surfaceScalarField phiHbyA
14 (
15 "phiHbyA",
16 fvc::flux(HbyA)
17 + MRF.zeroFilter(fvc::interpolate(rho*rAU())*fvc::ddtCorr(U, phi, Uf))
18 );
19 MRF.makeRelative(phiHbyA);
20
21 if (p_rgh.needReference())
22 {
23 fvc::makeRelative(phiHbyA, U);
25 fvc::makeAbsolute(phiHbyA, U);
26 }
27
28 surfaceScalarField phig
29 (
30 (
31 mixture.surfaceTensionForce()
32 - ghf*fvc::snGrad(rho)
33 )*rAUf*mesh.magSf()
34 );
35
37
38 // Update the pressure BCs to ensure flux consistency
40
41 while (pimple.correctNonOrthogonal())
42 {
43 fvScalarMatrix p_rghEqn
44 (
45 fvm::laplacian(rAUf, p_rgh) == fvc::div(phiHbyA)
46 );
47
48 p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
49
50 p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
51
52 if (pimple.finalNonOrthogonalIter())
53 {
54 phi = phiHbyA - p_rghEqn.flux();
55
56 p_rgh.relax();
57
58 U = HbyA + rAU()*fvc::reconstruct((phig - p_rghEqn.flux())/rAUf);
59 U.correctBoundaryConditions();
60 fvOptions.correct(U);
61 }
62 }
63
64 #include "continuityErrs.H"
65
66 // Correct Uf if the mesh is moving
67 fvc::correctUf(Uf, U, phi);
68
69 // Make the fluxes relative to the mesh motion
70 fvc::makeRelative(phi, U);
71
72 p == p_rgh + rho*gh;
73
74 if (p_rgh.needReference())
75 {
76 p += dimensionedScalar
77 (
78 "p",
79 p.dimensions(),
80 pRefValue - getRefCellValue(p, pRefCell)
81 );
82 p_rgh = p - rho*gh;
83 }
84
86 {
87 rAU.clear();
88 }
89}
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
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
Info<< "Creating temperaturePhaseChangeTwoPhaseMixture\n"<< endl;autoPtr< temperaturePhaseChangeTwoPhaseMixture > mixture
Definition: createFields.H:39