CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   what is the purpose of rhoMin and rhoMax in fvsolution (

mihaipruna June 29, 2012 10:09

what is the purpose of rhoMin and rhoMax in fvsolution
I noticed the simulation aborts if the limits are breached, but why are units specified there as well?
rhoMin rhoMin [1 -3 0 0 0] 0.01;
rhoMax rhoMax [1 -3 0 0 0] 100.0;

wyldckat June 30, 2012 07:12

Hi Mihai,

The units are probably supplied for the sake of completeness, while also making it easier to access when reading the dictionary file.
This way it's not necessary to first read the value to a "scalar" variable and then add dimensions by creating a "dimensionedScalar" based on the first one. These dimensions are necessary for field operations, since the "rho" field has dimensions itself.

Best regards,

mihaipruna July 2, 2012 09:06

I think I understand. Is it because rho is derived?

wyldckat July 2, 2012 09:19



autoPtr<basicPsiThermo> pThermo
    basicPsiThermo& thermo = pThermo();

    volScalarField rho


    dimensionedScalar rhoMax(simple.dict().lookup("rhoMax"));
    dimensionedScalar rhoMin(simple.dict().lookup("rhoMin"));

As you can see, this makes it easier to read from the dictionary file. As for the "rho" field, it's initialized with the "basicPsiThermo" based structure... which I'll leave to you as an exercise:

edit: forgot to mention: rho is used here:

All times are GMT -4. The time now is 08:25.