pEqn.H
Go to the documentation of this file.
1 rho = thermo.rho();
2 
3 const volScalarField rAU(1.0/UEqn.A());
5 
6 tmp<volScalarField> rAtU
7 (
8  pimple.consistent()
9  ? volScalarField::New("rAtU", 1.0/(1.0/rAU - UEqn.H1()))
10  : tmp<volScalarField>(nullptr)
11 );
12 tmp<surfaceScalarField> rhorAtUf
13 (
14  pimple.consistent()
16  : tmp<surfaceScalarField>(nullptr)
17 );
18 
19 const volScalarField& rAAtU = pimple.consistent() ? rAtU() : rAU;
20 const surfaceScalarField& rhorAAtUf =
21  pimple.consistent() ? rhorAtUf() : rhorAUf;
22 
24 
25 if (pimple.nCorrPiso() <= 1)
26 {
27  tUEqn.clear();
28 }
29 
31 (
32  "phiHbyA",
33  (
35  + MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, phi))
36  )
37 );
38 
39 MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
40 
41 if (pimple.transonic())
42 {
44  (
45  "phid",
47  );
48 
49  phiHbyA -= fvc::interpolate(psi*p)*phiHbyA/fvc::interpolate(rho);
50 
51  if (pimple.consistent())
52  {
53  phiHbyA += (rhorAAtUf - rhorAUf)*fvc::snGrad(p)*mesh.magSf();
54  HbyA += (rAAtU - rAU)*fvc::grad(p);
55  }
56 
57  while (pimple.correctNonOrthogonal())
58  {
59  fvScalarMatrix pEqn
60  (
61  fvm::ddt(psi, p)
62  + fvc::div(phiHbyA) + fvm::div(phid, p)
63  - fvm::laplacian(rhorAAtUf, p)
64  ==
65  fvOptions(psi, p, rho.name())
66  );
67 
68  pEqn.solve();
69 
70  if (pimple.finalNonOrthogonalIter())
71  {
72  phi == phiHbyA + pEqn.flux();
73  }
74  }
75 }
76 else
77 {
78  if (pimple.consistent())
79  {
80  phiHbyA += (rhorAAtUf - rhorAUf)*fvc::snGrad(p)*mesh.magSf();
81  HbyA += (rAAtU - rAU)*fvc::grad(p);
82  }
83 
84  // Update the pressure BCs to ensure flux consistency
85  constrainPressure(p, rho, U, phiHbyA, rhorAAtUf, MRF);
86 
87  while (pimple.correctNonOrthogonal())
88  {
89  fvScalarMatrix pEqn
90  (
91  fvm::ddt(psi, p)
92  + fvc::div(phiHbyA)
93  - fvm::laplacian(rhorAAtUf, p)
94  ==
95  fvOptions(psi, p, rho.name())
96  );
97 
98  pEqn.solve();
99 
100  if (pimple.finalNonOrthogonalIter())
101  {
102  phi = phiHbyA + pEqn.flux();
103  }
104  }
105 }
106 
107 #include "rhoEqn.H"
109 
110 // Explicitly relax pressure for momentum corrector
111 p.relax();
112 
113 U = HbyA - rAAtU*fvc::grad(p);
114 U.correctBoundaryConditions();
115 fvOptions.correct(U);
116 K = 0.5*magSqr(U);
117 
118 if (pressureControl.limit(p))
119 {
120  p.correctBoundaryConditions();
121  rho = thermo.rho();
122 }
123 
124 if (thermo.dpdt())
125 {
126  dpdt = fvc::ddt(p);
127 }
tmp< surfaceScalarField > rhorAtUf(pimple.consistent() ? surfaceScalarField::New("rhoRAtUf", fvc::interpolate(rho *rAtU())) :tmp< surfaceScalarField >(nullptr))
rAU
Definition: pEqn.H:1
tmp< volScalarField > rAtU(pimple.consistent() ? volScalarField::New("rAtU", 1.0/(1.0/rAU - UEqn.H1())) :tmp< volScalarField >(nullptr))
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
IOMRFZoneList & MRF
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
rhoReactionThermo & thermo
Definition: createFields.H:28
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:58
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
phi
Definition: pEqn.H:104
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:57
volScalarField & dpdt
dynamicFvMesh & mesh
autoPtr< BasicCompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const typename BasicCompressibleMomentumTransportModel::transportModel &transport)
pressureControl & pressureControl
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Definition: constrainHbyA.C:34
dimensioned< scalar > magSqr(const dimensioned< Type > &)
tmp< fvVectorMatrix > tUEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+MRF.DDt(rho, U)+turbulence->divDevTau(U)==fvOptions(rho, U))
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.
phiHbyA
Definition: pEqn.H:32
U
Definition: pEqn.H:72
volVectorField & HbyA
Definition: pEqn.H:13
fvVectorMatrix & UEqn
Definition: UEqn.H:11
Calculates and prints the continuity errors.
constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF)
const volScalarField & psi
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))
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcSnGrad.C:45