pEqn.H
Go to the documentation of this file.
1 if (!pimple.SIMPLErho())
2 {
3  rho = thermo.rho();
4 }
5 
6 // Thermodynamic density needs to be updated by psi*d(p) after the
7 // pressure solution
8 const volScalarField psip0(psi*p);
9 
10 volScalarField rAU(1.0/UEqn.A());
13 
14 if (pimple.nCorrPISO() <= 1)
15 {
16  tUEqn.clear();
17 }
18 
20 (
21  "phiHbyA",
23  + rhorAUf*fvc::ddtCorr(rho, U, phi)
24 );
25 
26 MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
27 
28 // Update the pressure BCs to ensure flux consistency
29 constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF);
30 
31 if (pimple.transonic())
32 {
34  (
35  "phid",
37  );
38 
39  phiHbyA -= fvc::interpolate(psi*p)*phiHbyA/fvc::interpolate(rho);
40 
42  (
44  + fvc::div(phiHbyA) + fvm::div(phid, p)
45  ==
46  fvOptions(psi, p, rho.name())
47  );
48 
49  while (pimple.correctNonOrthogonal())
50  {
51  fvScalarMatrix pEqn(pDDtEqn - fvm::laplacian(rhorAUf, p));
52 
53  // Relax the pressure equation to ensure diagonal-dominance
54  pEqn.relax();
55 
56  pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
57 
58  if (pimple.finalNonOrthogonalIter())
59  {
60  phi = phiHbyA + pEqn.flux();
61  }
62  }
63 }
64 else
65 {
67  (
69  + fvc::div(phiHbyA)
70  ==
71  fvOptions(psi, p, rho.name())
72  );
73 
74  while (pimple.correctNonOrthogonal())
75  {
76  fvScalarMatrix pEqn(pDDtEqn - fvm::laplacian(rhorAUf, p));
77 
78  pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
79 
80  if (pimple.finalNonOrthogonalIter())
81  {
82  phi = phiHbyA + pEqn.flux();
83  }
84  }
85 }
86 
87 // Thermodynamic density update
88 thermo.correctRho(psi*p - psip0);
89 
90 #include "rhoEqn.H"
91 #include "compressibleContinuityErrs.H"
92 
93 // Explicitly relax pressure for momentum corrector
94 p.relax();
95 
96 U = HbyA - rAU*fvc::grad(p);
97 U.correctBoundaryConditions();
98 fvOptions.correct(U);
99 K = 0.5*magSqr(U);
100 
101 if (pressureControl.limit(p))
102 {
103  p.correctBoundaryConditions();
104  rho = thermo.rho();
105 }
106 else if (pimple.SIMPLErho())
107 {
108  rho = thermo.rho();
109 }
110 
111 if (thermo.dpdt())
112 {
113  dpdt = fvc::ddt(p);
114 }
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
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
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
fvScalarMatrix pDDtEqn(fvc::ddt(rho)+psi *correction(fvm::ddt(p))+fvc::div(phiHbyA)==parcels.Srho()+fvOptions(psi, p, rho.name()))
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)))
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
const volScalarField psip0(psi *p)
volScalarField rAU(1.0/UEqn.A())