Cylinder Mesh packing with LSMGenGeo

Asked by ceguo

Hi everyone,

I've used LsmGenGeo to generate a cylinder packing. If I want to do a triaxial compression test using moveSingleMeshNodeBy(...), how could I get the meshName and nodeID? Should I write a mesh file and readMesh(...) in addition?

Tks,
Ning

Question information

Language:
English Edit question
Status:
Solved
For:
ESyS-Particle Edit question
Assignee:
No assignee Edit question
Solved by:
Dion Weatherley
Solved:
Last query:
Last reply:

This question was reopened

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

I guess, more simple way for you will be to create "walls" instead of mesh, if you don't need something specific. See the "uniaxial test example" in Tutorial. You just need to add 4 walls on the sides and give them movement.

Revision history for this message
Dion Weatherley (d-weatherley) said :
#2

Hi Ning,

I recently tried to make a simulation to compress a cylinder of particles with a mesh wall. The simulation was intended as an example script for the recent Workshop. In the process, a bug with moving mesh walls was discovered. Some details are here:
https://bugs.launchpad.net/esys-particle/+bug/444533

Until this bug is fixed in a later release of ESyS-Particle, it is not recommended that you move mesh walls. Anton's suggestion above is a good alternative for conducting triaxial tests on rectangular prisms of particles. You can use the LsmMpi.applyForceToWall(..) subroutine to maintain a constant force on the 4 side walls. However, based upon this question:
https://answers.launchpad.net/esys-particle/+question/84821
it would appear you have already tried that.

To finish answering your question about how to move a mesh (once the bug is fixed), you need to create a cylinder mesh input file and import it into a simulation with LsmMpi.readMesh(..). After that you need to write a runnable containing a loop in which each node is moved using LsmMpi.moveSingleMeshNodeBy(..). When I wrote my example simulation, I wrote a Runnable that re-read the mesh file to store node IDs and original positions of the nodes then used that information to deform the mesh according to the initial X- and Z-coordinates of each node. By the way, instructions on how to create a cylindrical mesh are available here:
https://answers.launchpad.net/esys-particle/+faq/683

Cheers,

Dion.

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

Thanks Dion and Anton!

I've one more question about mesh. After readMesh(...), how to do a random pack in the mesh directly like InsertGenerator3D(...), if I don't want to pack a box first or add particles one by one?

Cheers,

Ning

Revision history for this message
Dion Weatherley (d-weatherley) said :
#4

Hi Ning,

Although it would be a nice feature, there is currently no way to directly pack particles within a triangle mesh with either LSMGenGeo or within a simulation script (e.g. like RandomBoxPacker). The only options available to you are:

1/ Generate a cylinder of particles in LSMGenGeo using a CylinderVol with the radius of the CylinderVol slightly smaller than the radius of your cylinder mesh (looks like you've tried that already)

2/ Run a simulation where you let a box/cylinder of unbonded particles settle within your cylinder mesh then write out the final particle positions to create your own input geometry file for the settled packing.

Hope this helps.

Cheers,

Dion.

P.S. As I mentioned above, simulations with moving meshes will not work until the moveSingleMeshNodeBy(..) bug is fixed. Simulations involving stationary meshes should work reasonably well, although you may encounter the 'hanging spheres' bug under some circumstances:
https://bugs.launchpad.net/esys-particle/+bug/442881

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

Thanks Dion Weatherley, that solved my question.

Revision history for this message
Dion Weatherley (d-weatherley) said :
#6

Hi Ning,

The bug with moving mesh walls is now fixed in the latest development version. This FAQ explains how to obtain the latest version:
https://answers.launchpad.net/esys-particle/+faq/711

Cheers,

Dion.

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

Hi Dion,

Thanks! That's great. I've reinstalled ESyS. And I have one question about moveSingleMeshNodeBy(...). To determine the parameter delta, we should get the current position of the node. (The initial nodes positions can be read from the mesh file, while I want to move the nodes according to their current positions to ensure a constant volume of the sample.)
 I can't find any function like getNodePosition(...) in the class LsmMpi. So how can I get the position of the moving nodes?

Tks,
Ning

Revision history for this message
SteffenAbe (s-abe) said :
#8

> So how can I get the position of the moving nodes?
Currently you can't - there is no function in the code to access node positions from the python script. So the only way to know where a mesh node is at a given point in time is know where it was at the beginning (i.e. in the the original mesh file) and to track your moveSingleMeshNodeBy(...) calls. Given that there is no "applyForceToMesh..." at the moment the moveSingleMeshNodeBy() calls are the only way mesh nodes are changing their position.

Steffen

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

Thanks Steffen and Dion,

Finally I used the way proposed by Steffen (i.e. record the initial positions from mesh file, and as I know every step how the nodes move then I calculate the current positions.) I think it works.

Ning

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

Hi,

I have run a triaxial simulation on cylinder packing. But as I output the contact forces among particles I found the values of the forces were much smaller than those from cubic simulations with almost same other parameters. So I suspect that whether my esys has been successfully updated. When I reinstall the software I use -without epydoc to ignore some errors. I think this is OK.

When I run a free fall simulation using a simple trimesh wall with just 3 nodes and move the nodes upward at the same speed, it seems that the ball always falls to the same height. As I expect, the height should decrease since the mesh wall rises.

I am asking is there any method to check whether the function of my moveSingleMeshNodeBy(...) has been fixed.

Tks,
Ning

Revision history for this message
Dion Weatherley (d-weatherley) said :
#11

Hi Ning,

It's not easy to determine whether your ESyS-Particle installation has been updated properly. One test you could try is to make a simulation with a single particle, no gravity and a triangle mesh wall that is initially not touching the particle. Then move the mesh wall towards the particle. If your moveSingleMeshNodeBy(..) subroutine is working, the particle should move when the mesh wall touches it. If the particle doesn't move then I suggest you try re-installing ESyS-Particle again. If you do re-install, I suggest you do the following:

1/ make uninstall
2/ sudo rm /usr/local/lib/python2.6/site-packages/esys
3/ make distclean
4/ then configure, make and install again

I hope this helps.

Cheers,

Dion.

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

Hi Dion,

Thanks for your reply. But there is no files in /usr/local/lib/python2.6/site-packages. You mean remove the directory of esys in /usr/local/lib/python2.6/dist-packages? After I did "make uninstall" and "make distclean", I found I still can run esys. So weird.
In addition, I've reinstalled the version 1237 several times and encountered the problem reported by Anton in Bug #456226. So I used "-without epydoc". I think I reinstalled unsuccessfully.

I am looking forward to your reply.

Ning

Revision history for this message
Best Dion Weatherley (d-weatherley) said :
#13

Hi Ning,

> You mean remove the directory of esys in /usr/local/lib/python2.6/dist-packages?

Yes, remove the esys directory from .../dist-packages after you 'make uninstall'

> After I did "make uninstall" and "make distclean", I found I still can run esys

OK, that would suggest you have more than one copy of ESyS-Particle installed on your PC. Perhaps one time you configured ESyS-Particle for installation, you provided a '--prefix=dir/' argument to 'configure'? After you do 'make uninstall', type 'which mpipython'. This should tell you the directory where the second copy of ESyS-Particle is installed. The output should be something like:
/path/to/esys/bin/mpipython

Once you know where it is installed, you will need to manually remove it. There will be ESyS-Particle related files in the following directories:

/path/to/esys/bin/
/path/to/esys/lib/
/path/to/esys/lib/python2.6/dist-packages/esys

Depending on your actual path to esys, those directories may also contain files related to other software. Be careful what you delete!

Once you've cleaned up the other ESyS-Particle installation, you can try reinstalling rev.1237 again. I suspect the problems you are experiencing is because this second copy of ESyS-Particle is getting executed/linked instead of your new installation of rev. 1237.

I hope this helps.

Cheers,

Dion.

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

Thanks Dion Weatherley, that solved my question.

Revision history for this message
Jessica (jescarish) said :
#15

hello!!!

Just wondering how to implement the LsmGenGeo to generate a cylinder packing. Because I need to fill my conical shape funnel and I am still looking for anwers..maybe this LsmGenGeo might help with my problem. =)

Jessica

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

If, I understand correctly, what you mean, next several lines generate
cylinder packing:

from GenGeo import *
import sys
radius=5
length=10

maxRadius=0.4
minRadius=0.2
origin=Vec3(0.0,0.0,0.0)
axis=Vec3(0.0,1.0,0.0)

minPoint=Vec3(-radius,-length,-radius)
maxPoint=Vec3(radius,length,radius)

box=CylinderVol (
  origin = origin,
  axis = axis,
  radius = radius,
  length = 2.0*length
)

mntable=MNTable3D (
  minPoint=minPoint,
  maxPoint=maxPoint,
  gridSize=2.5*maxRadius,
  numGroups=1
)
packer=InsertGenerator3D(
  minRadius=minRadius,
  maxRadius=maxRadius,
  insertFails=1000,
  maxIterations=1000,
  tolerance=1.0e-6,
  seed=0
)

packer.generatePacking (
  volume=box,
  ntable=mntable,
  groupID=0
)

mntable.write("cyl.geo",1)
mntable.write("cyl.vtu",2)

______________________________
[ENG] Best Regards
[GER] Mit freundlichen Grüßen
[RUS] С наилучшими пожеланиями
[UKR] З найкращими побажаннями

Anton Gladkyy

2009/11/18 Jessica <email address hidden>

> Question #85594 on ESyS-Particle changed:
> https://answers.launchpad.net/esys-particle/+question/85594
>
> Jessica posted a new comment:
> hello!!!
>
> Just wondering how to implement the LsmGenGeo to generate a cylinder
> packing. Because I need to fill my conical shape funnel and I am still
> looking for anwers..maybe this LsmGenGeo might help with my problem. =)
>
> Jessica
>
> --
> You received this question notification because you are an answer
> contact for ESyS-Particle.
>

Revision history for this message
Jessica (jescarish) said :
#17

hello Sir Anton,

I wanted to know what esys version you use. Because I am using the newest version which is 2.0. While I was trying to run the codes you provided, the error was that there is no gengeo module. How are we going to import the module?

Jessica

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

Hi, Jessica!

I am using the latest SVN-version of ESyS-parricle. But it does not really
matter, as LSMGenGeo is not included into ESyS-particle and needs to be
installed separately.

svn checkout https://svn.esscc.uq.edu.au/svn/esys3/lsm/contrib/LSMGenGeo/
cd LSMGenGeo/build/
./autogen.sh
./configure
make
sudo make install

Have a Luck!
______________________________
[ENG] Best Regards
[GER] Mit freundlichen Grüßen
[RUS] С наилучшими пожеланиями
[UKR] З найкращими побажаннями

Anton Gladkyy

2009/11/23 Jessica <email address hidden>

> Question #85594 on ESyS-Particle changed:
> https://answers.launchpad.net/esys-particle/+question/85594
>
> Jessica posted a new comment:
> hello Sir Anton,
>
> I wanted to know what esys version you use. Because I am using the
> newest version which is 2.0. While I was trying to run the codes you
> provided, the error was that there is no gengeo module. How are we going
> to import the module?
>
> Jessica
>
> --
> You received this question notification because you are an answer
> contact for ESyS-Particle.
>

Revision history for this message
Jessica (jescarish) said :
#19

hello!!

Thank you very much for the help!! We have successfully installed the GenGeo module. Anyway, regarding with the codes you gave about the cylinder packing..I was confused with the output. What does it mean?? I wanted the particles to fill the conical hopper like what is done on hopper_flow in the tutorial. What type of packer should I use to fit on a conical hopper?

Thank you in advance and more power!!

Jessica