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  fvc::makeRelative(phid, psi, U);
30  MRF.makeRelative(fvc::interpolate(psi), phid);
31 
32  while (pimple.correctNonOrthogonal())
33  {
34  fvScalarMatrix pEqn
35  (
36  fvm::ddt(psi, p)
37  + fvm::div(phid, p)
39  ==
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  (fvc::interpolate(rho*HbyA) & mesh.Sf())
58  );
59 
61  MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
62 
63  while (pimple.correctNonOrthogonal())
64  {
65  // Pressure corrector
66  fvScalarMatrix pEqn
67  (
68  fvm::ddt(psi, p)
69  + fvc::div(phiHbyA)
71  ==
72  fvOptions(psi, p, rho.name())
73  );
74 
75  pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
76 
77  if (pimple.finalNonOrthogonalIter())
78  {
79  phi = phiHbyA + pEqn.flux();
80  }
81  }
82 }
83 
84 #include "rhoEqn.H"
85 #include "compressibleContinuityErrs.H"
86 
87 // Explicitly relax pressure for momentum corrector
88 p.relax();
89 
90 // Recalculate density from the relaxed pressure
91 rho = thermo.rho();
92 rho = max(rho, rhoMin);
93 rho = min(rho, rhoMax);
94 rho.relax();
95 Info<< "rho max/min : " << max(rho).value()
96  << " " << min(rho).value() << endl;
97 
98 U = HbyA - rAU*fvc::grad(p);
99 U.correctBoundaryConditions();
100 fvOptions.correct(U);
101 K = 0.5*magSqr(U);
102 
103 {
105  surfaceVectorField n(mesh.Sf()/mesh.magSf());
106  rhoUf += n*(fvc::absolute(phi, rho, U)/mesh.magSf() - (n & rhoUf));
107 }
108 
109 if (thermo.dpdt())
110 {
111  dpdt = fvc::ddt(p);
112 
113  if (mesh.moving())
114  {
115  dpdt -= fvc::div(fvc::meshPhi(rho, U), p);
116  }
117 }
volScalarField & dpdt
phi
Definition: pEqn.H:20
CGAL::Exact_predicates_exact_constructions_kernel K
dimensioned< scalar > magSqr(const dimensioned< Type > &)
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
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcLaplacian.C:45
messageStream Info
tmp< surfaceScalarField > interpolate(const RhoType &rho)
tmp< surfaceScalarField > meshPhi(const volVectorField &U)
Definition: fvcMeshPhi.C:33
tmp< GeometricField< Type, fvPatchField, volMesh > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
Definition: fvcDdt.C:45
dynamicFvMesh & mesh
const dictionary & pimple
p
Definition: pEqn.H:59
fv::IOoptionList & fvOptions
fvMatrix< scalar > fvScalarMatrix
Definition: fvMatricesFwd.H:42
rhoUf
Definition: pEqn.H:90
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
tmp< surfaceScalarField > absolute(const tmp< surfaceScalarField > &tphi, const volVectorField &U)
Return the given relative flux in absolute form.
Definition: fvcMeshPhi.C:187
IOMRFZoneList & MRF
fvVectorMatrix UEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+turbulence->divDevRhoReff(U)==fvOptions(rho, U))
surfaceScalarField phid("phid", fvc::interpolate(psi)*( (mesh.Sf()&fvc::interpolate(HbyA)) +rhorAUf *fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho) ))
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
MRF makeRelative(fvc::interpolate(rho), phiHbyA)
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho *rAU))
const volScalarField & psi
Definition: createFields.H:24
phiHbyA
Definition: pEqn.H:21
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
volScalarField rAU(1.0/UEqn.A())
surfaceVectorField n(mesh.Sf()/mesh.magSf())
PtrList< dimensionedScalar > rhoMin(fluidRegions.size())
tmp< GeometricField< Type, fvPatchField, volMesh > > div(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcDiv.C:47
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcGrad.C:52
rho
Definition: pEqn.H:1
psiReactionThermo & thermo
Definition: createFields.H:32
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
PtrList< dimensionedScalar > rhoMax(fluidRegions.size())
U
Definition: pEqn.H:82
HbyA
Definition: pEqn.H:7