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  *(
22  fvc::flux(HbyA)
23  + MRF.zeroFilter
24  (
26  )
27  )
28  );
29 
30  fvc::makeRelative(phid, psi, U);
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",
58  fvc::flux(rho*HbyA)
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 max/min : " << max(rho).value()
101  << " " << min(rho).value() << endl;
102 
103 U = HbyA - rAU*fvc::grad(p);
104 U.correctBoundaryConditions();
105 fvOptions.correct(U);
106 K = 0.5*magSqr(U);
107 
108 {
110  surfaceVectorField n(mesh.Sf()/mesh.magSf());
111  rhoUf += n*(fvc::absolute(phi, rho, U)/mesh.magSf() - (n & rhoUf));
112 }
113 
114 if (thermo.dpdt())
115 {
116  dpdt = fvc::ddt(p);
117 
118  if (mesh.moving())
119  {
120  dpdt -= fvc::div(fvc::meshPhi(rho, U), p);
121  }
122 }
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
rho
Definition: pEqn.H:1
pimpleNoLoopControl & pimple
p
Definition: pEqn.H:50
volScalarField rAU(1.0/UEqn.A())
IOMRFZoneList & MRF
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
rhoUf
Definition: pEqn.H:94
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
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:256
tmp< fvVectorMatrix > tUEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+MRF.DDt(rho, U)+turbulence->divDevRhoReff(U)==fvOptions(rho, U))
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
CGAL::Exact_predicates_exact_constructions_kernel K
surfaceScalarField phid("phid", fvc::interpolate(psi) *(fvc::flux(HbyA)+MRF.zeroFilter(rhorAUf *fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho))))
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
volScalarField & dpdt
dynamicFvMesh & mesh
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Definition: constrainHbyA.C:33
dimensioned< scalar > magSqr(const dimensioned< Type > &)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
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.
tmp< surfaceScalarField > absolute(const tmp< surfaceScalarField > &tphi, const volVectorField &U)
Return the given relative flux in absolute form.
Definition: fvcMeshPhi.C:188
U
Definition: pEqn.H:72
volVectorField & HbyA
Definition: pEqn.H:13
fvVectorMatrix & UEqn
Definition: UEqn.H:13
tmp< surfaceScalarField > meshPhi(const volVectorField &U)
Definition: fvcMeshPhi.C:34
messageStream Info
constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF)
phi
Definition: pEqn.H:18
const volScalarField & psi
surfaceVectorField n(mesh.Sf()/mesh.magSf())
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
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho *rAU))
MRF makeRelative(fvc::interpolate(rho), phiHbyA)