pEqn.H
Go to the documentation of this file.
1 volScalarField rAU(1.0/UEqn().A());
2 volVectorField HbyA("HbyA", U);
3 HbyA = rAU*UEqn().H();
4 
6 (
7  "phiHbyA",
8  (fvc::interpolate(HbyA) & mesh.Sf())
10 );
11 
12 MRF.makeRelative(phiHbyA);
13 
14 if (p.needReference())
15 {
17  adjustPhi(phiHbyA, U, p);
19 }
20 
21 tmp<volScalarField> rAtU(rAU);
22 
23 if (pimple.consistent())
24 {
25  rAtU = 1.0/max(1.0/rAU - UEqn().H1(), 0.1/rAU);
26  phiHbyA +=
27  fvc::interpolate(rAtU() - rAU)*fvc::snGrad(p)*mesh.magSf();
28  HbyA -= (rAU - rAtU())*fvc::grad(p);
29 }
30 
31 if (pimple.nCorrPISO() <= 1)
32 {
33  UEqn.clear();
34 }
35 
37 
38 // Update the fixedFluxPressure BCs to ensure flux consistency
40 (
41  p.boundaryField(),
42  (
43  phiHbyA.boundaryField()
44  - MRF.relative(mesh.Sf().boundaryField() & U.boundaryField())
45  )/(mesh.magSf().boundaryField()*rAUf.boundaryField())
46 );
47 
48 // Non-orthogonal pressure corrector loop
49 while (pimple.correctNonOrthogonal())
50 {
51  fvScalarMatrix pEqn
52  (
53  fvm::laplacian(rAUf, p) == fvc::div(phiHbyA)
54  );
55 
56  pEqn.setReference(pRefCell, pRefValue);
57 
58  pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
59 
60  if (pimple.finalNonOrthogonalIter())
61  {
62  phi = phiHbyA - pEqn.flux();
63  }
64 }
65 
66 #include "continuityErrs.H"
67 
68 // Explicitly relax pressure for momentum corrector
69 p.relax();
70 
71 U = HbyA - rAtU*fvc::grad(p);
72 U.correctBoundaryConditions();
73 fvOptions.correct(U);
74 
75 {
77  surfaceVectorField n(mesh.Sf()/mesh.magSf());
78  Uf += n*(phi/mesh.magSf() - (n & Uf));
79 }
80 
81 // Make the fluxes relative to the mesh motion
Uf
Definition: pEqn.H:78
tmp< volScalarField > rAtU(rAU)
phi
Definition: pEqn.H:20
setSnGrad< fixedFluxPressureFvPatchScalarField >(p_rgh.boundaryField(),( phiHbyA.boundaryField() -MRF.relative(mesh.Sf().boundaryField()&U.boundaryField()) *rho.boundaryField() )/(mesh.magSf().boundaryField()*rhorAUf.boundaryField()))
void makeAbsolute(surfaceScalarField &phi, const volVectorField &U)
Make the given flux absolute.
Definition: fvcMeshPhi.C:113
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU))
tmp< GeometricField< typename flux< Type >::type, fvsPatchField, surfaceMesh > > ddtCorr(const GeometricField< Type, fvPatchField, volMesh > &U, const GeometricField< Type, fvsPatchField, surfaceMesh > &Uf)
Definition: fvcDdt.C:155
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcLaplacian.C:45
tmp< surfaceScalarField > interpolate(const RhoType &rho)
dynamicFvMesh & mesh
const dictionary & pimple
p
Definition: pEqn.H:59
fv::IOoptionList & fvOptions
const scalar pRefValue
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:42
IOMRFZoneList & MRF
fvVectorMatrix UEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+turbulence->divDevRhoReff(U)==fvOptions(rho, U))
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
MRF makeRelative(fvc::interpolate(rho), phiHbyA)
phiHbyA
Definition: pEqn.H:21
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcSnGrad.C:45
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
adjustPhi(phiHbyA, U, p_rgh)
volScalarField rAU(1.0/UEqn.A())
surfaceVectorField n(mesh.Sf()/mesh.magSf())
const label pRefCell
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcDiv.C:47
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcGrad.C:52
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
U
Definition: pEqn.H:82
HbyA
Definition: pEqn.H:7