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
U
Definition: pEqn.H:83
dimensionedScalar initialMass
Definition: createFields.H:57
p
Definition: pEqn.H:50
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)
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
fv::options & fvOptions
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho *rAU))
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
psiReactionThermo & thermo
Definition: createFields.H:31
IOMRFZoneList & MRF
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Definition: constrainHbyA.C:33
constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF)
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.
surfaceScalarField phid("phid", fvc::interpolate(psi) *(fvc::flux(HbyA)+rhorAUf *fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho)))
const dictionary & simple
volVectorField & HbyA
Definition: pEqn.H:13
fvVectorMatrix & UEqn
Definition: UEqn.H:13
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
rho
Definition: pEqn.H:1
volScalarField rAU(1.0/UEqn.A())