pEqn.H
Go to the documentation of this file.
1 // Option 1: interpolate rAU, do not block out rAU on blocked cells
2 volScalarField rAU("rAU", 1.0/UEqn.A());
3 mesh.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 //
17 volVectorField H("H", UEqn.H());
18 
19 volVectorField HbyA("HbyA", U);
21 
23 {
24  #include "interpolatedFaces.H"
25 }
26 
27 if (runTime.outputTime())
28 {
29  H.write();
30  rAU.write();
31  HbyA.write();
32 }
33 
34 if (pimple.nCorrPISO() <= 1)
35 {
36  tUEqn.clear();
37 }
38 
40 
41 if (ddtCorr)
42 {
43  surfaceScalarField faceMaskOld
44  (
45  localMin<scalar>(mesh).interpolate(cellMask.oldTime())
46  );
47  phiHbyA += rAUf*faceMaskOld*fvc::ddtCorr(U, Uf);
48 }
49 
50 MRF.makeRelative(phiHbyA);
51 
52 // WIP
53 if (p.needReference())
54 {
56  adjustPhi(phiHbyA, U, p);
58 }
59 
60 
62 {
66 }
67 
68 while (pimple.correctNonOrthogonal())
69 {
70  fvScalarMatrix pEqn
71  (
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
91 p.relax();
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
99 U = cellMask*(HbyA - rAU*gradP);
100 U.correctBoundaryConditions();
101 
102 fvOptions.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
112 
114 (
115  localMin<scalar>(mesh).interpolate(cellMask)
116 );
117 phi *= faceMask;
runTime
engineTime & runTime
Definition: createEngineTime.H:13
Foam::constrainHbyA
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Definition: constrainHbyA.C:35
gradP
volVectorField gradP(fvc::grad(p))
Foam::fvc::flux
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
phiHbyA
phiHbyA
Definition: pEqn.H:20
interpolatedFaces.H
faceMask
surfaceScalarField faceMask(localMin< scalar >(mesh).interpolate(cellMask))
Foam::fac::grad
tmp< GeometricField< typename outerProduct< vector, Type >::type, faPatchField, areaMesh >> grad(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Definition: facGrad.C:56
Foam::fac::div
tmp< GeometricField< Type, faPatchField, areaMesh > > div(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Definition: facDiv.C:50
MRF
IOMRFZoneList & MRF
Definition: setRegionFluidFields.H:22
pimple
pimpleControl & pimple
Definition: setRegionFluidFields.H:56
HbyA
HbyA
Definition: pEqn.H:4
tUEqn
tmp< fvVectorMatrix > tUEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+MRF.DDt(rho, U)+turbulence->divDevRhoReff(U)==fvOptions(rho, U))
Foam::fvScalarMatrix
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:44
fvOptions
fv::options & fvOptions
Definition: setRegionFluidFields.H:23
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
makeRelative
MRF makeRelative(fvc::interpolate(rho), phiHbyA)
ddtCorr
ddtCorr
Definition: readControls.H:9
massFluxInterpolation
massFluxInterpolation
Definition: readControls.H:7
p
p
Definition: pEqn.H:50
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
rAU
volScalarField rAU(1.0/UEqn.A())
Foam::volVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:62
H
volVectorField H("H", UEqn.H())
U
U
Definition: pEqn.H:72
Foam::oversetAdjustPhi
bool oversetAdjustPhi(surfaceScalarField &phi, const volVectorField &U)
Adjust the balance of fluxes to obey continuity.
Definition: oversetAdjustPhi.C:38
adjustFringe
adjustFringe
Definition: readControls.H:16
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:54
phi
phi
Definition: pEqn.H:18
UEqn
fvVectorMatrix & UEqn
Definition: UEqn.H:13
Uf
Uf
Definition: pEqn.H:107
Foam::fac::laplacian
tmp< GeometricField< Type, faPatchField, areaMesh > > laplacian(const GeometricField< Type, faPatchField, areaMesh > &vf, const word &name)
Definition: facLaplacian.C:47
Foam::fvc::makeAbsolute
void makeAbsolute(surfaceScalarField &phi, const volVectorField &U)
Make the given flux absolute.
Definition: fvcMeshPhi.C:116
continuityErrs.H
Calculates and prints the continuity errors.
Foam::surfaceVectorField
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
Definition: surfaceFieldsFwd.H:59
adjustPhi
adjustPhi(phiHbyA, U, p_rgh)
interpolate
mesh interpolate(rAU)
n
surfaceVectorField n(mesh.Sf()/mesh.magSf())
pRefCell
const label pRefCell
Definition: setRegionFluidFields.H:36
rAUf
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU))
pRefValue
const scalar pRefValue
Definition: setRegionFluidFields.H:37