tadded script for simulating capillary cohesion - 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 4cf81fbdb5bf766b29ea42cbbd74095955cd2bd0
(DIR) parent 8be3e7d95c38fcbcbc23214a079ba83a6a41e3ca
(HTM) Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
Date: Fri, 29 Aug 2014 15:01:27 +0200
added script for simulating capillary cohesion
Diffstat:
A python/capillary-cohesion.py | 25 +++++++++++++++++++++++++
A python/capillary-cohesion.sh | 48 +++++++++++++++++++++++++++++++
2 files changed, 73 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/python/capillary-cohesion.py b/python/capillary-cohesion.py
t@@ -0,0 +1,25 @@
+#!/usr/bin/env python
+
+# This script simulates the effect of capillary cohesion on a sand pile put on a
+# desk.
+
+# start with
+# $ python capillary-cohesion.py <DEVICE> <COHESION>
+# where DEVICE specifies the index of the GPU (0 is the most common value).
+# COHESION should have the value of 0 or 1. 0 denotes a dry simulation without
+# cohesion, 1 denotes a wet simulation with capillary cohesion.
+
+import sphere
+import numpy
+import sys
+
+device = sys.argv[1]
+cohesion = sys.argv[2]
+
+sim = sphere.sim('cap-cohesion=' + str(cohesion), np=2000)
+sim.defaultParams(capillaryCohesion = cohesion)
+sim.generateRadii(psd='logn', radius_mean=1.0e-3, radius_variance=1.0e-4)
+sim.contactModel(1)
+sim.initRandomGridPos([12, 12, 10000])
+sim.initTemporal(2.0, file_dt=0.01, epsilon=0.07)
+sim.run()
(DIR) diff --git a/python/capillary-cohesion.sh b/python/capillary-cohesion.sh
t@@ -0,0 +1,48 @@
+#!/bin/sh
+#PBS -N cap-cohesion
+#PBS -l nodes=1:ppn=3
+#PBS -l walltime=19200:00:00
+#PBS -q qfermi
+#PBS -M adc@geo.au.dk
+#PBS -m abe
+
+# Grendel CUDA
+source /com/gcc/4.6.4/load.sh
+CUDAPATH=/com/cuda/5.5.22
+export PATH=$HOME/bin:$PATH
+export PATH=$CUDAPATH/bin:$PATH
+export LD_LIBRARY_PATH=$CUDAPATH/lib64:$CUDAPATH/lib:$LD_LIBRARY_PATH
+
+# Manually installed Python modules
+export PYTHONPATH=$HOME/.local/lib/python:$PYTHONPATH
+export PYTHONPATH=$HOME/.local/lib64/python:$PYTHONPATH
+
+# Manually installed Python
+#export PATH=/home/adc/.local/bin:$PATH
+
+# Shared Python2.7
+PYTHON=/com/python/2.7.6
+export PYTHONPATH=$PYTHON/lib:$PYTHONPATH
+export PATH=$PYTHON/bin:$PATH
+
+echo "`whoami`@`hostname`"
+echo "Start at `date`"
+
+ORIGDIR=/home/adc/code/sphere
+#WORKDIR=/scratch/$PBS_JOBID
+WORKDIR=$ORIGDIR
+
+#cp -r $ORIGDIR/* $WORKDIR
+
+cd $WORKDIR
+nvidia-smi
+rm CMakeCache.txt
+cmake . && make
+cd python
+python capillary-cohesion.py 0 0 &
+python capillary-cohesion.py 1 1 &
+wait
+
+#cp $WORKDIR/output/* $ORIGDIR/output/
+
+echo "End at `date`"