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 adjustPhi(phiHbyA, U, p);
15 
16 tmp<volScalarField> rAtU(rAU);
17 
18 if (pimple.consistent())
19 {
20  rAtU = 1.0/max(1.0/rAU - UEqn().H1(), 0.1/rAU);
21  phiHbyA +=
22  fvc::interpolate(rAtU() - rAU)*fvc::snGrad(p)*mesh.magSf();
23  HbyA -= (rAU - rAtU())*fvc::grad(p);
24 }
25 
26 if (pimple.nCorrPISO() <= 1)
27 {
28  UEqn.clear();
29 }
30 
32 
33 // Update the fixedFluxPressure BCs to ensure flux consistency
35 (
36  p.boundaryField(),
37  (
38  phiHbyA.boundaryField()
39  - MRF.relative(mesh.Sf().boundaryField() & U.boundaryField())
40  )/(mesh.magSf().boundaryField()*rAUf.boundaryField())
41 );
42 
43 // Non-orthogonal pressure corrector loop
44 while (pimple.correctNonOrthogonal())
45 {
46  // Pressure corrector
47  fvScalarMatrix pEqn
48  (
50  );
51 
52  pEqn.setReference(pRefCell, pRefValue);
53 
54  pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
55 
56  if (pimple.finalNonOrthogonalIter())
57  {
58  phi = phiHbyA - pEqn.flux();
59  }
60 }
61 
62 #include "continuityErrs.H"
63 
64 // Explicitly relax pressure for momentum corrector
65 p.relax();
66 
68 U.correctBoundaryConditions();
69 fvOptions.correct(U);
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
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
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
pRefValue
const scalar pRefValue
Definition: setRegionFluidFields.H:28
fvOptions
fv::options & fvOptions
Definition: setRegionFluidFields.H:16
rAUf
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU))