Loading...
Searching...
No Matches
phrghEqn.H
Go to the documentation of this file.
1if (pimple.dict().getOrDefault("hydrostaticInitialization", false))
2{
3 volScalarField& ph_rgh = regIOobject::store
4 (
5 new volScalarField
6 (
7 IOobject
8 (
9 "ph_rgh",
10 "0",
11 mesh,
12 IOobject::MUST_READ,
13 IOobject::NO_WRITE,
14 IOobject::REGISTER
15 ),
16 mesh
17 )
18 );
19
20 if (equal(runTime.value(), 0))
21 {
22 p = ph_rgh + rho*gh + pRef;
23 thermo.correct();
24 rho = thermo.rho();
25
26 label nCorr
27 (
28 pimple.dict().getOrDefault<label>("nHydrostaticCorrectors", 5)
29 );
30
31 for (label i=0; i<nCorr; i++)
32 {
33 surfaceScalarField rhof("rhof", fvc::interpolate(rho));
34
35 surfaceScalarField phig
36 (
37 "phig",
38 -rhof*ghf*fvc::snGrad(rho)*mesh.magSf()
39 );
40
41 // Update the pressure BCs to ensure flux consistency
42 constrainPressure(ph_rgh, rho, U, phig, rhof);
43
44 fvScalarMatrix ph_rghEqn
45 (
46 fvm::laplacian(rhof, ph_rgh) == fvc::div(phig)
47 );
48
49 ph_rghEqn.solve();
50
51 p = ph_rgh + rho*gh + pRef;
52 thermo.correct();
53 rho = thermo.rho();
54
55 Info<< "Hydrostatic pressure variation "
56 << (max(ph_rgh) - min(ph_rgh)).value() << endl;
57 }
58
59 ph_rgh.write();
60
61 p_rgh = ph_rgh;
62 }
63}
volScalarField & p_rgh
const surfaceScalarField & ghf
const volScalarField & gh
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
constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF)
surfaceScalarField phig("phig", -rhorAUf *ghf *fvc::snGrad(rho) *mesh.magSf())
dynamicFvMesh & mesh
engineTime & runTime
surfaceScalarField rhof(fvc::interpolate(rho, "div(phi,rho)"))