pEqn.H
Go to the documentation of this file.
1 rho = thermo.rho();
2 
3 volScalarField rAU(1.0/UEqn.A());
6 
7 if (pimple.nCorrPISO() <= 1)
8 {
9  tUEqn.clear();
10 }
11 
13 (
14  "phiHbyA",
15  fvc::flux(rho*HbyA)
17 );
18 
19 fvc::makeRelative(phiHbyA, rho, U);
20 MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
21 
22 // Update the pressure BCs to ensure flux consistency
23 constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF);
24 
25 if (pimple.transonic())
26 {
28  (
29  "phid",
31  );
32 
33  phiHbyA -= fvc::interpolate(psi*p)*phiHbyA/fvc::interpolate(rho);
34 
35  while (pimple.correctNonOrthogonal())
36  {
37  fvScalarMatrix pEqn
38  (
40  + fvc::div(phiHbyA)
41  + fvm::div(phid, p)
43  ==
44  fvOptions(psi, p, rho.name())
45  );
46 
47  // Relax the pressure equation to ensure diagonal-dominance
48  pEqn.relax();
49 
50  pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
51 
52  if (pimple.finalNonOrthogonalIter())
53  {
54  phi = phiHbyA + pEqn.flux();
55  }
56  }
57 }
58 else
59 {
60  while (pimple.correctNonOrthogonal())
61  {
62  // Pressure corrector
63  fvScalarMatrix pEqn
64  (
66  + fvc::div(phiHbyA)
68  ==
69  fvOptions(psi, p, rho.name())
70  );
71 
72  pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
73 
74  if (pimple.finalNonOrthogonalIter())
75  {
76  phi = phiHbyA + pEqn.flux();
77  }
78  }
79 }
80 
81 #include "rhoEqn.H"
82 #include "compressibleContinuityErrs.H"
83 
84 // Explicitly relax pressure for momentum corrector
85 p.relax();
86 
87 U = HbyA - rAU*fvc::grad(p);
88 U.correctBoundaryConditions();
89 fvOptions.correct(U);
90 K = 0.5*magSqr(U);
91 
92 if (pressureControl.limit(p))
93 {
94  p.correctBoundaryConditions();
95  rho = thermo.rho();
96 }
97 
98 {
100  surfaceVectorField n(mesh.Sf()/mesh.magSf());
101  rhoUf += n*(fvc::absolute(phi, rho, U)/mesh.magSf() - (n & rhoUf));
102 }
103 
104 if (thermo.dpdt())
105 {
106  dpdt = fvc::ddt(p);
107 
108  if (mesh.moving())
109  {
110  dpdt -= fvc::div(fvc::meshPhi(rho, U), p);
111  }
112 }
tmp< fvMatrix< Type > > correction(const fvMatrix< Type > &)
Return the correction form of the given matrix.
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcGrad.C:52
surfaceVectorField n(mesh.Sf()/mesh.magSf())
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:42
U
Definition: pEqn.H:83
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< GeometricField< typename flux< Type >::type, fvsPatchField, surfaceMesh > > ddtCorr(const GeometricField< Type, fvPatchField, volMesh > &U, const GeometricField< Type, fvsPatchField, surfaceMesh > &Uf)
Definition: fvcDdt.C:170
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
const dictionary & pimple
tmp< fvVectorMatrix > tUEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+MRF.DDt(rho, U)+turbulence->divDevRhoReff(U)==fvOptions(rho, U))
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
CGAL::Exact_predicates_exact_constructions_kernel K
fv::options & fvOptions
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho *rAU))
tmp< GeometricField< Type, fvPatchField, volMesh > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
Definition: fvcDdt.C:45
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
psiReactionThermo & thermo
Definition: createFields.H:31
dynamicFvMesh & mesh
IOMRFZoneList & MRF
volScalarField & dpdt
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Definition: constrainHbyA.C:33
dimensioned< scalar > magSqr(const dimensioned< Type > &)
constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF)
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)))
tmp< surfaceScalarField > absolute(const tmp< surfaceScalarField > &tphi, const volVectorField &U)
Return the given relative flux in absolute form.
Definition: fvcMeshPhi.C:188
rhoUf
Definition: pEqn.H:91
volVectorField & HbyA
Definition: pEqn.H:13
fvVectorMatrix & UEqn
Definition: UEqn.H:13
tmp< surfaceScalarField > meshPhi(const volVectorField &U)
Definition: fvcMeshPhi.C:34
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())
MRF makeRelative(fvc::interpolate(rho), phiHbyA)