The diameter of the particles is log-normally distributed, spanning 0.1mm-1.2mm. My bed is 0.3m high, but as soon as I set a higher volume fraction it gets an error and sets the initial quality as well. But with a lower volume fraction, the stack height is very low.What should I do to increase the height of the stack?
Please attach your input files if you want help
bed0.5.zip (4.4 MB)
I need to stack the particles at this size to a height of 0.06. but they don’t stack to 0.06 no matter what!
Try unsetting “Minimum fluid volume fraction” (DES_EPG_CLIP
) which defaults to 0.42 (or set it to a lower value)
Also note that you have defined a particle size distribution but you are not using it - the definition is here, in the DEM pane:
but you must select it in the IC pane:
I noticed this because I set up monitors for max & min particle size and this showed me that the particles were all the same size:
I also suggest decreasing the VTK write interval - if you only write a frame once per second you’re not going to see much activity. I set it to 0.001.
Thanks for your reply. I’ve eliminated the minimum fluid volume fraction and used the particle size distribution as well. But I wanted to achieve a height of 0.06m after the particles were in free fall. I estimated the mass to be 0.006, but when I enter a mass of 0.006 or a volume fraction of 0.8, I get an error
I = 16 J = 114 K = 2 EP_GValue: 0.98765432100E+32
I = 17 J = 114 K = 2 EP_GValue: 0.98765432100E+32
I = 18 J = 114 K = 2 EP_GValue: 0.98765432100E+32
I = 19 J = 114 K = 2 EP_GValue: 0.98765432100E+32
I = 2 J = 115 K = 2 EP_GValue: 0.98765432100E+32
I = 3 J = 115 K = 2 EP_GValue: 0.98765432100E+32
I = 4 J = 115 K = 2 EP_GValue: 0.98765432100E+32
I = 5 J = 115 K = 2 EP_GValue: 0.98765432100E+32
I = 6 J = 115 K = 2 EP_GValue: 0.98765432100E+32
I = 7 J = 115 K = 2 EP_GValue: 0.98765432100E+32
I = 8 J = 115 K = 2 EP_GValue: 0.98765432100E+32
I = 9 J = 115 K = 2 EP_GValue: 0.98765432100E+32
I = 10 J = 115 K = 2 EP_GValue: 0.98765432100E+32
I = 11 J = 115 K = 2 EP_GValue: 0.98765432100E+32
I = 12 J = 115 K = 2 EP_GValue: 0.98765432100E+32
I = 13 J = 115 K = 2 EP_GValue: 0.98765432100E+32
I = 14 J = 115 K = 2 EP_GValue: 0.98765432100E+32
I = 15 J = 115 K = 2 EP_GValue: 0.98765432100E+32
I = 16 J = 115 K = 2 EP_GValue: 0.98765432100E+32
I = 17 J = 115 K = 2 EP_GValue: 0.98765432100E+32
I = 18 J = 115 K = 2 EP_GValue: 0.98765432100E+32
I = 19 J = 115 K = 2 EP_GValue: 0.98765432100E+32
I = 2 J = 116 K = 2 EP_GValue: 0.98765432100E+32
I = 3 J = 116 K = 2 EP_GValue: 0.98765432100E+32
I = 4 J = 116 K = 2 EP_GValue: 0.98765432100E+32
I = 5 J = 116 K = 2 EP_GValue: 0.98765432100E+32
I = 6 J = 116 K = 2 EP_GValue: 0.98765432100E+32
I = 7 J = 116 K = 2 EP_GValue: 0.98765432100E+32
I = 8 J = 116 K = 2 EP_GValue: 0.98765432100E+32
I = 9 J = 116 K = 2 EP_GValue: 0.98765432100E+32
I = 10 J = 116 K = 2 EP_GValue: 0.98765432100E+32
I = 11 J = 116 K = 2 EP_GValue: 0.98765432100E+32
I = 12 J = 116 K = 2 EP_GValue: 0.98765432100E+32
I = 13 J = 116 K = 2 EP_GValue: 0.98765432100E+32
I = 14 J = 116 K = 2 EP_GValue: 0.98765432100E+32
I = 15 J = 116 K = 2 EP_GValue: 0.98765432100E+32
I = 16 J = 116 K = 2 EP_GValue: 0.98765432100E+32
I = 17 J = 116 K = 2 EP_GValue: 0.98765432100E+32
I = 18 J = 116 K = 2 EP_GValue: 0.98765432100E+32
I = 19 J = 116 K = 2 EP_GValue: 0.98765432100E+32
I = 2 J = 117 K = 2 EP_GValue: 0.98765432100E+32
I = 3 J = 117 K = 2 EP_GValue: 0.98765432100E+32
I = 4 J = 117 K = 2 EP_GValue: 0.98765432100E+32
I = 5 J = 117 K = 2 EP_GValue: 0.98765432100E+32
I = 6 J = 117 K = 2 EP_GValue: 0.98765432100E+32
I = 7 J = 117 K = 2 EP_GValue: 0.98765432100E+32
I = 8 J = 117 K = 2 EP_GValue: 0.98765432100E+32
I = 9 J = 117 K = 2 EP_GValue: 0.98765432100E+32
I = 10 J = 117 K = 2 EP_GValue: 0.98765432100E+32
I = 11 J = 117 K = 2 EP_GValue: 0.98765432100E+32
I = 12 J = 117 K = 2 EP_GValue: 0.98765432100E+32
I = 13 J = 117 K = 2 EP_GValue: 0.98765432100E+32
I = 14 J = 117 K = 2 EP_GValue: 0.98765432100E+32
I = 15 J = 117 K = 2 EP_GValue: 0.98765432100E+32
I = 16 J = 117 K = 2 EP_GValue: 0.98765432100E+32
I = 17 J = 117 K = 2 EP_GValue: 0.98765432100E+32
I = 18 J = 117 K = 2 EP_GValue: 0.98765432100E+32
I = 19 J = 117 K = 2 EP_GValue: 0.98765432100E+32
I = 2 J = 118 K = 2 EP_GValue: 0.98765432100E+32
I = 3 J = 118 K = 2 EP_GValue: 0.98765432100E+32
I = 4 J = 118 K = 2 EP_GValue: 0.98765432100E+32
I = 5 J = 118 K = 2 EP_GValue: 0.98765432100E+32
I = 6 J = 118 K = 2 EP_GValue: 0.98765432100E+32
I = 7 J = 118 K = 2 EP_GValue: 0.98765432100E+32
I = 8 J = 118 K = 2 EP_GValue: 0.98765432100E+32
I = 9 J = 118 K = 2 EP_GValue: 0.98765432100E+32
I = 10 J = 118 K = 2 EP_GValue: 0.98765432100E+32
I = 11 J = 118 K = 2 EP_GValue: 0.98765432100E+32
I = 12 J = 118 K = 2 EP_GValue: 0.98765432100E+32
I = 13 J = 118 K = 2 EP_GValue: 0.98765432100E+32
I = 14 J = 118 K = 2 EP_GValue: 0.98765432100E+32
I = 15 J = 118 K = 2 EP_GValue: 0.98765432100E+32
I = 16 J = 118 K = 2 EP_GValue: 0.98765432100E+32
I = 17 J = 118 K = 2 EP_GValue: 0.98765432100E+32
I = 18 J = 118 K = 2 EP_GValue: 0.98765432100E+32
I = 19 J = 118 K = 2 EP_GValue: 0.98765432100E+32
I = 2 J = 119 K = 2 EP_GValue: 0.98765432100E+32
I = 3 J = 119 K = 2 EP_GValue: 0.98765432100E+32
I = 4 J = 119 K = 2 EP_GValue: 0.98765432100E+32
I = 5 J = 119 K = 2 EP_GValue: 0.98765432100E+32
I = 6 J = 119 K = 2 EP_GValue: 0.98765432100E+32
I = 7 J = 119 K = 2 EP_GValue: 0.98765432100E+32
I = 8 J = 119 K = 2 EP_GValue: 0.98765432100E+32
I = 9 J = 119 K = 2 EP_GValue: 0.98765432100E+32
I = 10 J = 119 K = 2 EP_GValue: 0.98765432100E+32
I = 11 J = 119 K = 2 EP_GValue: 0.98765432100E+32
I = 12 J = 119 K = 2 EP_GValue: 0.98765432100E+32
I = 13 J = 119 K = 2 EP_GValue: 0.98765432100E+32
I = 14 J = 119 K = 2 EP_GValue: 0.98765432100E+32
I = 15 J = 119 K = 2 EP_GValue: 0.98765432100E+32
I = 16 J = 119 K = 2 EP_GValue: 0.98765432100E+32
I = 17 J = 119 K = 2 EP_GValue: 0.98765432100E+32
I = 18 J = 119 K = 2 EP_GValue: 0.98765432100E+32
I = 19 J = 119 K = 2 EP_GValue: 0.98765432100E+32
I = 2 J = 120 K = 2 EP_GValue: 0.98765432100E+32
I = 3 J = 120 K = 2 EP_GValue: 0.98765432100E+32
I = 4 J = 120 K = 2 EP_GValue: 0.98765432100E+32
I = 5 J = 120 K = 2 EP_GValue: 0.98765432100E+32
I = 6 J = 120 K = 2 EP_GValue: 0.98765432100E+32
I = 7 J = 120 K = 2 EP_GValue: 0.98765432100E+32
I = 8 J = 120 K = 2 EP_GValue: 0.98765432100E+32
I = 9 J = 120 K = 2 EP_GValue: 0.98765432100E+32
I = 10 J = 120 K = 2 EP_GValue: 0.98765432100E+32
I = 11 J = 120 K = 2 EP_GValue: 0.98765432100E+32
I = 12 J = 120 K = 2 EP_GValue: 0.98765432100E+32
I = 13 J = 120 K = 2 EP_GValue: 0.98765432100E+32
I = 14 J = 120 K = 2 EP_GValue: 0.98765432100E+32
I = 15 J = 120 K = 2 EP_GValue: 0.98765432100E+32
I = 16 J = 120 K = 2 EP_GValue: 0.98765432100E+32
I = 17 J = 120 K = 2 EP_GValue: 0.98765432100E+32
I = 18 J = 120 K = 2 EP_GValue: 0.98765432100E+32
I = 19 J = 120 K = 2 EP_GValue: 0.98765432100E+32
I = 2 J = 121 K = 2 EP_GValue: 0.98765432100E+32
I = 3 J = 121 K = 2 EP_GValue: 0.98765432100E+32
I = 4 J = 121 K = 2 EP_GValue: 0.98765432100E+32
I = 5 J = 121 K = 2 EP_GValue: 0.98765432100E+32
I = 6 J = 121 K = 2 EP_GValue: 0.98765432100E+32
I = 7 J = 121 K = 2 EP_GValue: 0.98765432100E+32
I = 8 J = 121 K = 2 EP_GValue: 0.98765432100E+32
I = 9 J = 121 K = 2 EP_GValue: 0.98765432100E+32
I = 10 J = 121 K = 2 EP_GValue: 0.98765432100E+32
I = 11 J = 121 K = 2 EP_GValue: 0.98765432100E+32
I = 12 J = 121 K = 2 EP_GValue: 0.98765432100E+32
I = 13 J = 121 K = 2 EP_GValue: 0.98765432100E+32
I = 14 J = 121 K = 2 EP_GValue: 0.98765432100E+32
I = 15 J = 121 K = 2 EP_GValue: 0.98765432100E+32
I = 16 J = 121 K = 2 EP_GValue: 0.98765432100E+32
I = 17 J = 121 K = 2 EP_GValue: 0.98765432100E+32
I = 18 J = 121 K = 2 EP_GValue: 0.98765432100E+32
I = 19 J = 121 K = 2 EP_GValue: 0.98765432100E+32
Error from check_data_20.f:234
I see several problems here. One is that ugly EP_G
error message, which should be a popup but is too big… second is that Unsuccessful seeding
is being treated as a warning, not a fatal error:
Warning from des/generate_particles_mod.f:698
Initial condition 1, Phase 1: Unsuccessful seeding
this warning is far too easy to miss and should probably terminate the run.
I don’t understand where you are getting the volume fraction of 0.8 from. Your Y-axis goes from 0 to 0.3 m. If you want the particles to stack to a height of 0.06m that is 1/5 of the total height so the volume fraction should be at most 0.2 (less due to space between spheres).
I tried seeding with volume fraction of 0.1.
With a uniform size distribution, it succeeded:
But with the same 0.1 volume fraction and the log-normal size distribution I got a seeding error:
DEM Particle size distribution within initial condition for ICV= 1, M= 1
Type = LOG_NORMAL
Mean = 0.00050000
Standard deviation = 0.00025000
Minimum (clipped) diameter = 0.00010000
Maximum (clipped) diameter = 0.00120000
Converted mu value = -7.71247424
Converted sigma value = 0.47238073
Theoretical statistical values:
Median diameter = 0.00044721
Mode diameter = 0.00035777
Variance = 0.00000006
Skewness = 1.62500000
68.0% distribution range = [ 0.00027884 ; 0.00071724]
95.0% distribution range = [ 0.00017386 ; 0.00115032]
99.7% distribution range = [ 0.00010841 ; 0.00184490]
Message from check_data/check_solids_dem.f:741
At time = 0.000000E+00 sec., setting DEM solids time step, DTSOLID (sec) = 0.477111E-06
Message from check_data/check_geometry.f:191
DES grid size:
DESGRIDSEARCH_IMAX = 18
DESGRIDSEARCH_JMAX = 120
DESGRIDSEARCH_KMAX = 1
DES MPI send/recv buffer: 28.0 MB
o 8192. Ghost particles/MB
o 4228. Particles/MB
o 11916. Neighbor pairs/MB
Preprocessing geometry for DES.
DES geometry preprocessing complete.
MESH STATISTICS:
NUMBER OF CELLS = 2160
NUMBER OF STANDARD CELLS = 2160 (100.00 % of Total)
NUMBER OF CUT CELLS = 0 ( 0.00 % of Total)
NUMBER OF FLUID CELLS = 2160 (100.00 % of Total)
NUMBER OF BLOCKED CELLS = 0 ( 0.00 % of Total)
WROTE BOUNDARY IN VTK FILE : BED_boundary.vtk
PRE_PROCESSING COMPLETE.
Initial DES Particle array size: 4
Message from set_bc0.f:553
No gas phase: IJK_P_g remaining undefined.
Generating initial particle configuration:
Phase 1: Number of particles to seed = 27129
|-------------------------------------------------------------------|
| IC Region: 1 |
|-------------------------------------------------------------------|
| Phase | Input | Input | Number of | EPs | Solid |
| ID | Specified | Value | Particles | | mass |
|-------|-----------|-----------|-----------|-----------|-----------|
| 1 | EP_S | 1.00E-01 | 7946 | 2.93E-02 | 1.36E-03 |
|-------|-----------|-----------|-----------|-----------|-----------|
Warning from des/generate_particles_mod.f:698
Initial condition 1, Phase 1: Unsuccessful seeding
Total number of particles in the system: 7946
We asked for 27129 particles but only got 7946. The simulation probably should not have run. It’s clear that there are not enough particles in this view:
We have to figure out why seeding is failing with the particle size distribution. Something is wrong here. Thanks for the detailed report, we’ll get this sorted out!
– Charles
Yes, it fails when I use particle size distribution. Hope to get your answer soon
When you use a PSD, the seeding lattice is based on the largest diameter, so it is difficult to seed with large volume fraction when the ratio largest/smallest diameter is large. A few alternatives:
- Reduce the max diameter if you can (Plot the PSD to see if it makes sense).
- In the Initial Condition pane, check the “Show DEM seeding options” and set the particle spacing to 0.
- The above will help a bit but probably won’t be sufficient. If your goal is to start with a bed height of 6cm, setup a mass inlet at the top and let particles settle through gravity until you have at least a 6cm bed. In the output pane, make sure you have “Save particle positions at end of run” checked. This will save a “particle_output.dat” file. Check “Filter saved particle data” and filter the data using the y-coordinate with a max y value of 0.06. This will give you a clean bed edge at y=0.06m. Then you can use this file in your production run. It is best to setup a new simulation is a different directory. Rename
particle_output.dat
asparticle_input.dat
in the new project directory. When you setup the production run simulation, uncheck “Unable automatic particle generation” in the Solids> DEM pane so theparticle_input.dat
is used as initial condition.
Thanks Jeff. I guess the particle seeding code is older than the PSD code so it’s not quite as smart as it could be with packing mixed-size particles - it would be nice if it were a bit smarter. If I get some time I’ll work on this but there are a lot of other things I’m working on right now.
The suggestion to let the bed settle from a mass inlet is very good.
Another option would be to generate a particle_input.dat
file, perhaps using a Python script - that would be easier than rewriting the built-in particle seeder.
I modified a seeding script of mine to allow PSD - it wasn’t too hard since Python has numpy.random.lognormal
The attached script is able to easily reach a volume fraction of 0.15 which I believe shold be enough to get the bed height you want. If you increase the fraction to 0.2 it gets very slow as it searches for locations to add the new particles…
Here’s the script - the parameters are hard-coded near the top
psd_seeder.py (4.4 KB)
(Side note: a good chunk of the script is just writing out the fixed 35-line file header … although including the instructions in the file is perhaps a nice concession to users, it’s a bit of a pain when trying to generate particle files and this header MUST be present. I think we should reconsider this design decision - perhaps the instructions can be included as optional #comments
instead of a fixed number of lines at the top of the file - this would make it easier to generate and manipulate these files.)
Awesome, thanks Charles!
Thank you very much, and thank you very much Jeff.I would like to ask you if this program can be generated based on the specified total particle mass.
There is one more thing worth noting. The particles generated in your code are too large to be normally distributed.
Just for fun:
Thank youCharles! Do you mean that this code doesn’t accurately generate a log normal distribution of particles, it only has one problem, which is that there are too many particles in diameter of about 0.0012m
Here’s what the probability distribution looks like (plot courtesy of MFiX):
I encourage you to take a look at the Python script I uploaded - it should be pretty easy to understand
def PSD_diameter():
x = rng.lognormal(mean=µ, sigma=𝜎)
x = min(x, max_diam)
x = max(x, min_diam)
return x
Note that the log-normal distribution extends beyond 0.0012 (max_diam
) and the code above is clipping the range to the interval [min_diam, max_diam]
. This means that the tails outside of this range are going to get added to the last bin of your histogram, causing the pile-up that you see.
Perhaps instead of using this clipping, we should just reject values that are outside the range and take another random number. This is probably what the seeding code in MFiX does (I have not studied it). So change that function to:
def PSD_diameter():
while True:
x = rng.lognormal(mean=µ, sigma=𝜎)
if min_diam <= x <= max_diam:
return x
I believe that should fix up the overabundance of large particles.
If you want to change the criterion from volume fraction to total mass that is also a very easy modification to the script, left as an “exercise for the reader” (I will help you if you get stuck but it’s pretty straightforward.)
– Charles
Thank you very much Charles. In fact, I’ve carefully looked at the file you sent me, and since I’m new to python, so it took you a lot of time to teach, and I think I should have understood how to change the volume fraction to total mass. And, when I use the code you just modified, there are no more problems. Thanks again Charles.
Hello Charles, I have one more question about PSD that I would like to ask you. In MFIX, PSDs are generated based on number, if I want to generate based on volume, how do I achieve this?I just can’t figure it out.