pEqn.H
Go to the documentation of this file.
1 volScalarField rAU(1.0/UEqn.A());
4 tUEqn.clear();
5 
6 bool closedVolume = false;
7 
9 MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
10 
11 // Update the pressure BCs to ensure flux consistency
13 
14 if (simple.transonic())
15 {
17  (
18  "phid",
20  );
21 
22  phiHbyA -= fvc::interpolate(psi*p)*phiHbyA/fvc::interpolate(rho);
23 
24  while (simple.correctNonOrthogonal())
25  {
26  fvScalarMatrix pEqn
27  (
28  fvc::div(phiHbyA)
29  + fvm::div(phid, p)
31  ==
32  fvOptions(psi, p, rho.name())
33  );
34 
35  // Relax the pressure equation to ensure diagonal-dominance
36  pEqn.relax();
37 
38  pEqn.setReference
39  (
40  pressureControl.refCell(),
41  pressureControl.refValue()
42  );
43 
44  pEqn.solve();
45 
46  if (simple.finalNonOrthogonalIter())
47  {
48  phi = phiHbyA + pEqn.flux();
49  }
50  }
51 }
52 else
53 {
54  closedVolume = adjustPhi(phiHbyA, U, p);
55 
56  while (simple.correctNonOrthogonal())
57  {
58  fvScalarMatrix pEqn
59  (
62  ==
63  fvOptions(psi, p, rho.name())
64  );
65 
66  pEqn.setReference
67  (
68  pressureControl.refCell(),
69  pressureControl.refValue()
70  );
71 
72  pEqn.solve();
73 
74  if (simple.finalNonOrthogonalIter())
75  {
76  phi = phiHbyA + pEqn.flux();
77  }
78  }
79 }
80 
82 
83 // Explicitly relax pressure for momentum corrector
84 p.relax();
85 
87 U.correctBoundaryConditions();
88 fvOptions.correct(U);
89 
90 bool pLimited = pressureControl.limit(p);
91 
92 // For closed-volume cases adjust the pressure and density levels
93 // to obey overall mass continuity
94 if (closedVolume)
95 {
98 }
99 
100 if (pLimited || closedVolume)
101 {
102  p.correctBoundaryConditions();
103 }
104 
105 rho = thermo.rho();
106 
107 if (!simple.transonic())
108 {
109  rho.relax();
110 }
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcGrad.C:52
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:42
fv::options & fvOptions
rho
Definition: pEqn.H:1
dimensionedScalar initialMass
Definition: createFields.H:57
p
Definition: pEqn.H:50
volScalarField rAU(1.0/UEqn.A())
IOMRFZoneList & MRF
phiHbyA
Definition: pEqn.H:20
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcDiv.C:47
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)
rhoReactionThermo & thermo
Definition: createFields.H:28
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcLaplacian.C:45
surfaceScalarField phid("phid", fvc::interpolate(psi) *(fvc::flux(HbyA)+MRF.zeroFilter(rhorAUf *fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho))))
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
pressureControl & pressureControl
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Definition: constrainHbyA.C:33
adjustPhi(phiHbyA, U, p_rgh)
static tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
U
Definition: pEqn.H:72
volVectorField & HbyA
Definition: pEqn.H:13
fvVectorMatrix & UEqn
Definition: UEqn.H:13
constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF)
phi
Definition: pEqn.H:18
const volScalarField & psi
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
Definition: fvcFlux.C:32
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho *rAU))
simpleControl simple(mesh)