pEqn.H
Go to the documentation of this file.
1volScalarField rAU(1.0/UEqn.A());
2surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
3volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
4tUEqn.clear();
5
6bool closedVolume = false;
7
8surfaceScalarField phiHbyA("phiHbyA", fvc::interpolate(rho)*fvc::flux(HbyA));
9MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
10
11// Update the pressure BCs to ensure flux consistency
13
14if (simple.transonic())
15{
16 surfaceScalarField phid
17 (
18 "phid",
19 (fvc::interpolate(psi)/fvc::interpolate(rho))*phiHbyA
20 );
21
22 phiHbyA -= fvc::interpolate(psi*p)*phiHbyA/fvc::interpolate(rho);
23
24 while (simple.correctNonOrthogonal())
25 {
26 fvScalarMatrix pEqn
27 (
28 fvc::div(phiHbyA)
29 + fvm::div(phid, p)
30 - fvm::laplacian(rhorAUf, p)
31 ==
32 fvOptions(psi, p, rho.name())
33 );
34
35 // Relax the pressure equation to ensure diagonal-dominance
36 pEqn.relax();
37
38 pEqn.setReference
39 (
40 pressureControl.refCell(),
41 pressureControl.refValue()
42 );
43
44 pEqn.solve();
45
46 if (simple.finalNonOrthogonalIter())
47 {
48 phi = phiHbyA + pEqn.flux();
49 }
50 }
51}
52else
53{
55
56 while (simple.correctNonOrthogonal())
57 {
58 fvScalarMatrix pEqn
59 (
60 fvc::div(phiHbyA)
61 - fvm::laplacian(rhorAUf, p)
62 ==
63 fvOptions(psi, p, rho.name())
64 );
65
66 pEqn.setReference
67 (
68 pressureControl.refCell(),
69 pressureControl.refValue()
70 );
71
72 pEqn.solve();
73
74 if (simple.finalNonOrthogonalIter())
75 {
76 phi = phiHbyA + pEqn.flux();
77 }
78 }
79}
80
82
83// Explicitly relax pressure for momentum corrector
84p.relax();
85
86U = HbyA - rAU*fvc::grad(p);
87U.correctBoundaryConditions();
88fvOptions.correct(U);
89
91
92// For closed-volume cases adjust the pressure and density levels
93// to obey overall mass continuity
95{
96 p += (initialMass - fvc::domainIntegrate(psi*p))
97 /fvc::domainIntegrate(psi);
98}
99
101{
102 p.correctBoundaryConditions();
103}
104
105rho = thermo.rho();
106
107if (!simple.transonic())
108{
109 rho.relax();
110}
fv::options & fvOptions
surfaceScalarField & phi
IOMRFZoneList & MRF
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
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
bool closedVolume
Definition: pEqn.H:10
bool pLimited
Definition: pEqn.H:102
surfaceScalarField phid("phid", fvc::interpolate(psi) *(fvc::flux(HbyA)+MRF.zeroFilter(rhorAUf *fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho))))
const pressureControl & pressureControl
adjustPhi(phiHbyA, U, p_rgh)
tmp< volScalarField > rAU
Definition: initCorrectPhi.H:1
const dictionary & simple
dimensionedScalar initialMass
Definition: createFields.H:57
Calculates and prints the continuity errors.