Codes
# import the appropriate ESyS-Particle modules: from esys.lsm import * from esys.lsm.util import * from esys.lsm.geometry import * from WallLoader import WallLoaderRunnable from ServoWallLoader import ServoWallLoaderRunnable sim = LsmMpi(numWorkerProcesses=1, mpiDimList=[1, 1, 1]) sim.initNeighbourSearch( particleType="NRotSphere", gridSpacing=0.00125, verletDist=0.00002 ) sim.setNumTimeSteps(100000) sim.setTimeStepSize(0.000001) # enforce two-dimensional computations: sim.force2dComputations(True) domain = BoundingBox(Vec3(0, 0, 0), Vec3(0.018, 0.018, 0)) sim.setSpatialDomain( bBox=domain, circDimList=[False, False, False] ) packer = RandomBoxPacker( minRadius=0.0001, maxRadius=0.0003, cubicPackRadius=0.0066, maxInsertFails=100, bBox=BoundingBox( Vec3(0.0, 0.0, 0.0), Vec3(0.018, 0.018, 0.0) ), circDimList=[False, False, False], tolerance=1.0e-9 ) packer.generate() particleList = packer.getSimpleSphereCollection() for pp in particleList: pp.setTag(1) sim.createParticle(pp) sim.setParticleDensity( tag=1, mask=-1, Density=2.7000 ) sim.createWall( name="bottom_wall", posn=Vec3(0, 0, 0), normal=Vec3(0, 1, 0) ) sim.createWall( name="top_wall", posn=Vec3(0, 0.018, 0), normal=Vec3(0, -1, 0) ) sim.createWall( name="left_wall", posn=Vec3(0, 0, 0), normal=Vec3(1, 0, 0) ) sim.createWall( name="right_wall", posn=Vec3(0.018, 0, 0), normal=Vec3(-1, 0, 0) ) sim.createInteractionGroup( NRotFrictionPrms( name="pp_friction", normalK=1.0000e+08, dynamicMu=0.5, shearK=1.0000e+08, scaling=True ) ) sim.createInteractionGroup( NRotElasticWallPrms( name="bottom_wall_repel", wallName="bottom_wall", normalK=1.0000e+08 ) ) sim.createInteractionGroup( NRotElasticWallPrms( name="top_wall_repel", wallName="top_wall", normalK=1.0000e+08 ) ) sim.createInteractionGroup( NRotElasticWallPrms( name="left_wall_repel", wallName="left_wall", normalK=1.0000e+08 ) ) sim.createInteractionGroup( NRotElasticWallPrms( name="right_wall_repel", wallName="right_wall", normalK=1.0000e+08 ) ) # add damping to achieve quasi-static sim.createInteractionGroup( LinDampingPrms( name="damping", viscosity=1.0, maxIterations=100 ) ) # add FieldSavers to store wall forces and positions: posn_saver = WallVectorFieldSaverPrms( wallName=["bottom_wall", "top_wall", "left_wall", "right_wall"], fieldName="Position", fileName="out_Position.bat", fileFormat="RAW_SERIES", beginTimeStep=0, endTimeStep=100000, timeStepIncr=1 ) sim.createFieldSaver(posn_saver) force_saver = WallVectorFieldSaverPrms( wallName=["bottom_wall", "top_wall", "left_wall", "right_wall"], fieldName="Force", fileName="out_Force.bat", fileFormat="RAW_SERIES", beginTimeStep=0, endTimeStep=100000, timeStepIncr=1 ) sim.createFieldSaver(force_saver) # add a CheckPointer to store simulation data: sim.createCheckPointer( CheckPointPrms( fileNamePrefix="snapshot", beginTimeStep=0, endTimeStep=6000, timeStepIncr=1000 ) ) # execute the simulation: sim.run()
Problems
Only 1 particle, after 5000 steps.



No movement of the boundary.

Forces are not 0 at the start of simulation, but 0 at the end.


Solution
Provided by Dion Weatherley:
Choose a smaller timestep increment. As a general guide:
Where:
- dt = timestep increment
- = density = particle density
- = minimum particle radius
- = maximum particle radius
- = maximum Young's modulus used for any interactions
Example:
dt = 0.1*sqrt( 4./3.*2.7*0.0001**3/1.0e8/0.0003) = 1.0954451150103323e-09