tcube-init.py - sphere - GPU-based 3D discrete element method algorithm with optional fluid coupling
 (HTM) git clone git://src.adamsgaard.dk/sphere
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) LICENSE
       ---
       tcube-init.py (815B)
       ---
            1 #!/usr/bin/env python
            2 import sphere
            3 
            4 init = sphere.sim('cube-init', np=1e3)
            5 
            6 init.generateRadii(psd='uni', mean=0.01, variance=0.002)
            7 
            8 init.periodicBoundariesXY()
            9 
           10 # Initialize positions in random grid (also sets world size)
           11 init.initRandomGridPos(gridnum=(7, 7, 1e12))
           12 
           13 # Disable friction to dissipate energy fast
           14 init.k_n[0] = 1.0e8
           15 init.mu_s[0] = 0.5
           16 init.mu_d[0] = 0.5
           17 
           18 # Choose the tangential contact model
           19 # 1) Visco-frictional (somewhat incorrect, fast computations)
           20 # 2) Elastic-viscous-frictional (more correct, slow computations in dense
           21 # packings)
           22 init.contactmodel[0] = 2
           23 
           24 # Add gravitational acceleration
           25 init.g[2] = -10.0
           26 
           27 # Set duration of simulation, automatically determine timestep, etc.
           28 init.initTemporal(total=6.0, file_dt=0.2)
           29 print(init.num)
           30 
           31 init.run(dry=True)
           32 init.run()
           33 init.writeVTKall()