pEqn.H
Go to the documentation of this file.
1 {
2  volScalarField rAU("rAU", 1.0/UEqn.A());
5 
6  tUEqn.clear();
7 
9 
11  (
12  "phiHbyA",
14  );
15 
16  MRF.makeRelative(phiHbyA);
17 
19 
21 
22  // Update the pressure BCs to ensure flux consistency
24 
25  while (simple.correctNonOrthogonal())
26  {
27  fvScalarMatrix p_rghEqn
28  (
30  );
31 
32  p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
33 
34  p_rghEqn.solve();
35 
36  if (simple.finalNonOrthogonalIter())
37  {
38  // Calculate the conservative fluxes
39  phi = phiHbyA - p_rghEqn.flux();
40 
41  // Explicitly relax pressure for momentum corrector
42  p_rgh.relax();
43 
44  // Correct the momentum source with the pressure gradient flux
45  // calculated from the relaxed pressure
46  U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rAUf);
47  U.correctBoundaryConditions();
48  fvOptions.correct(U);
49  }
50  }
51 
52  #include "continuityErrs.H"
53 
54  p = p_rgh + rhok*gh;
55 
56  if (p_rgh.needReference())
57  {
59  (
60  "p",
61  p.dimensions(),
63  );
64  p_rgh = p - rhok*gh;
65  }
66 }
Foam::fvc::reconstruct
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> reconstruct(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcReconstruct.C:56
Foam::constrainHbyA
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Definition: constrainHbyA.C:35
Foam::fvc::snGrad
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcSnGrad.C:47
simple
const dictionary & simple
Definition: readFluidMultiRegionSIMPLEControls.H:1
Foam::fvc::flux
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
ghf
const surfaceScalarField & ghf
Definition: setRegionFluidFields.H:18
phiHbyA
phiHbyA
Definition: pEqn.H:20
gh
const volScalarField & gh
Definition: setRegionFluidFields.H:17
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
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::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:42
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
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
U
U
Definition: pEqn.H:72
phig
surfaceScalarField phig("phig", -rhorAUf *ghf *fvc::snGrad(rho) *mesh.magSf())
Foam::getRefCellValue
scalar getRefCellValue(const volScalarField &field, const label refCelli)
Return the current value of field in the reference cell.
Definition: findRefCell.C:134
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:54
phi
phi
Definition: pEqn.H:18
UEqn
fvVectorMatrix & UEqn
Definition: UEqn.H:13
rhok
rhok
Definition: TEqn.H:27
p_rgh
p_rgh
Definition: pEqn.H:139
Foam::fac::laplacian
tmp< GeometricField< Type, faPatchField, areaMesh > > laplacian(const GeometricField< Type, faPatchField, areaMesh > &vf, const word &name)
Definition: facLaplacian.C:47
adjustPhi
adjustPhi(phiHbyA, U, p_rgh)
interpolate
mesh interpolate(rAU)
pRefCell
const label pRefCell
Definition: setRegionFluidFields.H:36
constrainPressure
constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF)
rAUf
surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU))
pRefValue
const scalar pRefValue
Definition: setRegionFluidFields.H:37