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());
8 
9 volVectorField HbyA("HbyA", U);
10 HbyA = rAU*UEqn().H();
11 
12 if (pimple.nCorrPISO() <= 1)
13 {
14  UEqn.clear();
15 }
16 
17 if (pimple.transonic())
18 {
20  (
21  "phid",
23  *(
24  (fvc::interpolate(HbyA) & mesh.Sf())
26  )
27  );
28 
29  MRF.makeRelative(fvc::interpolate(psi), phid);
30 
31  while (pimple.correctNonOrthogonal())
32  {
33  fvScalarMatrix pEqn
34  (
35  fvm::ddt(psi, p)
36  + fvm::div(phid, p)
38  ==
39  parcels.Srho()
40  + fvOptions(psi, p, rho.name())
41  );
42 
43  pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
44 
45  if (pimple.finalNonOrthogonalIter())
46  {
47  phi == pEqn.flux();
48  }
49  }
50 }
51 else
52 {
54  (
55  "phiHbyA",
56  (
57  (fvc::interpolate(rho*HbyA) & mesh.Sf())
59  )
60  );
61 
62  MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
63 
64  while (pimple.correctNonOrthogonal())
65  {
66  fvScalarMatrix pEqn
67  (
68  fvm::ddt(psi, p)
69  + fvc::div(phiHbyA)
71  ==
72  parcels.Srho()
73  + fvOptions(psi, p, rho.name())
74  );
75 
76  pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
77 
78  if (pimple.finalNonOrthogonalIter())
79  {
80  phi = phiHbyA + pEqn.flux();
81  }
82  }
83 }
84 
85 #include "rhoEqn.H"
86 #include "compressibleContinuityErrs.H"
87 
88 // Explicitly relax pressure for momentum corrector
89 p.relax();
90 
91 // Recalculate density from the relaxed pressure
92 rho = thermo.rho();
93 rho = max(rho, rhoMin);
94 rho = min(rho, rhoMax);
95 rho.relax();
96 Info<< "rho max/min : " << max(rho).value()
97  << " " << min(rho).value() << endl;
98 
99 U = HbyA - rAU*fvc::grad(p);
100 U.correctBoundaryConditions();
101 fvOptions.correct(U);
102 K = 0.5*magSqr(U);
103 
104 if (thermo.dpdt())
105 {
106  dpdt = fvc::ddt(p);
107 }
Foam::fvc::grad
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcGrad.C:52
p
p
Definition: pEqn.H:62
phid
surfaceScalarField phid("phid", fvc::interpolate(psi) *((mesh.Sf() &fvc::interpolate(HbyA))+rhorAUf *fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho)))
Foam::MULES::interpolate
tmp< surfaceScalarField > interpolate(const RhoType &rho)
Definition: IMULESTemplates.C:40
thermo
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
Foam::fvc::div
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcDiv.C:47
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::dimensioned::value
const Type & value() const
Return const reference to value.
Definition: dimensionedType.C:261
dpdt
volScalarField & dpdt
Definition: setRegionFluidFields.H:12
phi
phi
Definition: pEqn.H:20
A
simpleMatrix< scalar > A(Nc)
U
U
Definition: pEqn.H:46
K
CGAL::Exact_predicates_exact_constructions_kernel K
Definition: CGALTriangulation3DKernel.H:56
Foam::fvc::laplacian
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcLaplacian.C:45
rhoMin
PtrList< dimensionedScalar > rhoMin(fluidRegions.size())
Foam::fvScalarMatrix
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:42
Foam::Info
messageStream Info
Foam::fvc::ddtCorr
tmp< GeometricField< typename flux< Type >::type, fvsPatchField, surfaceMesh > > ddtCorr(const GeometricField< Type, fvPatchField, volMesh > &U, const GeometricField< Type, fvsPatchField, surfaceMesh > &Uf)
Definition: fvcDdt.C:155
UEqn
tmp< fvVectorMatrix > UEqn(fvm::div(phi, U)+MRF.DDt(U)+turbulence->divDevReff(U)==fvOptions(U))
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
rhoEqn.H
Solve the continuity for density.
MRF
IOMRFZoneList & MRF
Definition: setRegionFluidFields.H:15
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
rhorAUf
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho *rAU))
rho
rho
Definition: pEqn.H:3
Foam::volVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
rAU
volScalarField rAU("rAU", 1.0/UEqn().A())
Foam::max
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
HbyA
HbyA
Definition: pEqn.H:4
psi
const volScalarField & psi
Definition: setRegionFluidFields.H:13
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:52
rhoMax
PtrList< dimensionedScalar > rhoMax(fluidRegions.size())
pimple
const dictionary & pimple
Definition: readFluidMultiRegionPIMPLEControls.H:1
phiHbyA
phiHbyA
Definition: pEqn.H:21
Foam::fvc::ddt
tmp< GeometricField< Type, fvPatchField, volMesh > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
Definition: fvcDdt.C:45
Foam::min
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
Foam::magSqr
dimensioned< scalar > magSqr(const dimensioned< Type > &)
fvOptions
fv::options & fvOptions
Definition: setRegionFluidFields.H:16