tshear-results-strength.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
---
tshear-results-strength.py (906B)
---
1 #!/usr/bin/env python
2 import sphere
3 import numpy
4
5 '''
6 Print a table of peak and ultimate shear strengths of the material
7 '''
8
9 baseid = 'halfshear-sigma0=20000.0'
10
11
12
13
14 def print_strengths(sid, fluid=False, c=0.0):
15 sim = sphere.sim(sid, fluid=fluid)
16
17 sim.readfirst(verbose=False)
18 sim.visualize('shear')
19
20 friction = sim.tau[1:]/sim.sigma_eff[1:]
21 tau_peak = numpy.max(friction)
22 tau_ultimate = numpy.average(friction[-500:-1])
23
24 if fluid:
25 print('%.2f \t %.2f \t %.2f' % (c, tau_peak, tau_ultimate))
26 else:
27 print('dry \t %.2f \t %.2f' % (tau_peak, tau_ultimate))
28
29 return friction
30
31
32
33
34 # print header
35 print('$c$ [-] \t \\tau/\\sigma\' (peak) [-] \t \\tau/\\sigma\' (ultimate) [-]')
36 f = print_strengths(baseid + '-shear', fluid=False)
37 f = print_strengths(baseid + '-c=1.0-shear', fluid=True, c=1.0)
38 f = print_strengths(baseid + '-c=0.1-shear', fluid=True, c=0.1)
39
40
41