tdiffusivity-starter.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
---
tdiffusivity-starter.py (1266B)
---
1 #!/usr/bin/env python
2 import sphere
3 import numpy
4 import sys
5
6 # launch with:
7 # $ python diffusivity-starter <DEVICE> <C_PHI> <C_GRAD_P> <DP_1, DP_2, ...>
8
9 for sigma0_str in sys.argv[4:]:
10
11 sigma0 = float(sigma0_str)
12 device = int(sys.argv[1])
13 c_phi = float(sys.argv[2])
14 c_grad_p = float(sys.argv[3])
15
16 sim = sphere.sim('diffusivity-relax')
17 sim.readlast()
18
19 sim.sid = 'diffusivity-sigma0=' + str(sigma0) + '-c_phi=' + str(c_phi) + \
20 '-c_grad_p=' + str(c_grad_p) + '-tall'
21 print(sim.sid)
22
23 sim.checkerboardColors()
24
25 sim.cleanup()
26 sim.adjustUpperWall()
27 sim.zeroKinematics()
28
29 sim.consolidate(normal_stress = sigma0)
30
31 # Increase height of grid
32 sim.L[2] *= 2.0
33 sim.num[2] *= 2
34
35 sim.initFluid(mu = 17.87e-4, p = 1.0e5, hydrostatic = True)
36 sim.setFluidBottomNoFlow()
37 sim.setFluidTopFixedPressure()
38 sim.setDEMstepsPerCFDstep(10)
39 sim.setMaxIterations(2e5)
40 sim.initTemporal(total = 10.0, file_dt = 0.01, epsilon=0.07)
41
42 # Fix lowermost particles
43 dz = sim.L[2]/sim.num[2]
44 I = numpy.nonzero(sim.x[:,2] < 1.5*dz)
45 sim.fixvel[I] = 1
46
47 sim.run(dry=True)
48 sim.run(device=device)
49 #sim.writeVTKall()
50 sim.visualize('walls')
51 sim.visualize('fluid-pressure')