pcEqn.H
Go to the documentation of this file.
1 if (!pimple.SIMPLErho())
2 {
3  rho = thermo.rho();
4 }
5 
6 // Thermodynamic density needs to be updated by psi*d(p) after the
7 // pressure solution
9 
10 volScalarField rAU(1.0/UEqn.A());
11 volScalarField rAtU(1.0/(1.0/rAU - UEqn.H1()));
13 
14 if (pimple.nCorrPISO() <= 1)
15 {
16  tUEqn.clear();
17 }
18 
20 (
21  "phiHbyA",
22  (
24  + MRF.zeroFilter
25  (
27  )
28  )
29 );
30 
32 MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
33 
34 volScalarField rhorAtU("rhorAtU", rho*rAtU);
35 
36 // Update the pressure BCs to ensure flux consistency
38 
39 if (pimple.transonic())
40 {
42  (
43  "phid",
45  );
46 
47  phiHbyA +=
50 
51  HbyA -= (rAU - rAtU)*fvc::grad(p);
52 
54  (
57  ==
58  fvOptions(psi, p, rho.name())
59  );
60 
61  while (pimple.correctNonOrthogonal())
62  {
64 
65  // Relax the pressure equation to ensure diagonal-dominance
66  pEqn.relax();
67 
68  pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
69 
70  if (pimple.finalNonOrthogonalIter())
71  {
72  phi = phiHbyA + pEqn.flux();
73  }
74  }
75 }
76 else
77 {
79  HbyA -= (rAU - rAtU)*fvc::grad(p);
80 
82  (
84  + fvc::div(phiHbyA)
85  ==
86  fvOptions(psi, p, rho.name())
87  );
88 
89  while (pimple.correctNonOrthogonal())
90  {
92 
93  pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
94 
95  if (pimple.finalNonOrthogonalIter())
96  {
97  phi = phiHbyA + pEqn.flux();
98  }
99  }
100 }
101 
102 #include "rhoEqn.H"
103 #include "compressibleContinuityErrs.H"
104 
105 // Explicitly relax pressure for momentum corrector
106 p.relax();
107 
109 U.correctBoundaryConditions();
110 fvOptions.correct(U);
111 K = 0.5*magSqr(U);
112 
113 if (pressureControl.limit(p))
114 {
115  p.correctBoundaryConditions();
116 }
117 
118 thermo.correctRho(psi*p - psip0, rhoMin, rhoMax) ;
119 rho = thermo.rho();
120 
121 // Correct rhoUf if the mesh is moving
123 
124 if (thermo.dpdt())
125 {
126  dpdt = fvc::ddt(p);
127 
128  if (mesh.moving())
129  {
130  dpdt -= fvc::div(fvc::meshPhi(rho, U), p);
131  }
132 }
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...
Foam::fvc::meshPhi
tmp< surfaceScalarField > meshPhi(const volVectorField &U)
Definition: fvcMeshPhi.C:36
HbyA
HbyA
Definition: pcEqn.H:74
Foam::correction
tmp< fvMatrix< Type > > correction(const fvMatrix< Type > &)
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)
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
psip0
const volScalarField psip0(psi *p)
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
rhoMin
const dimensionedScalar rhoMin
Definition: setRegionFluidFields.H:67
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
ddtCorr
ddtCorr
Definition: readControls.H:9
makeRelative
MRF makeRelative(fvc::interpolate(rho), phiHbyA)
U
U
Definition: pcEqn.H:107
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::volVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:62
rhoUf
autoPtr< surfaceVectorField > rhoUf
Definition: createRhoUfIfPresent.H:33
pressureControl
const pressureControl & pressureControl
Definition: setRegionFluidFields.H:69
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:54
rhoMax
const dimensionedScalar rhoMax
Definition: setRegionFluidFields.H:66
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
Foam::fvc::correctRhoUf
void correctRhoUf(autoPtr< surfaceVectorField > &rhoUf, const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi)
Definition: fvcMeshPhi.C:243
psi
const volScalarField & psi
Definition: createFieldRefs.H:1
pDDtEqn
fvScalarMatrix pDDtEqn(fvc::ddt(rho)+psi *correction(fvm::ddt(p))+fvc::div(phiHbyA)==fvOptions(psi, p, rho.name()))
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.