pcEqn.H
Go to the documentation of this file.
1 rho = thermo.rho();
2 
3 volScalarField rAU(1.0/UEqn.A());
4 volScalarField rAtU(1.0/(1.0/rAU - UEqn.H1()));
6 
7 if (pimple.nCorrPISO() <= 1)
8 {
9  tUEqn.clear();
10 }
11 
12 if (pimple.transonic())
13 {
15  (
16  "phid",
18  *(
20  + MRF.zeroFilter
21  (
24  )
25  )
26  );
27 
28  MRF.makeRelative(fvc::interpolate(psi), phid);
29 
31  (
32  "phic",
34  );
35 
36  HbyA -= (rAU - rAtU)*fvc::grad(p);
37 
38  volScalarField rhorAtU("rhorAtU", rho*rAtU);
39 
40  while (pimple.correctNonOrthogonal())
41  {
42  fvScalarMatrix pEqn
43  (
44  fvm::ddt(psi, p)
45  + fvm::div(phid, p)
46  + fvc::div(phic)
48  ==
49  fvOptions(psi, p, rho.name())
50  );
51 
52  pEqn.solve(p.select(pimple.finalInnerIter()));
53 
54  if (pimple.finalNonOrthogonalIter())
55  {
56  phi == phic + pEqn.flux();
57  }
58  }
59 }
60 else
61 {
63  (
64  "phiHbyA",
65  (
67  + MRF.zeroFilter(fvc::interpolate(rho*rAU)*fvc::ddtCorr(rho, U, phi))
68  )
69  );
70 
71  MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
72 
74  HbyA -= (rAU - rAtU)*fvc::grad(p);
75 
76  volScalarField rhorAtU("rhorAtU", rho*rAtU);
77 
78  // Update the pressure BCs to ensure flux consistency
80 
81  while (pimple.correctNonOrthogonal())
82  {
83  fvScalarMatrix pEqn
84  (
85  fvm::ddt(psi, p)
86  + fvc::div(phiHbyA)
88  ==
89  fvOptions(psi, p, rho.name())
90  );
91 
92  pEqn.solve(p.select(pimple.finalInnerIter()));
93 
94  if (pimple.finalNonOrthogonalIter())
95  {
96  phi = phiHbyA + pEqn.flux();
97  }
98  }
99 }
100 
101 #include "rhoEqn.H"
102 #include "compressibleContinuityErrs.H"
103 
104 // Explicitly relax pressure for momentum corrector
105 p.relax();
106 
108 U.correctBoundaryConditions();
109 fvOptions.correct(U);
110 K = 0.5*magSqr(U);
111 
112 if (pressureControl.limit(p))
113 {
114  p.correctBoundaryConditions();
115  rho = thermo.rho();
116 }
117 
118 if (thermo.dpdt())
119 {
120  dpdt = fvc::ddt(p);
121 }
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:37
constrainPressure(p, rho, U, phiHbyA, rhorAtU, MRF)
volScalarField rAU(1.0/UEqn.A())
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
static tmp< GeometricField< Type, faePatchField, edgeMesh > > interpolate(const GeometricField< Type, faPatchField, areaMesh > &tvf, const edgeScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
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
HbyA
Definition: pcEqn.H:74
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
phiHbyA
Definition: pcEqn.H:73
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
rho
Definition: pcEqn.H:1
U
Definition: pcEqn.H:107
pimpleControl & pimple
surfaceScalarField phic(mixture.cAlpha() *mag(alphaPhic/mesh.magSf()))
volScalarField rhorAtU("rhorAtU", rho *rAtU)
fvVectorMatrix & UEqn
Definition: UEqn.H:13
const volScalarField & psi
volScalarField & p
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcSnGrad.C:40
tmp< GeometricField< typename outerProduct< vector, Type >::type, faPatchField, areaMesh >> grad(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Definition: facGrad.C:51
volScalarField rAtU(1.0/(1.0/rAU - UEqn.H1()))