mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Adding correctRho plus rhoMin and rhoMax limiters to thermos.
Update pEq for close domains.
This commit is contained in:
@ -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);
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -84,8 +84,8 @@
|
||||
{
|
||||
p += (initialMass - fvc::domainIntegrate(psi*p))
|
||||
/compressibility;
|
||||
p_rgh = p - rho*gh;
|
||||
}
|
||||
p_rgh = p - rho*gh;
|
||||
}
|
||||
|
||||
rho = thermo.rho();
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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_;
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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_;
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user