How to use random uniform mass for particletemplate/sphere

richti83's picture
Submitted by richti83 on Wed, 01/27/2016 - 10:40

In the manual:

radius values = random_style param1 (param2)
random_style = 'constant' or 'uniform number' or 'uniform mass' or 'gaussian number'

If I understand it right one can specify a low and high radius value and the pts interpolates uniform by mass. This would excactly what I need for my sieving analysis. But the codes stops with:
"ERROR: mass distribution not implemented for uniform (c:\liggghts3-bonds\liggghts-with-bonds\src\probability_distribution.h:170)"

Input deck:

#particle templates
fix pts1 all particletemplate/sphere 4711 atom_type 1 density constant ${dens} radius uniform mass 0.045 0.05
fix pts2 all particletemplate/sphere 4711 atom_type 1 density constant ${dens} radius uniform mass 0.0375 0.045
fix pts3 all particletemplate/sphere 4711 atom_type 1 density constant ${dens} radius uniform mass 0.0315 0.0375
fix pts4 all particletemplate/sphere 4711 atom_type 1 density constant ${dens} radius uniform mass 0.025 0.0315
fix pts5 all particletemplate/sphere 4711 atom_type 1 density constant ${dens} radius uniform mass 0.019 0.025
fix pts6 all particletemplate/sphere 4711 atom_type 1 density constant ${dens} radius uniform mass 0.016 0.019
fix pts7 all particletemplate/sphere 4711 atom_type 1 density constant ${dens} radius uniform mass 0.0132 0.016
fix pts8 all particletemplate/sphere 4711 atom_type 1 density constant ${dens} radius uniform mass 0.0112 0.0132
fix pts9 all particletemplate/sphere 4711 atom_type 1 density constant ${dens} radius uniform mass 0.008 0.0112
fix pts10 all particletemplate/sphere 4711 atom_type 1 density constant ${dens} radius uniform mass 0.0056 0.008
#
#pdd's
fix pdd1 all particledistribution/discrete/massbased 1. 10 pts1 0.112 pts2 0.186 pts3 0.098 pts4 0.104 pts5 0.106 pts6 0.076 pts7 0.067 pts8 0.063 pts9 0.112 pts10 0.076
#
#inserts
fix ins1 all insert/stream seed 100001 distributiontemplate pdd1 vel constant 0. 0 -1 overlapcheck yes all_in yes mass 10 massrate 10 verbose no insertion_face ins_mesh extrude_length $L

How can one specify a random distribution without discretize it in 100 templates ?

Thanks,
Christian.

NTT1508 | Fri, 01/29/2016 - 06:32

This is an interesting issue. I am not sure I understand the mechanism of mass-based distribution correctly. For example in your case, pts1 with mass 0.112, it then randomly select a uniform radius within the defined range (0.045-0.05). If the "Constant" for radius is used, there should be no the same error. Is this a bug ?

In fact, I cannot see any relation between the mass defined in the "Particle_distribution" and the Radius selected randomly in the "Particle_Template". A random radius can be selected within the defined range without considering the mass input after that because there is no predefined number of particles.

For 100 templates, I think the command can be made on a spread sheet and used as an external file with 100 rows. Or can we use variable for this?

richti83's picture

richti83 | Tue, 02/02/2016 - 18:04


For 100 templates, I think the command can be made on a spread sheet and used as an external file with 100 rows. Or can we use variable for this?

Indeed this is the way I'm doing it, but for what is the random uniform mass function good for ?

I'm not an associate of DCS GmbH and not a core developer of LIGGGHTS®
ResearchGate | Contact

limone | Thu, 10/12/2017 - 15:03

Hi,

Would you be so kind to give me an example of external spread sheet (probably a .txt file) and indicate me how to insert the spread sheet inside "in.liggghts_init" (input command file for DEM) ?

At the moment I have this:

fix pts1 all particletemplate/sphere 15485863 atom_type 1 density constant 2000 radius constant 0.0005
fix pdd1 all particledistribution/discrete 15485867 1 pts1 1.0

And I would like to have a (discrete) gaussian distribution for the particles radius. It is not clear the documentation. Also, I cannot find the documentation exactly for "gaussian distribution" for the particle size distribution.

Best,
Limone

ckloss's picture

ckloss | Mon, 02/08/2016 - 14:42

Hi Christian and NTT1508 ,

"gaussian" was introduced as a placeholder some time ago, but was never implemented as it would have a much lower computational efficiency / complication of the insertion algorithms. So what we typically do is to approximate gaussians by discrete distrubutions.

I'll remove the doc entry for the next release

Best wishes
Christoph

thofer | Tue, 08/30/2016 - 16:33

Hi Christian,
The uniform mass distribution is not hard to implement. You just have to write the right return values of some functions in probability_distribution.h. The functions are for the random value, the expectancy and the cubic expectancy. If we call a the minimum radius and b the maximum radius, then the random value is (a+rand*(b^3-a^3))^(1/3), the expectation is 0.75*(b^4-a^4)/(b^3-a^3), and the cubic expectation is 0.5*(a^3+b^3). At least, I hope that's right. Please let me know if you think it's wrong.
Best regards,
Thomas