pEqn.H
Go to the documentation of this file.
1 rho = thermo.rho();
2 rho = max(rho, rhoMin);
3 rho = min(rho, rhoMax);
4 rho.relax();
5 
6 volScalarField rAU(1.0/UEqn.A());
9 
10 if (pimple.nCorrPISO() <= 1)
11 {
12  tUEqn.clear();
13 }
14 
15 if (pimple.transonic())
16 {
18  (
19  "phid",
21  *(
23  + MRF.zeroFilter
24  (
26  )
27  )
28  );
29 
31  MRF.makeRelative(fvc::interpolate(psi), phid);
32 
33  while (pimple.correctNonOrthogonal())
34  {
35  fvScalarMatrix pEqn
36  (
37  fvm::ddt(psi, p)
38  + fvm::div(phid, p)
40  ==
41  parcels.Srho()
42  + fvOptions(psi, p, rho.name())
43  );
44 
45  pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
46 
47  if (pimple.finalNonOrthogonalIter())
48  {
49  phi == pEqn.flux();
50  }
51  }
52 }
53 else
54 {
56  (
57  "phiHbyA",
59  + MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, rhoUf))
60  );
61 
63  MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
64 
65  // Update the pressure BCs to ensure flux consistency
67 
68  while (pimple.correctNonOrthogonal())
69  {
70  fvScalarMatrix pEqn
71  (
72  fvm::ddt(psi, p)
73  + fvc::div(phiHbyA)
75  ==
76  parcels.Srho()
77  + fvOptions(psi, p, rho.name())
78  );
79 
80  pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
81 
82  if (pimple.finalNonOrthogonalIter())
83  {
84  phi = phiHbyA + pEqn.flux();
85  }
86  }
87 }
88 
89 #include "rhoEqn.H"
90 #include "compressibleContinuityErrs.H"
91 
92 // Explicitly relax pressure for momentum corrector
93 p.relax();
94 
95 // Recalculate density from the relaxed pressure
96 rho = thermo.rho();
97 rho = max(rho, rhoMin);
98 rho = min(rho, rhoMax);
99 rho.relax();
100 Info<< "rho min/max : " << min(rho).value() << " " << max(rho).value() << endl;
101 
102 U = HbyA - rAU*fvc::grad(p);
103 U.correctBoundaryConditions();
104 fvOptions.correct(U);
105 K = 0.5*magSqr(U);
106 
107 {
109  surfaceVectorField n(mesh.Sf()/mesh.magSf());
110  rhoUf += n*(fvc::absolute(phi, rho, U)/mesh.magSf() - (n & rhoUf));
111 }
112 
113 if (thermo.dpdt())
114 {
115  dpdt = fvc::ddt(p);
116 
117  if (mesh.moving())
118  {
119  dpdt -= fvc::div(fvc::meshPhi(rho, U), p);
120  }
121 }
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:487
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:82
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:81
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