Adding correctRho plus rhoMin and rhoMax limiters to thermos.

Update pEq for close domains.
This commit is contained in:
sergio
2017-06-07 12:11:01 +01:00
parent d1b651533f
commit c44322ebb8
11 changed files with 36 additions and 13 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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
{

View File

@ -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();

View File

@ -84,8 +84,8 @@
{
p += (initialMass - fvc::domainIntegrate(psi*p))
/compressibility;
p_rgh = p - rho*gh;
}
p_rgh = p - rho*gh;
}
rho = thermo.rho();

View File

@ -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
{

View File

@ -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;

View File

@ -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_;

View File

@ -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;

View File

@ -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_;

View File

@ -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;