I got a memory error when conducted an impact simulation

Asked by Huihuang Xia

Hi,
I plan to conduct an impact simulation, i.e. a rigid ball impact on a cuboid assembly of particles at a certain speed. But, I got an error as follows:
huihuangxia@huihuangxia-Presario-CQ42-Notebook-PC:~$ cd Desktop/impact
huihuangxia@huihuangxia-Presario-CQ42-Notebook-PC:~/Desktop/impact$ mpirun -np 2 `which esysparticle` impact.py
CSubLatticeControler::initMPI()
slave started at local/global rank 0 / 1
Traceback (most recent call last):
  File "impact.py", line 55, in <module>
    pList = geoRandomBlock_particles
MemoryError

My code is here, please help me to tackle this problem.

#import essential modules to simulation
from esys.lsm import *
from esys.lsm.util import *
from esys.lsm.geometry import *
#initialise a simulation and neighbour search algorithm
sim = LsmMpi(numWorkerProcesses=1, mpiDimList=[1,1,1])
sim.initNeighbourSearch(
    particleType="NRotSphere",
 gridSpacing=2.5,
 verletDist=0.5
)
#set total timestep and its increment
sim.setNumTimeSteps(10000)
sim.setTimeStepSize(0.1)
#specify the spatial domain
domain = BoundingBox(Vec3(0,0,0),Vec3(0.1,0.1,0.5))
sim.setSpatialDomain(domain)
#cerate checkpointer to save simulation data
sim.createCheckPointer(
    CheckPointPrms(
     fileNamePrefix="impact_",
  beginTimeStep=0,
  endTimeStep=10000,
  timeStepIncr=100
 )
)
#add the impactor to this simulation
impactor=NRotSphere(id=0,posn=Vec3(0.05,0.05,1.0),radius=0.05,mass=5.0)
impactor.setLinearVelocity(Vec3(0,0,-1))
sim.createParticle(impactor)
#create a random spherical partcile package
geoRandomBlock = RandomBoxPacker (
 minRadius = 0.005,
 maxRadius = 0.01,
 cubicPackRadius = 2.2000,
 maxInsertFails = 5000,
 bBox = BoundingBox(
  Vec3(0,0,0),
  Vec3(0.1,0.1,0.5)
 ),
 circDimList = [False, False, False],
 tolerance = 1.0000e-05
)
geoRandomBlock.generate()
geoRandomBlock_particles = geoRandomBlock.getSimpleSphereCollection()
#add the particles to the simulation object:
sim.createParticles(geoRandomBlock_particles)
#bond particles together with bondTag = 1:
sim.createConnections(
 ConnectionFinder(
 maxDist = 0.0005,
 bondTag = 1,
 pList = geoRandomBlock_particles
 )
)
#create rotational elastic-brittle bonds between particles:
pp_bonds = sim.createInteractionGroup (
BrittleBeamPrms(
name="pp_bonds",
youngsModulus=100000.0,
poissonsRatio=0.25,
cohesion=100.0,
tanAngle=1.0,
tag=1
)
)
#initialise frictional interactions for unbonded particles:
sim.createInteractionGroup (
FrictionPrms(
name="friction",
youngsModulus=100000.0,
poissonsRatio=0.25,
dynamicMu=0.4,
staticMu=0.6
)
)
#create an exclusion between bonded and frictional interactions:
sim.createExclusion (
interactionName1 = "pp_bonds",
interactionName2 = "friction"
)
#initialise gravity in the domain
sim.createInteractionGroup(
 GravityPrms(name="gravity",acceleration=Vec3(0,0,-9.81))
)
#create a wall at the bottom of this model
sim.createWall(
 name="bottom_wall",
 posn=Vec3(0.1,0,0),
 normal=Vec3(0,0,1)
)
#specify elastic repulsion from th ebottom wall
sim.createInteractionGroup (
 NRotElasticWallPrms (
 name = "bottom_wall_repel",
 wallName = "bottom_wall",
 normalK = 100000.0
 )
)
#add translational viscous damping:
sim.createInteractionGroup (
 LinDampingPrms(
 name="damping1",
 viscosity=0.002,
 maxIterations=50
 )
)
#add rotational viscous damping:
sim.createInteractionGroup (
 RotDampingPrms(
 name="damping2",
 viscosity=0.002,
 maxIterations=50
 )
)
#execute the simulation
sim.run()

Question information

Language:
English Edit question
Status:
Solved
For:
ESyS-Particle Edit question
Assignee:
No assignee Edit question
Solved by:
Qi Shao
Solved:
Last query:
Last reply:
Revision history for this message
Dion Weatherley (d-weatherley) said :
#1

Hi,

Try executing your simulation this way:

$ mpirun -np 2 esysparticle impact.py

For more information, please refer to the ESyS-Particle Tutorial.

By the way, Yade is a different DEM software package that is unrelated to ESyS-Particle.

Cheers,

Dion

Revision history for this message
Huihuang Xia (huihuangxia) said :
#2

Hi,

I was too careless to post the wrong information. After ran this code in ESyS-Particle, I got a memeory error, as shown in the question above.
Can you help me to solve this problem?
Many thanks and regards.
 Huihuang Xia

Revision history for this message
Best Qi Shao (uqqshao) said :
#3

Hi Huihuang,

Thank you for your interest in ESyS-Particle. When looking at your codes, I found there were a number of errors which may stop running the program properly:

1. Particle type was defined as "NRotSphere" in sim.initNeighbourSearch(…) function, but rotational elastic-brittle bonds and rotational viscous damping were created later. You may change particle type to RotSphere or change particle interactions to NRotSphere groups, depending on your interest.

2. In sim.initNeighbourSearch(...) function, gridSpacing and verletDist values were too large for the defined domain size. Normally, gridSpacing is less than 2.5 X maxRadius and verletDist is set as 0.2 X minRadius.

3. In RandomBoxPacker(...) function, cubicPackRadius value was too large. Its optimal value is approximately 2.2 X maxRadius.

4. In sim.createWall(...) function, you may want to change "normal=Vec3(0,0,1)" to "normal=Vec3(1,0,0)" to make it consistent with the posn argument.

5. The time step size (0.1 s) seems to be quite large for given parameters of particle and wall interactions, which may lead to numerical instability.

Please try to fix these errors and run the codes again, and let me know how it goes.

Cheers
Qi

Revision history for this message
Huihuang Xia (huihuangxia) said :
#4

Thanks Qi Shao, that solved my question.