pEqn.H
Go to the documentation of this file.
1 rho = thermo.rho();
2 rho = max(rho, rhoMin);
3 rho = min(rho, rhoMax);
4 rho.relax();
5 
6 volScalarField rAU(1.0/UEqn.A());
9 
10 if (pimple.nCorrPISO() <= 1)
11 {
12  tUEqn.clear();
13 }
14 
15 if (pimple.transonic())
16 {
18  (
19  "phid",
21  *(
23  + MRF.zeroFilter
24  (
26  )
27  )
28  );
29 
31  MRF.makeRelative(fvc::interpolate(psi), phid);
32 
33  while (pimple.correctNonOrthogonal())
34  {
35  fvScalarMatrix pEqn
36  (
37  fvm::ddt(psi, p)
38  + fvm::div(phid, p)
40  ==
41  parcels.Srho()
42  + fvOptions(psi, p, rho.name())
43  );
44 
45  pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
46 
47  if (pimple.finalNonOrthogonalIter())
48  {
49  phi == pEqn.flux();
50  }
51  }
52 }
53 else
54 {
56  (
57  "phiHbyA",
59  + MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, rhoUf))
60  );
61 
63  MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
64 
65  // Update the pressure BCs to ensure flux consistency
67 
68  while (pimple.correctNonOrthogonal())
69  {
70  fvScalarMatrix pEqn
71  (
72  fvm::ddt(psi, p)
73  + fvc::div(phiHbyA)
75  ==
76  parcels.Srho()
77  + fvOptions(psi, p, rho.name())
78  );
79 
80  pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
81 
82  if (pimple.finalNonOrthogonalIter())
83  {
84  phi = phiHbyA + pEqn.flux();
85  }
86  }
87 }
88 
89 #include "rhoEqn.H"
90 #include "compressibleContinuityErrs.H"
91 
92 // Explicitly relax pressure for momentum corrector
93 p.relax();
94 
95 // Recalculate density from the relaxed pressure
96 rho = thermo.rho();
97 rho = max(rho, rhoMin);
98 rho = min(rho, rhoMax);
99 rho.relax();
100 Info<< "rho min/max : " << min(rho).value() << " " << max(rho).value() << endl;
101 
102 U = HbyA - rAU*fvc::grad(p);
103 U.correctBoundaryConditions();
104 fvOptions.correct(U);
105 K = 0.5*magSqr(U);
106 
107 {
109  surfaceVectorField n(mesh.Sf()/mesh.magSf());
110  rhoUf += n*(fvc::absolute(phi, rho, U)/mesh.magSf() - (n & rhoUf));
111 }
112 
113 if (thermo.dpdt())
114 {
115  dpdt = fvc::ddt(p);
116 
117  if (mesh.moving())
118  {
119  dpdt -= fvc::div(fvc::meshPhi(rho, U), p);
120  }
121 }
rhoUf
rhoUf
Definition: pEqn.H:89
Foam::constrainHbyA
tmp< volVectorField > constrainHbyA(const tmp< volVectorField > &tHbyA, const volVectorField &U, const volScalarField &p)
Definition: constrainHbyA.C:28
phid
surfaceScalarField phid("phid", fvc::interpolate(psi) *(fvc::flux(HbyA)+MRF.zeroFilter(rhorAUf *fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho))))
phiHbyA
phiHbyA
Definition: pEqn.H:20
Foam::fac::grad
tmp< GeometricField< typename outerProduct< vector, Type >::type, faPatchField, areaMesh >> grad(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Definition: facGrad.C:49
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:29
Foam::endl
Ostream & endl(Ostream &os)
Definition: Ostream.H:381
Foam::fac::div
tmp< GeometricField< Type, faPatchField, areaMesh > > div(const GeometricField< Type, faePatchField, edgeMesh > &ssf)
Definition: facDiv.C:43
Foam::min
label min(const labelHashSet &set, label minValue=labelMax)
Definition: hashSets.C:26
Foam::magSqr
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
K
CGAL::Exact_predicates_exact_constructions_kernel K
Definition: CGALTriangulation3DKernel.H:52
MRF
IOMRFZoneList & MRF
Definition: setRegionFluidFields.H:22
pimple
pimpleControl & pimple
Definition: setRegionFluidFields.H:56
HbyA
HbyA
Definition: pEqn.H:4
tUEqn
tmp< fvVectorMatrix > tUEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+MRF.DDt(rho, U)+turbulence->divDevRhoReff(U)==fvOptions(rho, U))
Foam::fvScalarMatrix
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:38
fvOptions
fv::options & fvOptions
Definition: setRegionFluidFields.H:23
Foam::Info
messageStream Info
rhorAUf
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho *rAU))
rhoMin
const dimensionedScalar rhoMin
Definition: setRegionFluidFields.H:67
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:53
makeRelative
MRF makeRelative(fvc::interpolate(rho), phiHbyA)
ddtCorr
ddtCorr
Definition: readControls.H:9
Foam::max
label max(const labelHashSet &set, label maxValue=labelMin)
Definition: hashSets.C:40
p
p
Definition: pEqn.H:50
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
rAU
volScalarField rAU(1.0/UEqn.A())
Foam::volVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:58
U
U
Definition: pEqn.H:72
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:50
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:40
phi
phi
Definition: pEqn.H:18
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:40
Foam::surfaceVectorField
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
Definition: surfaceFieldsFwd.H:55
Foam::fvc::flux
tmp< surfaceScalarField > flux(const volVectorField &vvf)
Definition: fvcFlux.C:27
psi
const volScalarField & psi
Definition: createFieldRefs.H:1
rho
rho
Definition: pEqn.H:1
Foam::fvc::absolute
tmp< surfaceScalarField > absolute(const tmp< surfaceScalarField > &tphi, const volVectorField &U)
Definition: fvcMeshPhi.C:183
interpolate
mesh interpolate(rAU)
n
surfaceVectorField n(mesh.Sf()/mesh.magSf())
constrainPressure
constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF)