pEqn.H
Go to the documentation of this file.
1 if (!pimple.SIMPLErho())
2 {
3  rho = thermo.rho();
4 }
5 // Thermodynamic density needs to be updated by psi*d(p) after the
6 // pressure solution
8 
9 volScalarField rAU("rAU", 1.0/UEqn.A());
10 mesh.interpolate(rAU);
11 
13 volVectorField HbyA("HbyA", U);
14 
16 
17 if (pimple.nCorrPISO() <= 1)
18 {
19  tUEqn.clear();
20 }
21 
23 (
24  "phiHbyA",
26 );
27 
29 MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
30 
31 // Update the pressure BCs to ensure flux consistency
33 
34 if (pimple.transonic())
35 {
37  (
38  "phid",
40  );
41 
43 
45  (
48  ==
49  fvOptions(psi, p, rho.name())
50  );
51 
52  while (pimple.correctNonOrthogonal())
53  {
55 
56  // Relax the pressure equation to ensure diagonal-dominance
57  pEqn.relax();
58 
59  pEqn.solve(p.select(pimple.finalInnerIter()));
60 
61  if (pimple.finalNonOrthogonalIter())
62  {
63  phi = phiHbyA + pEqn.flux();
64  }
65  }
66 }
67 else
68 {
70  (
72  + fvc::div(phiHbyA)
73  ==
74  fvOptions(psi, p, rho.name())
75  );
76 
77  while (pimple.correctNonOrthogonal())
78  {
80 
81  pEqn.solve(p.select(pimple.finalInnerIter()));
82 
83  if (pimple.finalNonOrthogonalIter())
84  {
85  phi = phiHbyA + pEqn.flux();
86  }
87  }
88 }
89 
90 #include "rhoEqn.H"
92 
93 // Explicitly relax pressure for momentum corrector
94 p.relax();
95 
97 //mesh.interpolate(gradP);
98 U = cellMask*(HbyA - rAU*gradP);
99 U.correctBoundaryConditions();
100 fvOptions.correct(U);
101 K = 0.5*magSqr(U);
102 
103 if (pressureControl.limit(p))
104 {
105  p.correctBoundaryConditions();
106 }
107 
108 thermo.correctRho(psi*p - psip0, rhoMin, rhoMax) ;
109 rho = thermo.rho();
110 
111 {
112  // Correct rhoUf if the mesh is moving
114 }
115 
116 if (thermo.dpdt())
117 {
118  dpdt = fvc::ddt(p);
119 
120  if (mesh.moving())
121  {
122  dpdt -= fvc::div(fvc::meshPhi(rho, U), p);
123  }
124 }
125 
126 phi *= faceMask;
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< 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
volVectorField gradP(fvc::grad(p))
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
faceMask
Definition: setCellMask.H:43
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
Calculates and prints the continuity errors.