Skip to content

Rosin Rammler Distribution Mean Value Calculation

Summary

The meanValue() function of the RosinRammler distribution model results in a floating point exception or nan returns.

Steps to reproduce

Call meanValue() on a RosinRammler distribution model.

Example case

This can easily be tested with following code:

#include "fvCFD.H"                 // include basic openFoam classes
#include <set>
#include "RosinRammler.H"

int main(int argc, char *argv[])   // start main loop
{
    Random   rndGen;
    IStringStream is
    (
        "minValue     10E-06;\n"
        "maxValue     20E-06;\n"
        "lambda    1.699E-05;\n"
        "n            8;\n"
    );
    dictionary dict(is);

    distributionModels::RosinRammler distribution(dict,rndGen);
    Info << "Sample: "<<distribution.sample() << endl;
    Info << distribution.meanValue() << endl;
    return 0;
}

What is the current bug behaviour?

The meanValue() function returns nan.

What is the expected correct behavior?

Should return the theoretical mean of the distribution.

Relevant logs and/or images

Environment information

  • OpenFOAM version : v2406
  • Operating system : ubuntu
  • Hardware info : AMD CPU
  • Compiler : g++ 11.4.0 GNU compiler