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 ),
15 mesh
16 )
17 );
18
19 if (equal(runTime.value(), 0))
20 {
21 p = ph_rgh + rho*gh + pRef;
22 thermo.correct();
23 rho = thermo.rho();
24
25 label nCorr
26 (
27 pimple.dict().getOrDefault<label>("nHydrostaticCorrectors", 5)
28 );
29
30 for (label i=0; i<nCorr; i++)
31 {
32 surfaceScalarField rhof("rhof", fvc::interpolate(rho));
33
34 surfaceScalarField phig
35 (
36 "phig",
37 -rhof*ghf*fvc::snGrad(rho)*mesh.magSf()
38 );
39
40 // Update the pressure BCs to ensure flux consistency
41 constrainPressure(ph_rgh, rho, U, phig, rhof);
42
43 fvScalarMatrix ph_rghEqn
44 (
45 fvm::laplacian(rhof, ph_rgh) == fvc::div(phig)
46 );
47
48 ph_rghEqn.solve();
49
50 p = ph_rgh + rho*gh + pRef;
51 thermo.correct();
52 rho = thermo.rho();
53
54 Info<< "Hydrostatic pressure variation "
55 << (max(ph_rgh) - min(ph_rgh)).value() << endl;
56 }
57
58 ph_rgh.write();
59
60 p_rgh = ph_rgh;
61 }
62}
Y[inertIndex] max(0.0)
volScalarField & p_rgh
const surfaceScalarField & ghf
const volScalarField & gh
pimpleControl & pimple
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
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
surfaceScalarField phig("phig", -rhorAUf *ghf *fvc::snGrad(rho) *mesh.magSf())
dynamicFvMesh & mesh
engineTime & runTime
surfaceScalarField rhof(fvc::interpolate(rho, "div(phi,rho)"))