pcEqn.H
Go to the documentation of this file.
1 rho = thermo.rho();
2 
3 volScalarField rAU(1.0/UEqn.A());
4 volScalarField rAtU(1.0/(1.0/rAU - UEqn.H1()));
6 tUEqn.clear();
7 
8 bool closedVolume = false;
9 
11 MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
12 
13 volScalarField rhorAtU("rhorAtU", rho*rAtU);
14 
15 // Update the pressure BCs to ensure flux consistency
17 
18 if (simple.transonic())
19 {
21  (
22  "phid",
24  );
25 
26  phiHbyA +=
29 
30  HbyA -= (rAU - rAtU)*fvc::grad(p);
31 
32  while (simple.correctNonOrthogonal())
33  {
34  fvScalarMatrix pEqn
35  (
36  fvc::div(phiHbyA)
37  + fvm::div(phid, p)
39  ==
40  fvOptions(psi, p, rho.name())
41  );
42 
43  // Relax the pressure equation to maintain diagonal dominance
44  pEqn.relax();
45 
46  pEqn.setReference
47  (
48  pressureControl.refCell(),
49  pressureControl.refValue()
50  );
51 
52  pEqn.solve();
53 
54  if (simple.finalNonOrthogonalIter())
55  {
56  phi = phiHbyA + pEqn.flux();
57  }
58  }
59 }
60 else
61 {
62  closedVolume = adjustPhi(phiHbyA, U, p);
63 
65  HbyA -= (rAU - rAtU)*fvc::grad(p);
66 
67  while (simple.correctNonOrthogonal())
68  {
69  fvScalarMatrix pEqn
70  (
73  ==
74  fvOptions(psi, p, rho.name())
75  );
76 
77  pEqn.setReference
78  (
79  pressureControl.refCell(),
80  pressureControl.refValue()
81  );
82 
83  pEqn.solve();
84 
85  if (simple.finalNonOrthogonalIter())
86  {
87  phi = phiHbyA + pEqn.flux();
88  }
89  }
90 }
91 
92 // The incompressibe form of the continuity error check is appropriate for
93 // steady-state compressible also.
95 
96 // Explicitly relax pressure for momentum corrector
97 p.relax();
98 
100 U.correctBoundaryConditions();
101 fvOptions.correct(U);
102 
103 bool pLimited = pressureControl.limit(p);
104 
105 // For closed-volume cases adjust the pressure and density levels
106 // to obey overall mass continuity
107 if (closedVolume)
108 {
111 }
112 
113 if (pLimited || closedVolume)
114 {
115  p.correctBoundaryConditions();
116 }
117 
118 rho = thermo.rho();
119 
120 if (!simple.transonic())
121 {
122  rho.relax();
123 }
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
surfaceScalarField & phi
dimensionedScalar initialMass
Definition: createFields.H:57
IOMRFZoneList & MRF
constrainPressure(p, rho, U, phiHbyA, rhorAtU, MRF)
volScalarField rAU(1.0/UEqn.A())
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
HbyA
Definition: pcEqn.H:74
bool adjustPhi(surfaceScalarField &phi, const volVectorField &U, volScalarField &p)
Adjust the balance of fluxes to obey continuity.
Definition: adjustPhi.C:34
surfaceScalarField phid("phid", fvc::interpolate(psi) *(fvc::flux(HbyA)+MRF.zeroFilter(rhorAUf *fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho))))
phiHbyA
Definition: pcEqn.H:73
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
dynamicFvMesh & mesh
pressureControl & pressureControl
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Definition: constrainHbyA.C:33
rho
Definition: pcEqn.H:1
U
Definition: pcEqn.H:107
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.
volScalarField rhorAtU("rhorAtU", rho *rAtU)
fvVectorMatrix & UEqn
Definition: UEqn.H:13
const volScalarField & psi
volScalarField & p
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
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcSnGrad.C:45
simpleControl simple(mesh)
volScalarField rAtU(1.0/(1.0/rAU - UEqn.H1()))