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  (
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 
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
pRefCell
const label pRefCell
Definition: setRegionFluidFields.H:27
Foam::fvc::snGrad
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcSnGrad.C:45
Foam::fvc::grad
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcGrad.C:52
p
p
Definition: pEqn.H:62
Foam::MULES::interpolate
tmp< surfaceScalarField > interpolate(const RhoType &rho)
Definition: IMULESTemplates.C:40
Foam::fvc::div
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcDiv.C:47
setSnGrad< fixedFluxPressureFvPatchScalarField >
setSnGrad< fixedFluxPressureFvPatchScalarField >(p_rgh.boundaryField(),(phiHbyA.boundaryField() - MRF.relative(mesh.Sf().boundaryField() &U.boundaryField()))/(mesh.magSf().boundaryField() *rAUf.boundaryField()))
phi
phi
Definition: pEqn.H:20
A
simpleMatrix< scalar > A(Nc)
U
U
Definition: pEqn.H:46
Foam::fvc::laplacian
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcLaplacian.C:45
Foam::fvScalarMatrix
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:42
Foam::fvc::ddtCorr
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
rAtU
tmp< volScalarField > rAtU(rAU)
UEqn
tmp< fvVectorMatrix > UEqn(fvm::div(phi, U)+MRF.DDt(U)+turbulence->divDevReff(U)==fvOptions(U))
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
n
surfaceVectorField n(mesh.Sf()/mesh.magSf())
MRF
IOMRFZoneList & MRF
Definition: setRegionFluidFields.H:15
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam::volVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
rAU
volScalarField rAU("rAU", 1.0/UEqn().A())
Foam::max
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
adjustPhi
adjustPhi(phiHbyA, U, p)
HbyA
HbyA
Definition: pEqn.H:4
makeRelative
MRF makeRelative(phiHbyA)
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:52
pimple
const dictionary & pimple
Definition: readFluidMultiRegionPIMPLEControls.H:1
phiHbyA
phiHbyA
Definition: pEqn.H:21
Foam::fvc::makeAbsolute
void makeAbsolute(surfaceScalarField &phi, const volVectorField &U)
Make the given flux absolute.
Definition: fvcMeshPhi.C:113
Foam::surfaceVectorField
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
Definition: surfaceFieldsFwd.H:55
Uf
Uf
Definition: pEqn.H:78
pRefValue
const scalar pRefValue
Definition: setRegionFluidFields.H:28
fvOptions
fv::options & fvOptions
Definition: setRegionFluidFields.H:16
rAUf
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU))