pEqn.H
Go to the documentation of this file.
1if (!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
8const volScalarField psip0(psi*p);
9
10volScalarField rAU(1.0/UEqn.A());
11surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
12volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
13
14if (pimple.nCorrPISO() <= 1)
15{
16 tUEqn.clear();
17}
18
19surfaceScalarField phiHbyA
20(
21 "phiHbyA",
22 fvc::interpolate(rho)*fvc::flux(HbyA)
23 + MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, phi, rhoUf))
24);
25
26fvc::makeRelative(phiHbyA, rho, U);
27MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
28
29// Update the pressure BCs to ensure flux consistency
31
32if (pimple.transonic())
33{
34 surfaceScalarField phid
35 (
36 "phid",
37 (fvc::interpolate(psi)/fvc::interpolate(rho))*phiHbyA
38 );
39
40 phiHbyA -= fvc::interpolate(psi*p)*phiHbyA/fvc::interpolate(rho);
41
42 fvScalarMatrix pDDtEqn
43 (
44 fvc::ddt(rho) + psi*correction(fvm::ddt(p))
45 + fvc::div(phiHbyA) + fvm::div(phid, p)
46 ==
47 fvOptions(psi, p, rho.name())
48 );
49
50 while (pimple.correctNonOrthogonal())
51 {
52 fvScalarMatrix pEqn(pDDtEqn - fvm::laplacian(rhorAUf, p));
53
54 // Relax the pressure equation to ensure diagonal-dominance
55 pEqn.relax();
56
57 pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
58
59 if (pimple.finalNonOrthogonalIter())
60 {
61 phi = phiHbyA + pEqn.flux();
62 }
63 }
64}
65else
66{
67 fvScalarMatrix pDDtEqn
68 (
69 fvc::ddt(rho) + psi*correction(fvm::ddt(p))
70 + fvc::div(phiHbyA)
71 ==
72 fvOptions(psi, p, rho.name())
73 );
74
75 while (pimple.correctNonOrthogonal())
76 {
77 fvScalarMatrix pEqn(pDDtEqn - fvm::laplacian(rhorAUf, p));
78
79 pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
80
81 if (pimple.finalNonOrthogonalIter())
82 {
83 phi = phiHbyA + pEqn.flux();
84 }
85 }
86}
87
88
89// Explicitly relax pressure for momentum corrector
90p.relax();
91
92U = HbyA - rAU*fvc::grad(p);
93U.correctBoundaryConditions();
94fvOptions.correct(U);
95K = 0.5*magSqr(U);
96
97if (pressureControl.limit(p))
98{
99 p.correctBoundaryConditions();
100}
101
102thermo.correctRho(psi*p - psip0, rhoMin, rhoMax) ;
103
104#include "rhoEqn.H"
105#include "compressibleContinuityErrs.H"
106
107rho = thermo.rho();
108
109// Correct rhoUf if the mesh is moving
110fvc::correctRhoUf(rhoUf, rho, U, phi);
111
112if (thermo.dpdt())
113{
114 dpdt = fvc::ddt(p);
115
116 if (mesh.moving())
117 {
118 dpdt -= fvc::div(fvc::meshPhi(rho, U), p);
119 }
120}
CGAL::Exact_predicates_exact_constructions_kernel K
fv::options & fvOptions
surfaceScalarField & phi
IOMRFZoneList & MRF
pimpleControl & pimple
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
U
Definition: pEqn.H:72
rhoUf
Definition: pEqn.H:89
volScalarField & p
const volScalarField & psi
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho *rAU))
tmp< fvVectorMatrix > tUEqn(fvm::ddt(rho, U)+fvm::div(phi, U)+MRF.DDt(rho, U)+turbulence->divDevRhoReff(U)==fvOptions(rho, U))
fvVectorMatrix & UEqn
Definition: UEqn.H:13
phiHbyA
Definition: pcEqn.H:73
HbyA
Definition: pcEqn.H:74
const volScalarField psip0(psi *p)
fvScalarMatrix pDDtEqn(fvc::ddt(rho)+psi *correction(fvm::ddt(p))+fvc::div(phiHbyA)==fvOptions(psi, p, rho.name()))
surfaceScalarField phid("phid", fvc::interpolate(psi) *(fvc::flux(HbyA)+MRF.zeroFilter(rhorAUf *fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho))))
dynamicFvMesh & mesh
const dimensionedScalar rhoMin
const dimensionedScalar rhoMax
volScalarField & dpdt
const pressureControl & pressureControl
tmp< volScalarField > rAU
Definition: initCorrectPhi.H:1