diff --git a/applications/solvers/compressible/rhoPimpleFoam/pEqn.H b/applications/solvers/compressible/rhoPimpleFoam/pEqn.H index 3a0ca9d042a5e0468bbc95a14c1ae5e25beaa63c..ab89fcd81154cfca4f18b2087c8294936bbfbbfd 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/pEqn.H @@ -111,8 +111,6 @@ else thermo.correctRho(psi*p - psip0, rhoMin, rhoMax) ; } -Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() << endl; - if (thermo.dpdt()) { dpdt = fvc::ddt(p); diff --git a/applications/solvers/compressible/rhoPimpleFoam/pcEqn.H b/applications/solvers/compressible/rhoPimpleFoam/pcEqn.H index 546dfaf251be1d21140529afec5019a62d2530e5..55be311749e7c83dbc5b22f48d530e31a147f3c9 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/pcEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/pcEqn.H @@ -112,7 +112,6 @@ if (pressureControl.limit(p)) thermo.correctRho(psi*p - psip0, rhoMin, rhoMax); rho = thermo.rho(); } - else if (pimple.SIMPLErho()) { thermo.correctRho(psi*p - psip0, rhoMin, rhoMax); @@ -123,8 +122,6 @@ else thermo.correctRho(psi*p - psip0, rhoMin, rhoMax); } -Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() << endl; - if (thermo.dpdt()) { dpdt = fvc::ddt(p); diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H index 0f53379eef783f9ea692b8218245c7308442018b..677fabffd5614bef92210a9a51b9585bbcbfacc1 100644 --- a/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H @@ -72,9 +72,6 @@ while (pimple.correctNonOrthogonal()) p = p_rgh + rho*gh; -// Thermodynamic density update -//thermo.correctRho(psi*p - psip0); - #include "rhoEqn.H" #include "compressibleContinuityErrs.H" @@ -95,9 +92,8 @@ if (p_rgh.needReference()) /compressibility; thermo.correctRho(psi*p - psip0); rho = thermo.rho(); - + p_rgh = p - rho*gh; } - p_rgh = p - rho*gh; } else { diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H index aa3ad0f163e7bcebabc8bb2863b012f4498253d2..13ffff11b649b7b44889d2909c01ab9ff9a4e9d3 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H @@ -76,8 +76,8 @@ { p += (initialMass - fvc::domainIntegrate(psi*p)) /fvc::domainIntegrate(psi); + p_rgh = p - rho*gh; } - p_rgh = p - rho*gh; } rho = thermo.rho(); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/pEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/pEqn.H index 5b8286ca4b85bfff6a3b283558637a9c2b76e899..410fc7166d14f31febb352aa18b0d841ea9e65ef 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/pEqn.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/pEqn.H @@ -84,8 +84,8 @@ { p += (initialMass - fvc::domainIntegrate(psi*p)) /compressibility; + p_rgh = p - rho*gh; } - p_rgh = p - rho*gh; } rho = thermo.rho(); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H index 0c9195ee9deb802ca7fe54fc33428269ff8e95fe..dc67ab09e20d88a3f05242417bed3905a4a4c439 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H @@ -112,8 +112,8 @@ if (closedVolume) /compressibility; thermo.correctRho(psi*p - psip0); rho = thermo.rho(); + p_rgh = p - rho*gh; } - p_rgh = p - rho*gh; } else { diff --git a/src/thermophysicalModels/basic/fluidThermo/fluidThermo.H b/src/thermophysicalModels/basic/fluidThermo/fluidThermo.H index bb0364dc79981e602faa8053f41e4f3074fc54ce..79a313b20828ef0cd87662e3979f8b28a50ed919 100644 --- a/src/thermophysicalModels/basic/fluidThermo/fluidThermo.H +++ b/src/thermophysicalModels/basic/fluidThermo/fluidThermo.H @@ -105,6 +105,7 @@ public: //- Add the given density correction to the density field. // Used to update the density field following pressure solution + // Limit thermo rho between rhoMin and rhoMax virtual void correctRho ( const volScalarField& deltaRho, @@ -112,6 +113,14 @@ public: const dimensionedScalar& rhoMax ) = 0; + + //- Add the given density correction to the density field. + // Used to update the density field following pressure solution + virtual void correctRho + ( + const volScalarField& deltaRho + ) = 0; + //- Compressibility [s^2/m^2] virtual const volScalarField& psi() const = 0; diff --git a/src/thermophysicalModels/basic/psiThermo/psiThermo.C b/src/thermophysicalModels/basic/psiThermo/psiThermo.C index b3e65677d9fc1349f2119c4cca888728000df4ff..3dafd068a13dc564c294d92d155602bff355c2ec 100644 --- a/src/thermophysicalModels/basic/psiThermo/psiThermo.C +++ b/src/thermophysicalModels/basic/psiThermo/psiThermo.C @@ -110,6 +110,12 @@ void Foam::psiThermo::correctRho ) {} +void Foam::psiThermo::correctRho +( + const Foam::volScalarField& deltaRho +) +{} + const Foam::volScalarField& Foam::psiThermo::psi() const { return psi_; diff --git a/src/thermophysicalModels/basic/psiThermo/psiThermo.H b/src/thermophysicalModels/basic/psiThermo/psiThermo.H index b2e05a9e9e0a805e67bbd233c9e1bc92c32710d6..5b24276e0ea735281da5ad4d75a343bf67e05a5c 100644 --- a/src/thermophysicalModels/basic/psiThermo/psiThermo.H +++ b/src/thermophysicalModels/basic/psiThermo/psiThermo.H @@ -125,6 +125,13 @@ public: const dimensionedScalar& rhoMax ); + //- Add the given density correction to the density field. + // Used to update the density field following pressure solution + virtual void correctRho + ( + const volScalarField& deltaRho + ); + //- Density [kg/m^3] - uses current value of pressure virtual tmp<volScalarField> rho() const; diff --git a/src/thermophysicalModels/basic/rhoThermo/rhoThermo.C b/src/thermophysicalModels/basic/rhoThermo/rhoThermo.C index bbc1a64ba5770c5dcae9e9bbdd613d7088216a74..e7b70a4fc920f0f00b56992dd74618bfeb8d1e3e 100644 --- a/src/thermophysicalModels/basic/rhoThermo/rhoThermo.C +++ b/src/thermophysicalModels/basic/rhoThermo/rhoThermo.C @@ -185,6 +185,12 @@ void Foam::rhoThermo::correctRho rho_ = min(rho_, rhoMax); } +void Foam::rhoThermo::correctRho(const Foam::volScalarField& deltaRho) +{ + rho_ += deltaRho; +} + + const Foam::volScalarField& Foam::rhoThermo::psi() const { return psi_; diff --git a/src/thermophysicalModels/basic/rhoThermo/rhoThermo.H b/src/thermophysicalModels/basic/rhoThermo/rhoThermo.H index fd8bb6b81c5d43ae98394248ee1dd73358335dfb..2728cf02e74e1ffba593f643128daf6fcfab764a 100644 --- a/src/thermophysicalModels/basic/rhoThermo/rhoThermo.H +++ b/src/thermophysicalModels/basic/rhoThermo/rhoThermo.H @@ -146,6 +146,10 @@ public: const dimensionedScalar& rhoMax ); + //- Add the given density correction to the density field. + // Used to update the density field following pressure solution + virtual void correctRho(const volScalarField& deltaRho); + //- Compressibility [s^2/m^2] virtual const volScalarField& psi() const;