pEqn.H
Go to the documentation of this file.
1{
2 const volScalarField& psi = thermo.psi();
3
4 tmp<volVectorField> tHbyA;
6 {
7 tHbyA = constrainHbyA(trTU()&UEqn.H(), U, p);
8 }
9 else
10 {
11 tHbyA = constrainHbyA(trAU()*UEqn.H(), U, p);
12 }
13 volVectorField& HbyA = tHbyA.ref();
14
15 tUEqn.clear();
16
17 bool closedVolume = false;
18
19 surfaceScalarField phiHbyA("phiHbyA", fvc::flux(rho*HbyA));
20 MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
21
23
24 while (simple.correctNonOrthogonal())
25 {
26 tmp<fvScalarMatrix> tpEqn;
27
29 {
30 tpEqn =
31 (
32 fvm::laplacian(rho*trTU(), p)
33 + fvOptions(psi, p, rho.name())
34 ==
35 fvc::div(phiHbyA)
36 );
37 }
38 else
39 {
40 tpEqn =
41 (
42 fvm::laplacian(rho*trAU(), p)
43 + fvOptions(psi, p, rho.name())
44 ==
45 fvc::div(phiHbyA)
46 );
47 }
48
49 fvScalarMatrix& pEqn = tpEqn.ref();
50
51 pEqn.setReference
52 (
53 pressureControl.refCell(),
54 pressureControl.refValue()
55 );
56
57 pEqn.solve();
58
59 if (simple.finalNonOrthogonalIter())
60 {
61 phi = phiHbyA - pEqn.flux();
62 }
63 }
64
66
67 // Explicitly relax pressure for momentum corrector
68 p.relax();
69
71 {
72 U = HbyA - (trTU() & fvc::grad(p));
73 }
74 else
75 {
76 U = HbyA - trAU()*fvc::grad(p);
77 }
78
79 U.correctBoundaryConditions();
80 fvOptions.correct(U);
81
83
84 // For closed-volume cases adjust the pressure and density levels
85 // to obey overall mass continuity
87 {
88 p += (initialMass - fvc::domainIntegrate(psi*p))
89 /fvc::domainIntegrate(psi);
90 }
91
92 rho = thermo.rho();
93 rho.relax();
94}
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
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
tmp< volTensorField > trTU
Definition: UEqn.H:22
tmp< volScalarField > trAU
Definition: UEqn.H:21
tmp< volVectorField > tHbyA
Definition: pEqn.H:4
bool pressureImplicitPorosity(false)
const pressureControl & pressureControl
adjustPhi(phiHbyA, U, p_rgh)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:82
const dictionary & simple
dimensionedScalar initialMass
Definition: createFields.H:57
Calculates and prints the continuity errors.