pEqn.H
Go to the documentation of this file.
1// Option 1: interpolate rAU, do not block out rAU on blocked cells
2volScalarField rAU("rAU", 1.0/UEqn.A());
3mesh.interpolate(rAU);
4
5// Option 2: do not interpolate rAU but block out rAU
6//surfaceScalarField rAUf("rAUf", fvc::interpolate(blockedCells*rAU));
7
8
9// Option 3: do not interpolate rAU but zero out rAUf on faces on holes
10// But what about:
11//
12// H
13// H I C C C C
14// H
15//
16surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU));
17volVectorField H("H", UEqn.H());
18
19volVectorField HbyA("HbyA", U);
21
23{
24 #include "interpolatedFaces.H"
25}
26
27if (runTime.outputTime())
28{
29 H.write();
30 rAU.write();
31 HbyA.write();
32}
33
34if (pimple.nCorrPISO() <= 1)
35{
36 tUEqn.clear();
37}
38
39phiHbyA = fvc::flux(HbyA);
40
42{
43 surfaceScalarField faceMaskOld
44 (
45 localMin<scalar>(mesh).interpolate(cellMask.oldTime())
46 );
47 phiHbyA += rAUf*faceMaskOld*fvc::ddtCorr(U, Uf);
48}
49
50MRF.makeRelative(phiHbyA);
51
52// WIP
53if (p.needReference())
54{
55 fvc::makeRelative(phiHbyA, U);
57 fvc::makeAbsolute(phiHbyA, U);
58}
59
60
62{
63 fvc::makeRelative(phiHbyA, U);
64 oversetAdjustPhi(phiHbyA, U);
65 fvc::makeAbsolute(phiHbyA, U);
66}
67
68while (pimple.correctNonOrthogonal())
69{
70 fvScalarMatrix pEqn
71 (
72 fvm::laplacian(rAUf, p) == fvc::div(phiHbyA)
73 );
74
75 pEqn.setReference(pRefCell, pRefValue);
76
77 pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
78
79 if (pimple.finalNonOrthogonalIter())
80 {
81 phi = phiHbyA - pEqn.flux();
82 // option 2:
83 // rAUf*fvc::snGrad(p)*mesh.magSf();
84 }
85}
86
87
88#include "continuityErrs.H"
89
90// Explicitly relax pressure for momentum corrector
91p.relax();
92volVectorField gradP(fvc::grad(p));
93
94// Option 2: zero out velocity on blocked out cells
95//U = HbyA - rAU*cellMask*gradP;
96// Option 3: zero out velocity on blocked out cells
97// This is needed for the scalar Eq (k,epsilon, etc)
98// which can use U as source term
99U = cellMask*(HbyA - rAU*gradP);
100U.correctBoundaryConditions();
101
102fvOptions.correct(U);
103
104{
105 Uf = fvc::interpolate(U);
106 surfaceVectorField n(mesh.Sf()/mesh.magSf());
107 Uf += n*(phi/mesh.magSf() - (n & Uf));
108}
109
110// Make the fluxes relative to the mesh motion
111fvc::makeRelative(phi, U);
112
113surfaceScalarField faceMask
114(
115 localMin<scalar>(mesh).interpolate(cellMask)
116);
117phi *= faceMask;
label n
fv::options & fvOptions
surfaceScalarField & phi
const scalar pRefValue
const label pRefCell
IOMRFZoneList & MRF
pimpleControl & pimple
U
Definition: pEqn.H:72
volScalarField & p
tmp< fvVectorMatrix > tUEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+MRF.DDt(rho, U)+turbulence->divDevRhoReff(U)==fvOptions(rho, U))
fvVectorMatrix & UEqn
Definition: UEqn.H:13
phiHbyA
Definition: pcEqn.H:73
HbyA
Definition: pcEqn.H:74
surfaceScalarField faceMask(localMin< scalar >(mesh).interpolate(cellMask))
volVectorField gradP(fvc::grad(p))
mesh interpolate(rAU)
ddtCorr
Definition: readControls.H:9
dynamicFvMesh & mesh
engineTime & runTime
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
Calculates and prints the continuity errors.