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(mesh.solver(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(mesh.solver(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 }
Foam::constrainHbyA
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Definition: constrainHbyA.C:35
Foam::fvc::snGrad
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > snGrad(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcSnGrad.C:47
rAtU
volScalarField rAtU(1.0/(1.0/rAU - UEqn.H1()))
phid
surfaceScalarField phid("phid", fvc::interpolate(psi) *(fvc::flux(HbyA)+MRF.zeroFilter(rhorAUf *fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho))))
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::fvc::flux
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Return the face-flux field obtained from the given volVectorField.
rAU
volScalarField rAU(1.0/UEqn.A())
constrainPressure
constrainPressure(p, rho, U, phiHbyA, rhorAtU, MRF)
Foam::fac::grad
tmp< GeometricField< typename outerProduct< vector, Type >::type, faPatchField, areaMesh >> grad(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Definition: facGrad.C:56
thermo
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
HbyA
HbyA
Definition: pcEqn.H:74
Foam::fac::div
tmp< GeometricField< Type, faPatchField, areaMesh > > div(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Definition: facDiv.C:50
Foam::magSqr
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
phic
surfaceScalarField phic(mixture.cAlpha() *mag(alphaPhic/mesh.magSf()))
K
CGAL::Exact_predicates_exact_constructions_kernel K
Definition: CGALTriangulation3DKernel.H:58
MRF
IOMRFZoneList & MRF
Definition: setRegionFluidFields.H:22
pimple
pimpleControl & pimple
Definition: setRegionFluidFields.H:56
tUEqn
tmp< fvVectorMatrix > tUEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+MRF.DDt(rho, U)+turbulence->divDevRhoReff(U)==fvOptions(rho, U))
phiHbyA
phiHbyA
Definition: pcEqn.H:73
Foam::fvScalarMatrix
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:44
fvOptions
fv::options & fvOptions
Definition: setRegionFluidFields.H:23
rho
rho
Definition: pcEqn.H:1
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
ddtCorr
ddtCorr
Definition: readControls.H:9
U
U
Definition: pcEqn.H:107
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::volVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:62
pressureControl
const pressureControl & pressureControl
Definition: setRegionFluidFields.H:69
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:54
Foam::fac::ddt
tmp< GeometricField< Type, faPatchField, areaMesh > > ddt(const dimensioned< Type > dt, const faMesh &mesh)
Definition: facDdt.C:47
rhorAtU
volScalarField rhorAtU("rhorAtU", rho *rAtU)
UEqn
fvVectorMatrix & UEqn
Definition: UEqn.H:13
dpdt
volScalarField & dpdt
Definition: setRegionFluidFields.H:32
Foam::fac::laplacian
tmp< GeometricField< Type, faPatchField, areaMesh > > laplacian(const GeometricField< Type, faPatchField, areaMesh > &vf, const word &name)
Definition: facLaplacian.C:47
psi
const volScalarField & psi
Definition: createFieldRefs.H:1
Foam::fac::interpolate
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.