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 }
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:37
rho
Definition: pEqn.H:1
dimensionedScalar initialMass
Definition: createFields.H:57
p
Definition: pEqn.H:50
volScalarField rAU(1.0/UEqn.A())
phiHbyA
Definition: pEqn.H:20
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
bool pLimited
Definition: pEqn.H:102
tmp< GeometricField< Type, faPatchField, areaMesh > > div(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Definition: facDiv.C:43
tmp< fvVectorMatrix > tUEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+MRF.DDt(rho, U)+turbulence->divDevRhoReff(U)==fvOptions(rho, U))
Calculates and prints the continuity errors.
dimensioned< Type > domainIntegrate(const GeometricField< Type, fvPatchField, volMesh > &vf)
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:82
const pressureControl & pressureControl
surfaceScalarField phid("phid", fvc::interpolate(psi) *(fvc::flux(HbyA)+MRF.zeroFilter(rhorAUf *fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho))))
fv::options & fvOptions
volVectorField gradP(fvc::grad(p))
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:81
psiReactionThermo & thermo
Definition: createFields.H:28
dynamicFvMesh & mesh
IOMRFZoneList & MRF
tmp< GeometricField< Type, faPatchField, areaMesh > > laplacian(const GeometricField< Type, faPatchField, areaMesh > &vf, const word &name)
Definition: facLaplacian.C:40
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Definition: constrainHbyA.C:28
bool oversetAdjustPhi(surfaceScalarField &phi, const volVectorField &U, const label zoneId=-1)
Adjust the balance of fluxes to obey continuity.
HbyA
Definition: pEqn.H:4
faceMask
Definition: setCellMask.H:43
adjustPhi(phiHbyA, U, p_rgh)
const dictionary & simple
U
Definition: pEqn.H:72
mesh interpolate(rAU)
fvVectorMatrix & UEqn
Definition: UEqn.H:13
constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF)
phi
Definition: pEqn.H:18
const volScalarField & psi
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho *rAU))
tmp< GeometricField< typename outerProduct< vector, Type >::type, faPatchField, areaMesh >> grad(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Definition: facGrad.C:51
bool closedVolume
Definition: pEqn.H:10