tupdated examples - 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
---
(DIR) commit 3ccb9bda7a8b9d2c878695e70a743dde2d5651c3
(DIR) parent 7d8e9335c718e6e47e25c41b5cdd5d48e92b9e27
(HTM) Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
Date: Sat, 28 Sep 2013 10:17:05 +0200
updated examples
Diffstat:
M python/shear-test.py | 118 ++++++++++++++++---------------
1 file changed, 60 insertions(+), 58 deletions(-)
---
(DIR) diff --git a/python/shear-test.py b/python/shear-test.py
t@@ -5,19 +5,19 @@ from sphere import *
### EXPERIMENT SETUP ###
initialization = True
-consolidation = False
-shearing = False
-rendering = False
-plots = False
+consolidation = True
+shearing = True
+rendering = True
+plots = True
# Number of particles
np = 1e4
# Common simulation id
-sim_id = "shear-test"
+sim_id = "shear-test-devs3"
# Deviatoric stress [Pa]
-devs = 10e3
+devslist = [80e3, 10e3, 20e3, 40e3, 60e3, 120e3]
#devs = 0
### INITIALIZATION ###
t@@ -26,16 +26,17 @@ devs = 10e3
init = Spherebin(np = np, nd = 3, nw = 0, sid = sim_id + "-init")
# Save radii
-init.generateRadii(radius_mean = 0.05)
+init.generateRadii(radius_mean = 0.02)
# Use default params
-init.defaultParams(gamma_n = 0.0, mu_s = 0.4, mu_d = 0.4)
+init.defaultParams(gamma_n = 0.0, mu_s = 0.3, mu_d = 0.3)
# Initialize positions in random grid (also sets world size)
-init.initRandomGridPos(gridnum = numpy.array([12, 12, 1000]), periodic = 1, contactmodel = 2)
+hcells = np**(1.0/3.0)
+init.initRandomGridPos(gridnum = numpy.array([hcells, hcells, 1e9]), periodic = 1, contactmodel = 2)
# Set duration of simulation
-init.initTemporal(total = 0.2)
+init.initTemporal(total = 5.0)
if (initialization == True):
# Write input file for sphere
t@@ -55,74 +56,75 @@ if (initialization == True):
### CONSOLIDATION ###
-# New class
-cons = Spherebin(np = init.np, nw = 1, sid = sim_id + "-cons")
+for devs in devslist:
+ # New class
+ cons = Spherebin(np = init.np, nw = 1, sid = sim_id + "-cons-devs{}".format(devs))
-# Read last output file of initialization step
-lastf = status(sim_id + "-init")
-cons.readbin("../output/" + sim_id + "-init.output{:0=5}.bin".format(lastf), verbose=False)
+ # Read last output file of initialization step
+ lastf = status(sim_id + "-init")
+ cons.readbin("../output/" + sim_id + "-init.output{:0=5}.bin".format(lastf), verbose=False)
-# Setup consolidation experiment
-cons.consolidate(deviatoric_stress = devs, periodic = init.periodic)
+ # Setup consolidation experiment
+ cons.consolidate(deviatoric_stress = devs, periodic = init.periodic)
-# Set duration of simulation
-cons.initTemporal(total = 1.5)
-#cons.initTemporal(total = 0.0019, file_dt = 0.00009)
-#cons.initTemporal(total = 0.0019, file_dt = 1e-6)
-#cons.initTemporal(total = 0.19, file_dt = 0.019)
+ # Set duration of simulation
+ cons.initTemporal(total = 1.5)
+ #cons.initTemporal(total = 0.0019, file_dt = 0.00009)
+ #cons.initTemporal(total = 0.0019, file_dt = 1e-6)
+ #cons.initTemporal(total = 0.19, file_dt = 0.019)
-cons.w_m[0] *= 0.001
+ cons.w_m[0] *= 0.001
-if (consolidation == True):
- # Write input file for sphere
- cons.writebin()
+ if (consolidation == True):
+ # Write input file for sphere
+ cons.writebin()
- # Run sphere
- cons.run(dry=True) # show values, don't run
- cons.run() # run
+ # Run sphere
+ cons.run(dry=True) # show values, don't run
+ cons.run() # run
- if (plots == True):
- # Make a graph of energies
- visualize(cons.sid, "energy", savefig=True, outformat='png')
- visualize(cons.sid, "walls", savefig=True, outformat='png')
+ if (plots == True):
+ # Make a graph of energies
+ visualize(cons.sid, "energy", savefig=True, outformat='png')
+ visualize(cons.sid, "walls", savefig=True, outformat='png')
- if (rendering == True):
- # Render images with raytracer
- cons.render(method = "pres", max_val = 2.0*devs, verbose = False)
+ if (rendering == True):
+ # Render images with raytracer
+ cons.render(method = "pres", max_val = 2.0*devs, verbose = False)
### SHEARING ###
-# New class
-shear = Spherebin(np = cons.np, nw = cons.nw, sid = sim_id + "-shear")
+ # New class
+ shear = Spherebin(np = cons.np, nw = cons.nw, sid = sim_id + "-shear-devs{}".format(devs))
-# Read last output file of initialization step
-lastf = status(sim_id + "-cons")
-shear.readbin("../output/" + sim_id + "-cons.output{:0=5}.bin".format(lastf), verbose = False)
+ # Read last output file of initialization step
+ lastf = status(sim_id + "-cons-devs{}".format(devs))
+ shear.readbin("../output/" + sim_id + "-cons-devs{}.output{:0=5}.bin".format(devs, lastf), verbose = False)
-# Setup shear experiment
-shear.shear(shear_strain_rate = 0.10, periodic = init.periodic)
+ # Setup shear experiment
+ shear.shear(shear_strain_rate = 0.05, periodic = init.periodic)
-# Set duration of simulation
-shear.initTemporal(total = 5.0)
+ # Set duration of simulation
+ shear.initTemporal(total = 20.0)
-if (shearing == True):
- # Write input file for sphere
- shear.writebin()
+ if (shearing == True):
+ # Write input file for sphere
+ shear.writebin()
- # Run sphere
- shear.run(dry=True)
- shear.run()
+ # Run sphere
+ shear.run(dry=True)
+ shear.run()
- if (plots == True):
- # Make a graph of energies
- visualize(shear.sid, "energy", savefig=True, outformat='png')
- visualize(shear.sid, "shear", savefig=True, outformat='png')
+ if (plots == True):
+ # Make a graph of energies
+ visualize(shear.sid, "energy", savefig=True, outformat='png')
+ visualize(shear.sid, "shear", savefig=True, outformat='png')
- if (rendering == True):
- # Render images with raytracer
- shear.render(method = "pres", max_val = 2.0*devs, verbose = False)
+ if (rendering == True):
+ # Render images with raytracer
+ shear.render(method = "pres", max_val = 2.0*devs, verbose = False)