Loading...
Searching...
No Matches
pEqn.H
Go to the documentation of this file.
1if (!pimple.SIMPLErho())
2{
3 rho = thermo.rho();
4}
5// Thermodynamic density needs to be updated by psi*d(p) after the
6// pressure solution
7const volScalarField psip0(psi*p);
8
9volScalarField rAU("rAU", 1.0/UEqn.A());
10mesh.interpolate(rAU);
11
12surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
13volVectorField HbyA("HbyA", U);
14
16
17if (pimple.nCorrPISO() <= 1)
18{
19 tUEqn.clear();
20}
21
22surfaceScalarField phiHbyA
23(
24 "phiHbyA",
25 fvc::interpolate(rho)*fvc::flux(HbyA)
26);
27
28fvc::makeRelative(phiHbyA, rho, U);
29MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
30
31// Update the pressure BCs to ensure flux consistency
33
34if (pimple.transonic())
35{
36 surfaceScalarField phid
37 (
38 "phid",
39 (fvc::interpolate(psi)/fvc::interpolate(rho))*phiHbyA
40 );
41
42 phiHbyA -= fvc::interpolate(psi*p)*phiHbyA/fvc::interpolate(rho);
43
44 fvScalarMatrix pDDtEqn
45 (
46 fvc::ddt(rho) + psi*correction(fvm::ddt(p))
47 + fvc::div(phiHbyA) + fvm::div(phid, p)
48 ==
49 fvOptions(psi, p, rho.name())
50 );
51
52 while (pimple.correctNonOrthogonal())
53 {
54 fvScalarMatrix pEqn(pDDtEqn - fvm::laplacian(rhorAUf, p));
55
56 // Relax the pressure equation to ensure diagonal-dominance
57 pEqn.relax();
58
59 pEqn.solve(p.select(pimple.finalInnerIter()));
60
61 if (pimple.finalNonOrthogonalIter())
62 {
63 phi = phiHbyA + pEqn.flux();
64 }
65 }
66}
67else
68{
69 fvScalarMatrix pDDtEqn
70 (
71 fvc::ddt(rho) + psi*correction(fvm::ddt(p))
72 + fvc::div(phiHbyA)
73 ==
74 fvOptions(psi, p, rho.name())
75 );
76
77 while (pimple.correctNonOrthogonal())
78 {
79 fvScalarMatrix pEqn(pDDtEqn - fvm::laplacian(rhorAUf, p));
80
81 pEqn.solve(p.select(pimple.finalInnerIter()));
82
83 if (pimple.finalNonOrthogonalIter())
84 {
85 phi = phiHbyA + pEqn.flux();
86 }
87 }
88}
89
90#include "rhoEqn.H"
92
93// Explicitly relax pressure for momentum corrector
94p.relax();
95
96volVectorField gradP(fvc::grad(p));
97//mesh.interpolate(gradP);
98U = cellMask*(HbyA - rAU*gradP);
99U.correctBoundaryConditions();
100fvOptions.correct(U);
101K = 0.5*magSqr(U);
102
104{
105 p.correctBoundaryConditions();
106}
107
108thermo.correctRho(psi*p - psip0, rhoMin, rhoMax) ;
109rho = thermo.rho();
110
111{
112 // Correct rhoUf if the mesh is moving
113 fvc::correctRhoUf(rhoUf, rho, U, phi);
114}
115
116if (thermo.dpdt())
117{
118 dpdt = fvc::ddt(p);
119
120 if (mesh.moving())
121 {
122 dpdt -= fvc::div(fvc::meshPhi(rho, U), p);
123 }
124}
125
126phi *= faceMask;
CGAL::Exact_predicates_exact_constructions_kernel K
Calculates and prints the continuity errors.
fv::options & fvOptions
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
volScalarField & p
const volScalarField & psi
constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF)
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)
volVectorField gradP(fvc::grad(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
autoPtr< surfaceVectorField > rhoUf
const dimensionedScalar rhoMin
const dimensionedScalar rhoMax
volScalarField & dpdt
const pressureControl & pressureControl
tmp< volScalarField > rAU
faceMask
Definition setCellMask.H:43