clump packing in 2D

Asked by ceguo

Hi,

I want to run 2d simulations using clumps. I tried makeClumpCloud with 0 size in one dimension as what we could do in makeCloud. Unfortunately, it doesn't work. I guess some modification should be added to make the function work in 2D cases. Could anyone tell me how to modify the code?

More ideally, I hope I can save the clumps packing and ymport it for later use. But now SpherePack cannot be saved for clumps. How to overcome this problem?

Thanks in advance.

Ning

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jérôme Duriez (jduriez) said :
#1

Hello Ning,

> I guess some modification should be added to make the function work in 2D cases. Could anyone tell me how to modify the code?

Did you have in mind to use Yade with circles instead of spheres ? If yes, I'm afraid you will have a lot to modify in the code.. A solution could be to use classical spheres samples, with all centers of spheres lying in the same plane (=> surely some modifications in the code), and appropriate degrees of freedom blocked.

Revision history for this message
Luc Scholtès (luc) said :
#2

Hi Ning,

as Jerome said, you have to consider that yade deals with spheres and not circles. If you want to create a "2D sample", you have to define the third dimension of the make cloud fonction approximately equal to the maximum radius of your spheres (make cloud generates assembly in a box if I remember well). I am pretty sure this works for spheres. Not sure for clumps though... Moreover, as Jerome precised, you will then have to block some of the DOFs of the elements to actually force the model to be 2D:

for o in O.bodies:
 body.state.blockedDOFs='zXY'

should work assuming that you choose (x,y) as the 2D domain.

Revision history for this message
ceguo (hhh-guo) said :
#3

Thanks Jerome and Luc,

Actually I did some 2d simulations with yade using discs. We had some discussions before (e.g. #174453). The solution is some modification in makeCloud which tolerates zero size in one dimension. And I blocked DOFs as 'zXY'. For the internal calculation, as I set the third dimension of O.cell.hSize equal to 1, the volume is equal to area. So the stress calc is correct. Particle masses are also set manually.

Now my problem is I want to extend it to clumps. The function makeClumpCloud cannot work correctly with zero size in one dimension. I guess it can be solved similarly to that in makeCloud but I'm not familiar with the code and the algorithm. So I hope anyone can help me. More ideally, I wish I can save the clump packing and use ymport to import it for later use.

Ning

Revision history for this message
Chiara Modenese (chiara-modenese) said :
#4

On 23/05/12 13:06, ceguo wrote:
> Question #198183 on Yade changed:
> https://answers.launchpad.net/yade/+question/198183
>
> Status: Answered => Open
>
> ceguo is still having a problem:
> Thanks Jerome and Luc,
>
> Actually I did some 2d simulations with yade using discs. We had some
> discussions before (e.g. #174453). The solution is some modification in
> makeCloud which tolerates zero size in one dimension. And I blocked DOFs
> as 'zXY'. For the internal calculation, as I set the third dimension of
> O.cell.hSize equal to 1, the volume is equal to area. So the stress calc
> is correct. Particle masses are also set manually.
>
> Now my problem is I want to extend it to clumps. The function
> makeClumpCloud cannot work correctly with zero size in one dimension. I
> guess it can be solved similarly to that in makeCloud but I'm not
> familiar with the code and the algorithm. So I hope anyone can help me.
> More ideally, I wish I can save the clump packing and use ymport to
> import it for later use.
>
> Ning
Hi Ning,

I think you need to play with the axis of orientation of your clumps and
modify the function such that clumps are generated on a plane. It should
be easy to fix but you do need to look into the c++ code of
makeClumpCloud. IICR, this function generates clumps with random
orientation. You need to make sure that that axis is contained on the
plane. Also, make sure your clumps "develop" in 2D.

Chiara

>

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#5

Ning,

The problems are because you are trying to use some of the functions that are supposed to do everything for you but can't be as flexible as lower level functions.

I don't see a need to change anything in the code. Simply, you need to write your own clump generating function in Python (which, in the end, may be easier than trying to figure out how to use clumpCloud), and a single loop on bodies to export positions to a text file.

Jerome, Luc,
FYI, Ning is perfectly right. Yade works in 2D without problems, and makeCloud works with 0 size in one direction (added a few months ago).

Revision history for this message
ceguo (hhh-guo) said :
#6

Hi Chareyre,

You are right that I can generate the clumps packing by writing my own python code or even by using third-party codes. Then I am concerned about what format the text file should look like? Is it something like x1_y1_z1_r1_x2_y2_z2_r2? And after ymport, yade can recognize that the two (or more) particles in one line belong to one clump?

Thanks.

Ning

Revision history for this message
Anton Gladky (gladky-anton) said :
#7

Hi,

2012/5/24 ceguo <email address hidden>:
> ...
> Then I am concerned
> about what format the text file should look like? Is it something like
> x1_y1_z1_r1_x2_y2_z2_r2?

Available file formats you can find here [1].
'x_y_z_r' (default) and 'x_y_z_r_matId' are supported for the moment

But they are only for non-clumps particles.

> And after ymport, yade can recognize that the
> two (or more) particles in one line belong to one clump?

We need to think about adding new file-format for clumps.

[1] https://yade-dem.org/doc/yade.ymport.html?highlight=ymport#yade.ymport.textExt

Anton

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#8

Before there is something to import clumps, you can use any format since YOU (not a Yade function) will open the file and construct clumps with the data.

E.g.:

id1 x y z rad
id2 x y z rad
id3 x y z rad
clumps
clumpId1 ii ij ik
clumpId2 ii ij ik
...

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#9

Why don't you just save the simulation, anyway?
Saving positions is never a very good thing, since contacts are lost.

Revision history for this message
ceguo (hhh-guo) said :
#10

Thanks Bruno,

> Why don't you just save the simulation, anyway?

Since YADE cannot generate a 2D clumps packing, I thought to find another software to generate and write a file YADE can read.

Maybe I can find some way to write and read clumps. As now I encountered some other problems in 2d simulation, I will try to figure them out one by one :)

Revision history for this message
Klaus Thoeni (klaus.thoeni) said :
#11

If you are interested in an external packing library have a look at ESys-
Particle's GenGeo (https://launchpad.net/esys-particle/gengeo). You can direct
import it into yade. It makes nice 2D packings. However, not sure about
clumps.

Klaus

On Thu, 24 May 2012 05:11:00 PM ceguo wrote:
> Question #198183 on Yade changed:
> https://answers.launchpad.net/yade/+question/198183
>
> Status: Answered => Open
>
> ceguo is still having a problem:
> Thanks Bruno,
>
> > Why don't you just save the simulation, anyway?
>
> Since YADE cannot generate a 2D clumps packing, I thought to find
> another software to generate and write a file YADE can read.
>
> Maybe I can find some way to write and read clumps. As now I encountered
> some other problems in 2d simulation, I will try to figure them out one
> by one :)

Revision history for this message
Jérôme Duriez (jduriez) said :
#12

Chareyre (bruno-chareyre) said 11 hours ago:
> FYI, Ning is perfectly right. Yade works in 2D without problems, and makeCloud works with 0

I guess it is still about spheres, isn't it ? Or is there really a new body shape "Disk" ?

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#13

Jerome, I don't get your point, sorry. The fact that the class is called "Sphere" doesn't mean it can't represent a disk. It is always position and radius. If you want it to be a disk, then it is a disk.
A limitation is that Yade does not modelize disks in three dimensions (contact between the edge of disk A and the surface of disk B is not handled), but in 2D there is no problem.

Revision history for this message
Jérôme Duriez (jduriez) said :
#14

Yes... I was maybe a little too "terre à terre" ("down to earth" ?) having in mind the graphical representation (in the QtView) which, I suppose, looks more like a sphere... I didn't really mean that the computations Ning have in mind (and moreover already realized) were impossible. Thanks for the details

Revision history for this message
Anton Gladky (gladky-anton) said :
#15

BTW, gengeo is available in Debian/Ubuntu and known as python-demgengeo package.
Just do:
sudo apt-get install python-demgengeo

and look into examples.

Anton

Revision history for this message
ceguo (hhh-guo) said :
#16

Thanks Klaus and Anton.

Actually I am an active user of ESys-Particle. It's wonderful and has a powerful packing generation companion-code Gengeo. It can handle 2D cases but not clumps.

Ning

Revision history for this message
Anton Gladky (gladky-anton) said :
#17

You can import generated by gengeo files and "makeClumps" on each of them.

Anton

Can you help with this problem?

Provide an answer of your own, or ask ceguo for more information if necessary.

To post a message you must log in.