VasiliBaranov / packing-generation

Hard-sphere packing generation in C++ with the Lubachevsky–Stillinger, Jodrey–Tory, and force-biased algorithms and packing post-processing.
MIT License
106 stars 43 forks source link

Binder Jetting Powder Bed #15

Open Paolo92 opened 4 years ago

Paolo92 commented 4 years ago

Good afternoon Mr. Vasili,

I'm a Master Degree Student from Politecnico di Milano and I'm working on my degree thesis which is about Additive Manufacturing and in particular Binder Jetting 3D Printing.

To this purpose, I'm writing to you in order to understand if your code could be capable to predict the powder bed density and the so called "avarage coordination number" (intended as the averege number of contacts between a single particle of powder (sphere) and the surrounding particles) on the basis of a known powder size distribution (PSD).

My aim is to define an optimal PSD in order to achieve good mechanical properties of the printed green part and of the sintered final part.

Thank you for your attention.

Best Regards,

Paolo

VasiliBaranov commented 4 years ago

Hi Paolo,

yes, the code is able to generate packings of arbitrary polydispersity. If you finish packing generation with the option -lsgd (or just generate them with a very low compression rate with option -ls), they will be mechanically stable for friction = 0. Depending on the compression rate, the final density will be from the lower to the upper boundary of the Random Close Packing limit, see https://pubs.rsc.org/en/content/articlehtml/2014/sm/c3sm52959b

One can get the contact number distribution with the option -connumdist (not mentioned in https://github.com/VasiliBaranov/packing-generation#3-post-processing, but available in the code). Please read this section before using this option: https://github.com/VasiliBaranov/packing-generation#21-note-on-final-diameters

BUT. The average coordination number for mechanically stable frictionless packings is always six due to the isostaticity condition (in general, it shall be z=2*dimensionality). Please see Section 4 here https://arxiv.org/pdf/0808.2196.pdf or Appendix A here https://arxiv.org/pdf/1602.04369.pdf.

To get the average coordination number different from six for mechanically stable packings one needs to add friction to simulations. Please see the paper A phase diagram for jammed matter for a general overview.

Adding friction shall be done by another program (after an initial packing is generated by my or equivalent program; this packing shall not even be mechanically stable in any sense, just some configuration with sufficiently high density). Please see the Appendix I here https://arxiv.org/pdf/1001.5287.pdf. The program that they use to simulate friction can be found here: https://hmakse.ccny.cuny.edu/software-and-data/ . Search for "Research on the phase diagram for jammed matter" on the page, in this section follow the links "Algorithm and simple instructions", http://www-levich.engr.ccny.cuny.edu/~hmakse/GRANULAR/trubal.zip and "the instruction manual" http://www-levich.engr.ccny.cuny.edu/~hmakse/GRANULAR/trubal-instructions.pdf

Hope this helps!

Best Regards, Vasili

Paolo92 commented 4 years ago

Dear Mr. Vasili,

Thank you for your comprehensive answer. It will be very useful.

Best Regards, Paolo

Paolo92 commented 4 years ago

Dear Mr. Vasili,

I tried to run the code with Visual Studio but it returns me several errors (which are in particular the C2373 and the C2447).

image

Could it be related to the issue "makefile/Cygwin" explained in "2.2. Direct makefile compiling and linking"? Because if it is, I Honestly don't understand what to do.

Thank you for answering my questions.

Paolo

VasiliBaranov commented 4 years ago

Dear Paolo,

if you are compiling on Windows with Visual Studio, then makefile/Cygwin issues shall not have any effect.

First, you can download a compiled executable for windows: https://github.com/VasiliBaranov/packing-generation/releases/tag/v1.0.1.28 and just use it.

Also, you can try to unload the Tests project before compiling.

Also, I tested compilation recently with Visual Studio 2017, and it worked fine (and the project shall definitely work with Visual Studio 2010). Maybe the difference comes from the new version of the compiler and standard library (every VS has a new version and sometimes the standard library uses slightly different default macros or file locations). What you can try is to go to Visual Studio Installer -> Modify -> Individual Components -> select smth like Visual Studio 2017 or C++ Toolchain 15 (15 is the version of the tools for 2017). You will probably have to open the original project from the git again, so that VS suggests you to convert it either to 2019 or to 2017. And then you can try to compile it. I think it shall work. In the worst case, you can install the 2010 toolchain (version 14) and reopen the project from git. It shall work for sure.

Hope this helps.

Best Regards, Vasili

Paolo92 commented 4 years ago

Dear Vasili,

First of all thank you for your explanations. Now the program is working.

I have some more question:

I'm trying to create a packing of N (i.e. 100) spheres with predefined random diameters (i.e. : 1.61, 2.34, 3.87, 1.81, 0.85, 1.99, ....) generated according to a known gaussian distribution. To this purpose, I added a diameters.txt file with the desired 100 diameter values (one per line). Is there a way to know a priori how to choose the minimum dimensions of the box in order to evaluate the maximum density (minimum porosity) related to the packing and make the algorithm go to convergence or the only way is to make several attempts changing the box dimensions and the contraction rate?

Best regards

Paolo

Il giorno mar 19 nov 2019 alle ore 01:11 VasiliBaranov < notifications@github.com> ha scritto:

Dear Paolo,

if you are compiling on Windows with Visual Studio, then makefile/Cygwin issues shall not have any effect.

First, you can download a compiled executable for windows: https://github.com/VasiliBaranov/packing-generation/releases/tag/v1.0.1.28 and just use it.

Also, you can try to unload the Tests project before compiling.

Also, I tested compilation recently with Visual Studio 2017, and it worked fine (and the project shall definitely work with Visual Studio 2010). Maybe the difference comes from the new version of the compiler and standard library (every VS has a new version and sometimes the standard library uses slightly different default macros or file locations). What you can try is to go to Visual Studio Installer -> Modify -> Individual Components -> select smth like Visual Studio 2017 or C++ Toolchain 15 (15 is the version of the tools for 2017). You will probably have to open the original project from the git again, so that VS suggests you to convert it either to 2019 or to 2017. And then you can try to compile it. I think it shall work. In the worst case, you can install the 2010 toolchain (version 14) and reopen the project from git. It shall work for sure.

Hope this helps.

Best Regards, Vasili

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/VasiliBaranov/packing-generation/issues/15?email_source=notifications&email_token=ANWIHE4XYIZ4WLSAUVTAPE3QUMVMXA5CNFSM4JJUSX6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEML5TY#issuecomment-555269839, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANWIHE2UOHSMRFY4Q7JMJZ3QUMVMXANCNFSM4JJUSX6A .

VasiliBaranov commented 4 years ago

Hi Paolo,

for the LS algorithm, you do not even need this estimation. Particles will be scaled proportionally to their initial radii during the simulation and their final diameter will be greater then the initial one. The final density is controlled only by the compression rate. To get the highest possible density, you need to specify a very low compression rate (which is controlled by the time you can realistically spend on packing generation).

For the FB algorithm, the expected final density is another parameter that determines the real final density (along with the compression rate). Here you might indeed have to make several attempts (but see below).

The exact parameters that i used are described here: https://github.com/VasiliBaranov/packing-generation#14-note-on-final-diameters (last paragraph). You can in principle estimate the polydispersity of your system, then go to Fig. 2 https://pubs.rsc.org/en/content/articlehtml/2014/sm/c3sm52959b#imgfig2 and then check the compression rate that has to be used to achieve the desired density. To reach the desired (maximum possible) density with the FBA algorithm, you have specify the expected density that is for sure higher than the real maximum density. You can get the real maximum density from Fig. 2 as well. You can get the expected densities that i used for the FBA algorithm from the formula described here https://github.com/VasiliBaranov/packing-generation#14-note-on-final-diameters (in the last paragraph).

Hope this helps!

Best Regards, Vasili

Paolo92 commented 4 years ago

Dear Vasili,

I'm sorry for bother you again, but I have some theoretical questions and doubts which I couldn't answer by myself by reading your and other papers. Here I'll try to summarize my issues:

1 - The original LS algorithm presented in doi:10.1007/BF01025983 http://dx.doi.org/10.1007/BF01025983 generates N points/particles with linearly growing diameters characterized by initial random positions and velocities. The algorithm basically stops when the spheres occupy the reference volume and no other motions are possible without overlaps. I'd so like to understand which is the logic behind your modified algorithm and the convergence/stop criterion, possibly related to the meaning/role of the input value of the compression/contraction rate.

2 - I'd be grateful if you clarify the role of the input value "seed" (which is 341 in your example here https://github.com/VasiliBaranov/packing-generation and defined as "seed used for any random number generations (e.g. initial positions or particle velocity")) and it's mathematical/physical meaning (the original LS algorithm doesn't mention it), possibly related to the initial conditions.

3 - I'd also like to understand the meaning of "time", growing "reduced pressure" and "actual temperature" iteratively displayed during the execution of PackingGeneration.exe and if they are related to the time step between two subsequent events (collisions/boundary crossing in the original LS algorithm).

4 - Finally, i'd like to know if the "steps to write" input number n has any repercussion on the output or if it is just a way to control the evolution of the system every n steps.

Thank you for your time and for your patience with me.

My best regards,

Paolo

Il giorno mar 26 nov 2019 alle ore 00:02 VasiliBaranov < notifications@github.com> ha scritto:

Hi Paolo,

for the LS algorithm, you do not even need this estimation. Particles will be scaled proportionally to their initial radii during the simulation and their final diameter will be greater then the initial one. The final density is controlled only by the compression rate. To get the highest possible density, you need to specify a very low compression rate (which is controlled by the time you can realistically spend on packing generation).

For the FB algorithm, the expected final density is another parameter that determines the real final density (along with the compression rate). Here you might indeed have to make several attempts (but see below).

The exact parameters that i used are described here: https://github.com/VasiliBaranov/packing-generation#14-note-on-final-diameters (last paragraph). You can in principle estimate the polydispersity of your system, then go to Fig. 2 https://pubs.rsc.org/en/content/articlehtml/2014/sm/c3sm52959b#imgfig2 and then check the compression rate that has to be used to achieve the desired density. To reach the desired (maximum possible) density with the FBA algorithm, you have specify the expected density that is for sure higher than the real maximum density. You can get the real maximum density from Fig. 2 as well. You can get the expected densities that i used for the FBA algorithm from the formula described here https://github.com/VasiliBaranov/packing-generation#14-note-on-final-diameters (in the last paragraph).

Hope this helps!

Best Regards, Vasili

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/VasiliBaranov/packing-generation/issues/15?email_source=notifications&email_token=ANWIHEZNPQAQIMXUJSZYGKDQVRKRVA5CNFSM4JJUSX6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFEDIQI#issuecomment-558380097, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANWIHE6YWHZD3GS2TEZLEMTQVRKRVANCNFSM4JJUSX6A .

VasiliBaranov commented 4 years ago

Dear Paolo,

no problem, i'm happy to help as much as i can.

  1. Please see, for example, this paper: https://arxiv.org/pdf/cond-mat/0608362.pdf (one co-author, Stillinger, is the author of the original algorithm). A pretty cool guy actually: https://en.wikipedia.org/wiki/Frank_Stillinger Anyway, please see Fig. 4 there. They stop simulation at reduced pressure Z=10^12. They explain the logic pretty well in this paper: high reduced pressure means that spheres are colliding very very often, which means that they are very close and the system is almost jammed. One can estimated the difference between the expected jamming density and the current density by this pressure (see Eqs. 3 and 4 in this paper), they are derived in a very old paper https://aip.scitation.org/doi/abs/10.1063/1.1733163 . Please note that these equations are valid when the compression rate is small (explained in the paper of Stillinger as well).

  2. Seed is just the value used to start random number generation. See e.g. http://www.cplusplus.com/reference/cstdlib/srand/ Random numbers are used to place particles and set their velocities. If you use the same seed, the algorithm will start and proceed every time in exactly the same way (for the same starting radii).

  3. Time is some internal simulation time (in simulation units of measurement), a.u. (arbitrary units). In this algorithm, particles grow and fly, like atoms or molecules, so temperature and pressure have usual meaning of the kinetic theory of gases. Temperature = m <v^2> / 2. Masses of all particles are set to unity. Reduced pressure is Z = p V/ N k T. Pressure P is measured by the momentum exchange between particles (when they collide), i can check for the exact equation. V is the volume of the box where particles are, k is the Boltzmann constant which in these units is set to unity. Z is very convenient, because it is dimensionless and does not depend on the units of measurements (k is present in p and cancels out, unit of time is present in p and and T and also cancels out). For the ideal gas, Z=1, for hard spheres Z is higher and possibly infinite. Temperature is set to 0.2 (this is basically how velocities relate to the compression factor you specify). Velocities are sampled from the Maxwell-Boltzmann distribution (equilibrium distribution).

  4. "steps to write" is how often an intermediate simulation result is written as packing.xyzd, so that you can restart the simulation if anything breaks. How often==how many collision events pass.

Hope this helps!

Wishing you a merry Christmas and a happy New Year!

Best Regards, Vasili

Paolo92 commented 4 years ago

Dear Vasili,

thank you for your your precious time. I wish you a merry Christmas and a happy new year too.

My best regards,

Paolo

Il giorno mer 25 dic 2019 alle ore 17:32 VasiliBaranov < notifications@github.com> ha scritto:

Dear Paolo,

no problem, i'm happy to help as much as i can.

1.

Please see, for example, this paper: https://arxiv.org/pdf/cond-mat/0608362.pdf (one co-author, Stillinger, is the author of the original algorithm). A pretty cool guy actually: https://en.wikipedia.org/wiki/Frank_Stillinger Anyway, please see Fig. 4 there. They stop simulation at reduced pressure Z=10^12. They explain the logic pretty well in this paper: high reduced pressure means that spheres are colliding very very often, which means that they are very close and the system is almost jammed. One can estimated the difference between the expected jamming density and the current density by this pressure (see Eqs. 3 and 4 in this paper), they are derived in a very old paper https://aip.scitation.org/doi/abs/10.1063/1.1733163 . Please note that these equations are valid when the compression rate is small (explained in the paper of Stillinger as well). 2.

Seed is just the value used to start random number generation. See e.g. http://www.cplusplus.com/reference/cstdlib/srand/ Random numbers are used to place particles and set their velocities. If you use the same seed, the algorithm will start and proceed every time in exactly the same way (for the same starting radii). 3.

Time is some internal simulation time (in simulation units of measurement), a.u. (arbitrary units). In this algorithm, particles grow and fly, like atoms or molecules, so temperature and pressure have usual meaning of the kinetic theory of gases. Temperature = m <v^2> / 2. Masses of all particles are set to unity. Reduced pressure is Z = p V/ N k T. Pressure P is measured by the momentum exchange between particles (when they collide), i can check for the exact equation. V is the volume of the box where particles are, k is the Boltzmann constant which in these units is set to unity. Z is very convenient, because it is dimensionless and does not depend on the units of measurements (k is present in p and cancels out, unit of time is present in p and and T and also cancels out). For the ideal gas, Z=1, for hard spheres Z is higher and possibly infinite. Temperature is set to 0.2 (this is basically how velocities relate to the compression factor you specify). Velocities are sampled from the Maxwell-Boltzmann distribution (equilibrium distribution). 4.

"steps to write" is how often an intermediate simulation result is written as packing.xyzd, so that you can restart the simulation if anything breaks. How often==how many collision events pass.

Hope this helps!

Wishing you a merry Christmas and a happy New Year!

Best Regards, Vasili

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/VasiliBaranov/packing-generation/issues/15?email_source=notifications&email_token=ANWIHE67JPGFYYYYK2LHCXDQ2ODJJA5CNFSM4JJUSX6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHUPC4I#issuecomment-568914289, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANWIHEYGKRWX2LDJ4N4MFILQ2ODJJANCNFSM4JJUSX6A .