pEqn.H
Go to the documentation of this file.
1 rho = thermo.rho();
2 rho.clamp_range(rhoMin, rhoMax);
3 rho.relax();
4 
5 volScalarField rAU(1.0/UEqn.A());
8 
9 if (pimple.nCorrPISO() <= 1)
10 {
11  tUEqn.clear();
12 }
13 
14 if (pimple.transonic())
15 {
17  (
18  "phid",
20  *(
22  + MRF.zeroFilter
23  (
25  )
26  )
27  );
28 
30  MRF.makeRelative(fvc::interpolate(psi), phid);
31 
32  while (pimple.correctNonOrthogonal())
33  {
34  fvScalarMatrix pEqn
35  (
36  fvm::ddt(psi, p)
37  + fvm::div(phid, p)
39  ==
40  parcels.Srho()
41  + fvOptions(psi, p, rho.name())
42  );
43 
44  pEqn.solve(p.select(pimple.finalInnerIter()));
45 
46  if (pimple.finalNonOrthogonalIter())
47  {
48  phi == pEqn.flux();
49  }
50  }
51 }
52 else
53 {
55  (
56  "phiHbyA",
58  + MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, rhoUf))
59  );
60 
62  MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
63 
64  // Update the pressure BCs to ensure flux consistency
66 
67  while (pimple.correctNonOrthogonal())
68  {
69  fvScalarMatrix pEqn
70  (
71  fvm::ddt(psi, p)
72  + fvc::div(phiHbyA)
74  ==
75  parcels.Srho()
76  + fvOptions(psi, p, rho.name())
77  );
78 
79  pEqn.solve(p.select(pimple.finalInnerIter()));
80 
81  if (pimple.finalNonOrthogonalIter())
82  {
83  phi = phiHbyA + pEqn.flux();
84  }
85  }
86 }
87 
88 #include "rhoEqn.H"
89 #include "compressibleContinuityErrs.H"
90 
91 // Explicitly relax pressure for momentum corrector
92 p.relax();
93 
94 // Recalculate density from the relaxed pressure
95 rho = thermo.rho();
96 rho.clamp_range(rhoMin, rhoMax);
97 rho.relax();
98 Info<< "rho min/max : " << min(rho).value() << " " << max(rho).value() << endl;
99 
100 U = HbyA - rAU*fvc::grad(p);
101 U.correctBoundaryConditions();
102 fvOptions.correct(U);
103 K = 0.5*magSqr(U);
104 
105 {
107  surfaceVectorField n(mesh.Sf()/mesh.magSf());
108  rhoUf += n*(fvc::absolute(phi, rho, U)/mesh.magSf() - (n & rhoUf));
109 }
110 
111 if (thermo.dpdt())
112 {
113  dpdt = fvc::ddt(p);
114 
115  if (mesh.moving())
116  {
117  dpdt -= fvc::div(fvc::meshPhi(rho, U), p);
118  }
119 }
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:37
rho
Definition: pEqn.H:1
p
Definition: pEqn.H:50
volScalarField rAU(1.0/UEqn.A())
phiHbyA
Definition: pEqn.H:20
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:40
tmp< GeometricField< typename flux< Type >::type, fvsPatchField, surfaceMesh > > ddtCorr(const GeometricField< Type, fvPatchField, volMesh > &U, const GeometricField< Type, fvsPatchField, surfaceMesh > &Uf)
Definition: fvcDdt.C:165
tmp< GeometricField< Type, faPatchField, areaMesh > > div(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Definition: facDiv.C:43
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:519
tmp< fvVectorMatrix > tUEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+MRF.DDt(rho, U)+turbulence->divDevRhoReff(U)==fvOptions(rho, U))
tmp< GeometricField< Type, faPatchField, areaMesh > > ddt(const dimensioned< Type > dt, const faMesh &mesh)
Definition: facDdt.C:40
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:76
CGAL::Exact_predicates_exact_constructions_kernel K
const dimensionedScalar rhoMin
surfaceScalarField phid("phid", fvc::interpolate(psi) *(fvc::flux(HbyA)+MRF.zeroFilter(rhorAUf *fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho))))
fv::options & fvOptions
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:72
psiReactionThermo & thermo
Definition: createFields.H:28
dynamicFvMesh & mesh
IOMRFZoneList & MRF
tmp< GeometricField< Type, faPatchField, areaMesh > > laplacian(const GeometricField< Type, faPatchField, areaMesh > &vf, const word &name)
Definition: facLaplacian.C:40
volScalarField & dpdt
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Definition: constrainHbyA.C:28
HbyA
Definition: pEqn.H:4
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:26
pimpleControl & pimple
rhoUf
Definition: pEqn.H:89
tmp< surfaceScalarField > absolute(const tmp< surfaceScalarField > &tphi, const volVectorField &U)
Return the given relative flux in absolute form.
Definition: fvcMeshPhi.C:183
U
Definition: pEqn.H:72
mesh interpolate(rAU)
fvVectorMatrix & UEqn
Definition: UEqn.H:13
tmp< surfaceScalarField > meshPhi(const volVectorField &U)
Definition: fvcMeshPhi.C:29
surfaceVectorField n(mesh.Sf()/mesh.magSf())
messageStream Info
Information stream (stdout output on master, null elsewhere)
constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF)
phi
Definition: pEqn.H:18
const volScalarField & psi
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho *rAU))
MRF makeRelative(fvc::interpolate(rho), phiHbyA)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
tmp< GeometricField< typename outerProduct< vector, Type >::type, faPatchField, areaMesh >> grad(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Definition: facGrad.C:51
const dimensionedScalar rhoMax