chtMultiRegionFoam: Added optional hydrostatic initialisation of pressure

Class
    Foam::hydrostaticInitialisation

Description
    Optional hydrostatic initialisation of p_rgh and p by solving for and
    caching the hydrostatic ph_rgh and updating the density such that

        p = ph_rgh + rho*gh + pRef

    This initialisation process is applied at the beginning of the run (not on
    restart) if the \c hydrostaticInitialisation switch is set true in
    fvSolution/PIMPLE or fvSolution/SIMPLE.  The calculation is iterative if the
    density is a function of pressure and an optional number of iterations \c
    nHydrostaticCorrectors may be specified which defaults to 5.
This commit is contained in:
Henry Weller
2021-06-11 11:33:31 +01:00
parent 012df9d699
commit 881bbfa591
2 changed files with 13 additions and 3 deletions

View File

@ -214,9 +214,6 @@ forAll(fluidRegions, i)
)
);
// Force p_rgh to be consistent with p
p_rghFluid[i] = thermoFluid[i].p() - rhoFluid[i]*ghFluid[i] - pRefFluid[i];
fluidRegions[i].setFluxRequired(p_rghFluid[i].name());
initialMassFluid[i] = fvc::domainIntegrate(rhoFluid[i]).value();

View File

@ -12,4 +12,17 @@ forAll(fluidRegions, i)
false
)
);
hydrostaticInitialisation
(
p_rghFluid[i],
thermoFluid[i].p(),
rhoFluid[i],
UFluid[i],
ghFluid[i],
ghfFluid[i],
pRefFluid[i],
thermoFluid[i],
pimples.pimple(i).dict()
);
}