diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/createFields.H b/applications/solvers/heatTransfer/buoyantPimpleFoam/createFields.H index 51ea261782..70453aa3dd 100644 --- a/applications/solvers/heatTransfer/buoyantPimpleFoam/createFields.H +++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/createFields.H @@ -75,7 +75,14 @@ volScalarField p_rgh // Force p_rgh to be consistent with p p_rgh = p - rho*gh; -pressureControl pressureControl(p, rho, pimple.dict(), false); +pressureControl pressureControl +( + p, + p_rgh, + rho, + pimple.dict(), + thermo.incompressible() +); mesh.setFluxRequired(p_rgh.name()); diff --git a/src/finiteVolume/cfdTools/general/pressureControl/pressureControl.C b/src/finiteVolume/cfdTools/general/pressureControl/pressureControl.C index e99fe467ad..f2b0a2744b 100644 --- a/src/finiteVolume/cfdTools/general/pressureControl/pressureControl.C +++ b/src/finiteVolume/cfdTools/general/pressureControl/pressureControl.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,6 +31,7 @@ License Foam::pressureControl::pressureControl ( const volScalarField& p, + const volScalarField& pRef, const volScalarField& rho, const dictionary& dict, const bool pRefRequired @@ -48,7 +49,7 @@ Foam::pressureControl::pressureControl scalar pMin = great; // Set the reference cell and value for closed domain simulations - if (pRefRequired && setRefCell(p, dict, refCell_, refValue_)) + if (pRefRequired && setRefCell(p, pRef, dict, refCell_, refValue_)) { pLimits = true; @@ -230,6 +231,18 @@ Foam::pressureControl::pressureControl } +Foam::pressureControl::pressureControl +( + const volScalarField& p, + const volScalarField& rho, + const dictionary& dict, + const bool pRefRequired +) +: + pressureControl(p, p, rho, dict, pRefRequired) +{} + + // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // bool Foam::pressureControl::limit(volScalarField& p) const diff --git a/src/finiteVolume/cfdTools/general/pressureControl/pressureControl.H b/src/finiteVolume/cfdTools/general/pressureControl/pressureControl.H index 2085dfecc4..63b8701dd5 100644 --- a/src/finiteVolume/cfdTools/general/pressureControl/pressureControl.H +++ b/src/finiteVolume/cfdTools/general/pressureControl/pressureControl.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -77,6 +77,17 @@ public: // Constructors + //- Construct from the simple/pimple sub-dictionary + // supporting the pressure and derived pressure fields (e.g. p_rgh) + pressureControl + ( + const volScalarField& p, + const volScalarField& pRef, + const volScalarField& rho, + const dictionary& dict, + const bool pRefRequired = true + ); + //- Construct from the simple/pimple sub-dictionary pressureControl (