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  *(
19  fvc::flux(HbyA)
20  + MRF.zeroFilter
21  (
24  )
25  )
26  );
27 
28  MRF.makeRelative(fvc::interpolate(psi), phid);
29 
31  (
32  "phic",
33  fvc::interpolate(rho*(rAtU - rAU))*fvc::snGrad(p)*mesh.magSf()
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)
47  - fvm::laplacian(rhorAtU, p)
48  ==
49  fvOptions(psi, p, rho.name())
50  );
51 
52  pEqn.solve();
53 
54  if (pimple.finalNonOrthogonalIter())
55  {
56  phi == phic + pEqn.flux();
57  }
58  }
59 }
60 else
61 {
63  (
64  "phiHbyA",
65  (
66  fvc::flux(rho*HbyA)
67  + MRF.zeroFilter(fvc::interpolate(rho*rAU)*fvc::ddtCorr(rho, U, phi))
68  )
69  );
70 
71  MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
72 
73  phiHbyA += fvc::interpolate(rho*(rAtU - rAU))*fvc::snGrad(p)*mesh.magSf();
74  HbyA -= (rAU - rAtU)*fvc::grad(p);
75 
76  volScalarField rhorAtU("rhorAtU", rho*rAtU);
77 
78  // Update the pressure BCs to ensure flux consistency
79  constrainPressure(p, rho, U, phiHbyA, rhorAtU, MRF);
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();
93 
94  if (pimple.finalNonOrthogonalIter())
95  {
96  phi = phiHbyA + pEqn.flux();
97  }
98  }
99 }
100 
101 #include "rhoEqn.H"
103 
104 // Explicitly relax pressure for momentum corrector
105 p.relax();
106 
107 U = HbyA - rAtU*fvc::grad(p);
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 }
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
pimpleNoLoopControl & pimple
surfaceScalarField & phi
IOMRFZoneList & MRF
constrainPressure(p, rho, U, phiHbyA, rhorAtU, MRF)
volScalarField rAU(1.0/UEqn.A())
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
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
HbyA
Definition: pcEqn.H:74
phiHbyA
Definition: pcEqn.H:73
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
pressureControl & pressureControl
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Definition: constrainHbyA.C:33
rho
Definition: pcEqn.H:1
dimensioned< scalar > magSqr(const dimensioned< Type > &)
U
Definition: pcEqn.H:107
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.
volScalarField rhorAtU("rhorAtU", rho *rAtU)
surfaceScalarField phic(mixture.cAlpha() *mag(phi/mesh.magSf()))
fvVectorMatrix & UEqn
Definition: UEqn.H:13
Calculates and prints the continuity errors.
const volScalarField & psi
volScalarField & p
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
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcSnGrad.C:45
volScalarField rAtU(1.0/(1.0/rAU - UEqn.H1()))