Loading...
Searching...
No Matches
pEqn.H
Go to the documentation of this file.
1bool closedVolume = p_rgh.needReference();
2dimensionedScalar compressibility = fvc::domainIntegrate(psi);
3bool compressible = (compressibility.value() > SMALL);
4
5rho = thermo.rho();
6
7// Thermodynamic density needs to be updated by psi*d(p) after the
8// pressure solution
9const volScalarField psip0(psi*p);
10
11volScalarField rAU("rAU", 1.0/UEqn.A());
12surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
13volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh));
14
15surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());
16
17surfaceScalarField phiHbyA
18(
19 "phiHbyA",
20 (
21 fvc::flux(rho*HbyA)
22 + MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, phi))
23 )
24 + phig
25);
26
27MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
28
29// Update the pressure BCs to ensure flux consistency
31
32{
33 fvScalarMatrix p_rghDDtEqn
34 (
35 fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh))
36 + fvc::div(phiHbyA)
37 );
38
39 for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
40 {
41 fvScalarMatrix p_rghEqn
42 (
44 - fvm::laplacian(rhorAUf, p_rgh)
45 );
46
47 p_rghEqn.setReference
48 (
50 compressible ? getRefCellValue(p_rgh, pRefCell) : pRefValue
51 );
52
53 p_rghEqn.solve
54 (
55 p_rgh.select
56 (
57 (
58 oCorr == nOuterCorr-1
59 && corr == nCorr-1
60 && nonOrth == nNonOrthCorr
61 )
62 )
63 );
64
65 if (nonOrth == nNonOrthCorr)
66 {
67 phi = phiHbyA + p_rghEqn.flux();
68
69 p_rgh.relax();
70
71 U = HbyA
72 + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rhorAUf);
73 U.correctBoundaryConditions();
74 fvOptions.correct(U);
75 K = 0.5*magSqr(U);
76 }
77 }
78
80
81}
82
84
85// For closed-volume cases adjust the pressure and density levels
86// to obey overall mass continuity
88{
89 if (!compressible)
90 {
91 p += dimensionedScalar
92 (
93 "p",
94 p.dimensions(),
95 pRefValue - getRefCellValue(p, pRefCell)
96 );
97 }
98 else
99 {
100 p += (initialMass - fvc::domainIntegrate(psi*p))
102 thermo.correctRho(psi*p - psip0, rhoMin, rhoMax);
103 rho = thermo.rho();
104 p_rgh = p - rho*gh;
105 p_rgh.correctBoundaryConditions();
106 }
107}
108else
109{
110 thermo.correctRho(psi*p - psip0, rhoMin, rhoMax);
111}
112
113#include "rhoEqn.H"
115
116rho = thermo.rho();
117
118// Update pressure time derivative if needed
119if (thermo.dpdt())
120{
121 dpdt = fvc::ddt(p);
122}
CGAL::Exact_predicates_exact_constructions_kernel K
volScalarField & p_rgh
fv::options & fvOptions
const scalar pRefValue
const surfaceScalarField & ghf
const label pRefCell
IOMRFZoneList & MRF
const volScalarField & gh
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 phig("phig", -rhorAUf *ghf *fvc::snGrad(rho) *mesh.magSf())
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho *rAU))
fvVectorMatrix & UEqn
Definition UEqn.H:13
phiHbyA
Definition pcEqn.H:73
HbyA
Definition pcEqn.H:74
const volScalarField psip0(psi *p)
fvScalarMatrix p_rghDDtEqn(fvc::ddt(rho)+psi *correction(fvm::ddt(p_rgh))+fvc::div(phiHbyA)==fvOptions(psi, p_rgh, rho.name()))
bool closedVolume
Definition pEqn.H:10
dynamicFvMesh & mesh
const dimensionedScalar rhoMin
const dimensionedScalar rhoMax
volScalarField & dpdt
const pressureControl & pressureControl
dimensionedScalar compressibility
Definition pEqn.H:1
bool compressible
Definition pEqn.H:2
tmp< volScalarField > rAU
const int nOuterCorr
dimensionedScalar initialMass