tfluidshear.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
---
tfluidshear.py (1093B)
---
1 #!/usr/bin/env python
2
3 import sphere
4
5 sid = 'fluidshear'
6
7 ## Initialization from loose packing to a gravitationally collapsed state
8 ## without fluids
9 sim = sphere.sim(sid + '-init', np = 24000, fluid = False)
10 #sim.cleanup()
11 sim.radius[:] = 0.05
12 sim.periodicBoundariesXY()
13 sim.initRandomGridPos(gridnum = [20, 20, 9000])
14 sim.initTemporal(total = 10.0, file_dt = 0.05)
15 sim.g[2] = -9.81
16 sim.run(dry=True)
17 sim.run()
18 sim.writeVTKall()
19
20 ## Consolidation from a top wall without fluids
21 sim.readlast()
22 sim.sid = sid + '-cons'
23 sim.adjustUpperWall()
24 sim.consolidate(normal_stress = 10.0e3)
25 #sim.initFluid(mu = 17.87e-4, p = 1.0e5, hydrostatic = True) # mu = water at 0 deg C
26 sim.initTemporal(total = 1.0, file_dt = 0.01)
27 sim.run(dry=True)
28 sim.run()
29 sim.writeVTKall()
30 sim.visualize('walls')
31
32 ## Shear with fluids
33 sim.readlast()
34 sim.sid = sid + '-shear'
35 sim.shear()
36 sim.initFluid(mu = 17.87e-4, p = 1.0e5, hydrostatic = True)
37 sim.bc_bot[0] = 1 # Neumann BC
38 sim.setDEMstepsPerCFDstep(100)
39 sim.initTemporal(total = 1.0, file_dt = 0.01)
40 sim.run(dry=True)
41 sim.run()
42 sim.writeVTKall()
43 sim.visualize('shear')