pEqn.H
Go to the documentation of this file.
1 {
2  surfaceScalarField faceMask(localMin<scalar>(mesh).interpolate(cellMask));
3 
4  volScalarField rAU(1.0/UEqn.A());
6  volVectorField HbyA("HbyA", U);
7  HbyA = constrainHbyA(cellMask*rAU*UEqn.H(), U, p);
8  tUEqn.clear();
9 
10  bool closedVolume = false;
11 
13  MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
14 
15  // Update the pressure BCs to ensure flux consistency
17 
18  if (simple.transonic())
19  {
21  (
22  "phid",
24  );
25 
27 
28  while (simple.correctNonOrthogonal())
29  {
30  fvScalarMatrix pEqn
31  (
33  + fvm::div(phid, p)
35  ==
36  fvOptions(psi, p, rho.name())
37  );
38 
39  // Relax the pressure equation to ensure diagonal-dominance
40  pEqn.relax();
41 
42  pEqn.setReference
43  (
44  pressureControl.refCell(),
45  pressureControl.refValue()
46  );
47 
48  pEqn.solve();
49 
50  if (simple.finalNonOrthogonalIter())
51  {
52  phi = phiHbyA + pEqn.flux();
53  }
54  }
55  }
56  else
57  {
59 
61  {
63  }
64 
65  while (simple.correctNonOrthogonal())
66  {
67  fvScalarMatrix pEqn
68  (
71  ==
72  fvOptions(psi, p, rho.name())
73  );
74 
75  pEqn.setReference
76  (
77  pressureControl.refCell(),
78  pressureControl.refValue()
79  );
80 
81  pEqn.solve();
82 
83  if (simple.finalNonOrthogonalIter())
84  {
85  phi = phiHbyA + pEqn.flux();
86  }
87  }
88  }
89 
91 
92  // Explicitly relax pressure for momentum corrector
93  p.relax();
94 
96 
97  U = HbyA - rAU*cellMask*gradP;
98  U.correctBoundaryConditions();
99  fvOptions.correct(U);
100 
101 
102  bool pLimited = pressureControl.limit(p);
103 
104  // For closed-volume cases adjust the pressure and density levels
105  // to obey overall mass continuity
107  {
110  }
111 
113  {
114  p.correctBoundaryConditions();
115  }
116 
117  rho = thermo.rho();
118 
119  if (!simple.transonic())
120  {
121  rho.relax();
122  }
123 }
Foam::constrainHbyA
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Definition: constrainHbyA.C:35
phid
surfaceScalarField phid("phid", fvc::interpolate(psi) *(fvc::flux(HbyA)+MRF.zeroFilter(rhorAUf *fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho))))
gradP
volVectorField gradP(fvc::grad(p))
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.
Foam::fvc::domainIntegrate
dimensioned< Type > domainIntegrate(const GeometricField< Type, fvPatchField, volMesh > &vf)
Definition: fvcVolumeIntegrate.C:88
phiHbyA
phiHbyA
Definition: pEqn.H:20
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
thermo
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
continuityErrs.H
Calculates and prints the continuity errors.
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
pLimited
bool pLimited
Definition: pEqn.H:102
rhorAUf
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho *rAU))
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
Foam::oversetAdjustPhi
bool oversetAdjustPhi(surfaceScalarField &phi, const volVectorField &U)
Adjust the balance of fluxes to obey continuity.
Definition: oversetAdjustPhi.C:38
pressureControl
const pressureControl & pressureControl
Definition: setRegionFluidFields.H:69
adjustFringe
adjustFringe
Definition: readControls.H:16
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:54
phi
phi
Definition: pEqn.H:18
initialMass
dimensionedScalar initialMass
Definition: createFields.H:57
closedVolume
bool closedVolume
Definition: pEqn.H:10
UEqn
fvVectorMatrix & UEqn
Definition: UEqn.H:13
Foam::fac::laplacian
tmp< GeometricField< Type, faPatchField, areaMesh > > laplacian(const GeometricField< Type, faPatchField, areaMesh > &vf, const word &name)
Definition: facLaplacian.C:47
psi
const volScalarField & psi
Definition: createFieldRefs.H:1
adjustPhi
adjustPhi(phiHbyA, U, p_rgh)
rho
rho
Definition: pEqn.H:1
interpolate
mesh interpolate(rAU)
constrainPressure
constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF)