Set number of bins (NIMBIN) in GUI for automatic PSD

Hi folks,

Could you allow us to define in the Solids panel of the GUI for DEM the value for NIMBIN used for the PSD automatically created (i.e. lognormal and normal):

in generate_particles_mod.f :

NUMBIN = PIC_NUMBIN ! Histogram setting for NORMAL and LOG-NORMAL
! PIC_NUMBIN is set to 100 in mfix_pic_mod.f90
! We could let the user set this.
! There are NUMBIN bins, and (NUMBIN+1) control points.
! Bin I is bounded by control points I and (I+1).
! Control point 1 correspond to PSD_MIN_DP (minimum diameter).
! Control point (NUMBIN+1) correspond to PSD_MAX_DP (maximum diameter).
! MEDIAN_DIAM(I) the diameter at the center of bin I.

Thanks!

I don’t think that variable is doing what you think it does.
For one it has PIC in the name, for another thing it is in

SUBROUTINE POLYPIC_GPCP_MPPIC_CONST_STATWT

which is nt the general PSD particle generator. You need to look in des_psd_mod.f

If you have time to add binning to this module, I’ll add a control to the GUI. Otherwise we’ll add this to the list of suggestions, but I’m not sure when we’ll get to it!

psd_test.f90 (3.9 KB)
there you go, i attached the function and a comparison. gfortran -std=f2008 psd_test.f90 -o psd_test and run with ./psd_test


psd_comparison_both.csv (48.5 MB)
plot_psd.py (992 Bytes)

here is the better fortran version that hopefully compiles @jeff.dietiker
psd_binning.f90 (5.5 KB)

Thanks Eric. I’ll try to get this added to the next release (25.2, in June or July). In the meanwhile I’ll give you directions on how to patch your MFiX, once I get the controls added.

1 Like