from esys.lsm import *
from esys.lsm.util import *
from math import *

Rmin = 0.3
Rmax = 1.0

K = 500000. #N/m2 - a Young's modulus
rho = 2600.0 #kg/m3
gravity = 9.81 #m/s/s

sim = LsmMpi (numWorkerProcesses = 1, mpiDimList = [1,1,1])

sim.initNeighbourSearch (
   particleType = "NRotSphere",
   gridSpacing = 2.5*Rmax,
   verletDist = 0.2*Rmin
)

sim.setNumTimeSteps(10000)

deltaT = 0.1*sqrt(4.*pi/3.*rho*Rmin**3./K/Rmax)

sim.setTimeStepSize(deltaT)

sim.readGeometry("box.geo")

sim.setParticleDensity (tag = 1, mask = -1, Density = rho)
sim.setParticleDensity (tag = 2, mask = -1, Density = rho)

sim.setParticleNonDynamic(2)

sim.createWall (
   name = "floor",
   posn = Vec3(0,0,0),
   normal = Vec3(0,1,0)
)

#elastic repulsion between the particles:
sim.createInteractionGroup (
   SpringDashpotFrictionPrms (
      name = "pp_repel",
      youngsModulus = K,
      poissonsRatio = 0.25,
      restitution = 0.8,
      dynamicMu = 0.6
   ) 
)

#gravity:
sim.createInteractionGroup (
   GravityPrms (
      name="gravity",
      acceleration = Vec3(0., -1.*gravity, 0.)
   )
)

sim.createInteractionGroup (
   NRotElasticWallPrms (
      name = "pw_repel",
      wallName = "floor",
      normalK = K
   )
)

sim.createCheckPointer (
   CheckPointPrms (
        fileNamePrefix = "snapshot",
        beginTimeStep = 0,
        endTimeStep = 10000,
        timeStepIncr = 100
   )
)

sim.run()
GlossyBlue theme adapted by David Gilbert
Powered by PmWiki
www.000webhost.com