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
9 
10 volScalarField rAU(1.0/UEqn.A());
13 
14 if (pimple.nCorrPISO() <= 1)
15 {
16  tUEqn.clear();
17 }
18 
20 (
21  "phiHbyA",
23  + MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, phi, rhoUf))
24 );
25 
27 MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
28 
29 // Update the pressure BCs to ensure flux consistency
31 
32 if (pimple.transonic())
33 {
35  (
36  "phid",
38  );
39 
41 
43  (
46  ==
47  fvOptions(psi, p, rho.name())
48  );
49 
50  while (pimple.correctNonOrthogonal())
51  {
53 
54  // Relax the pressure equation to ensure diagonal-dominance
55  pEqn.relax();
56 
57  pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
58 
59  if (pimple.finalNonOrthogonalIter())
60  {
61  phi = phiHbyA + pEqn.flux();
62  }
63  }
64 }
65 else
66 {
68  (
70  + fvc::div(phiHbyA)
71  ==
72  fvOptions(psi, p, rho.name())
73  );
74 
75  while (pimple.correctNonOrthogonal())
76  {
78 
79  pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
80 
81  if (pimple.finalNonOrthogonalIter())
82  {
83  phi = phiHbyA + pEqn.flux();
84  }
85  }
86 }
87 
88 
89 // Explicitly relax pressure for momentum corrector
90 p.relax();
91 
93 U.correctBoundaryConditions();
94 fvOptions.correct(U);
95 K = 0.5*magSqr(U);
96 
97 if (pressureControl.limit(p))
98 {
99  p.correctBoundaryConditions();
100 }
101 
102 thermo.correctRho(psi*p - psip0, rhoMin, rhoMax) ;
103 
104 #include "rhoEqn.H"
105 #include "compressibleContinuityErrs.H"
106 
107 rho = thermo.rho();
108 
109 // Correct rhoUf if the mesh is moving
111 
112 if (thermo.dpdt())
113 {
114  dpdt = fvc::ddt(p);
115 
116  if (mesh.moving())
117  {
118  dpdt -= fvc::div(fvc::meshPhi(rho, U), p);
119  }
120 }
tmp< fvMatrix< Type > > correction(const fvMatrix< Type > &)
Return the correction form of the given matrix by subtracting the matrix multiplied by the current fi...
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:37
fvScalarMatrix pDDtEqn(fvc::ddt(rho)+psi *correction(fvm::ddt(p))+fvc::div(phiHbyA)==fvOptions(psi, p, rho.name()))
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.
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
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
const pressureControl & pressureControl
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
pimpleControl & pimple
rhoUf
Definition: pEqn.H:89
U
Definition: pEqn.H:72
mesh interpolate(rAU)
fvVectorMatrix & UEqn
Definition: UEqn.H:13
tmp< surfaceScalarField > meshPhi(const volVectorField &U)
Definition: fvcMeshPhi.C:29
void correctRhoUf(autoPtr< surfaceVectorField > &rhoUf, const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi)
Definition: fvcMeshPhi.C:236
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)
const volScalarField psip0(psi *p)
tmp< GeometricField< typename outerProduct< vector, Type >::type, faPatchField, areaMesh >> grad(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Definition: facGrad.C:51
const dimensionedScalar rhoMax