tadd scripts to run shear stress experiments - sphere - GPU-based 3D discrete e… | |
git clone git://src.adamsgaard.dk/sphere | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit 99e7dacadb6941ca9a203b9f1e1c97061dbdffdd | |
parent 38c7419dbccb794b96f579bbb3807d3b0647595f | |
Author: Anders Damsgaard <[email protected]> | |
Date: Thu, 15 Jan 2015 15:50:41 +0100 | |
add scripts to run shear stress experiments | |
Diffstat: | |
A python/halfshear-darcy-stress-star… | 87 +++++++++++++++++++++++++++… | |
A python/halfshear-dry-ss.sh | 50 +++++++++++++++++++++++++++++… | |
A python/halfshear-imper-ss.sh | 50 +++++++++++++++++++++++++++++… | |
A python/halfshear-per-ss.sh | 50 +++++++++++++++++++++++++++++… | |
4 files changed, 237 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/python/halfshear-darcy-stress-starter.py b/python/halfshear-darcy-… | |
t@@ -0,0 +1,87 @@ | |
+#!/usr/bin/env python | |
+import sphere | |
+import numpy | |
+import sys | |
+ | |
+# launch with: | |
+# $ ipython halfshear-darcy-stress-starter.py <device> <fluid> <c_phi> <k_c> <… | |
+ | |
+device = int(sys.argv[1]) | |
+wet = int(sys.argv[2]) | |
+c_phi = float(sys.argv[3]) | |
+k_c = float(sys.argv[4]) | |
+sigma0 = float(sys.argv[5]) | |
+mu = float(sys.argv[6]) | |
+shear_stress = float(sys.argv[7]) | |
+ | |
+if wet == 1: | |
+ fluid = True | |
+else: | |
+ fluid = False | |
+ | |
+sim = sphere.sim('halfshear-sigma0=' + str(sigma0), fluid=False) | |
+print('Input: ' + sim.sid) | |
+sim.readlast() | |
+ | |
+sim.fluid = fluid | |
+if fluid: | |
+ sim.id('halfshear-darcy-sigma0=' + str(sigma0) + '-k_c=' + str(k_c) + \ | |
+ '-mu=' + str(mu) + '-ss=' + str(shear_stress) + '-shear') | |
+else: | |
+ sim.id('halfshear-sigma0=' + str(sigma0) + '-ss=' + str(shear_stress) + \ | |
+ '-shear') | |
+ | |
+sim.checkerboardColors(nx=6,ny=3,nz=6) | |
+sim.cleanup() | |
+sim.adjustUpperWall() | |
+sim.zeroKinematics() | |
+ | |
+#sim.shear(0.0/20.0) | |
+#sim.shear(1.0/20.0 * velfac) | |
+sim.shear(shear_stress = shear_stress) | |
+K_q_real = 36.4e9 | |
+K_w_real = 2.2e9 | |
+K_q_sim = 1.16e9 | |
+K_w_sim = K_w_real/K_q_real * K_q_sim | |
+ | |
+if fluid: | |
+ #sim.num[2] *= 2 | |
+ sim.num[:] /= 2 | |
+ #sim.L[2] *= 2.0 | |
+ #sim.initFluid(mu = 1.787e-6, p = 600.0e3, cfd_solver = 1) | |
+ sim.initFluid(mu = mu, p = 0.0, cfd_solver = 1) | |
+ sim.setFluidBottomNoFlow() | |
+ sim.setFluidTopFixedPressure() | |
+ #sim.setDEMstepsPerCFDstep(10) | |
+ sim.setMaxIterations(2e5) | |
+ sim.setPermeabilityPrefactor(k_c) | |
+ sim.setFluidCompressibility(1.0/K_w_sim) | |
+ | |
+sim.w_sigma0[0] = sigma0 | |
+sim.w_m[0] = numpy.abs(sigma0*sim.L[0]*sim.L[1]/sim.g[2]) | |
+ | |
+#sim.setStiffnessNormal(36.4e9 * 0.1 / 2.0) | |
+#sim.setStiffnessTangential(36.4e9/3.0 * 0.1 / 2.0) | |
+sim.setStiffnessNormal(K_q_sim) | |
+sim.setStiffnessTangential(K_q_sim) | |
+sim.mu_s[0] = 0.5 | |
+sim.mu_d[0] = 0.5 | |
+sim.setDampingNormal(0.0) | |
+sim.setDampingTangential(0.0) | |
+#sim.deleteAllParticles() | |
+#sim.fixvel[:] = -1.0 | |
+ | |
+sim.initTemporal(total = 20.0, file_dt = 0.01, epsilon=0.07) | |
+#sim.time_dt[0] *= 1.0e-2 | |
+#sim.initTemporal(total = 1.0e-4, file_dt = 1.0e-5, epsilon=0.07) | |
+ | |
+# Fix lowermost particles | |
+#dz = sim.L[2]/sim.num[2] | |
+#I = numpy.nonzero(sim.x[:,2] < 1.5*dz) | |
+#sim.fixvel[I] = 1 | |
+ | |
+sim.run(dry=True) | |
+sim.run(device=device) | |
+sim.writeVTKall() | |
+#sim.visualize('walls') | |
+#sim.visualize('fluid-pressure') | |
diff --git a/python/halfshear-dry-ss.sh b/python/halfshear-dry-ss.sh | |
t@@ -0,0 +1,50 @@ | |
+#!/bin/sh | |
+#PBS -N hs-dry-ss | |
+#PBS -l nodes=1:ppn=3 | |
+#PBS -l walltime=48:00:00 | |
+#PBS -q qfermi | |
+#PBS -M [email protected] | |
+#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 | |
+# $ ipython halfshear-darcy-stress-starter.py <device> <fluid> <c_phi> <k_c> <… | |
+python halfshear-darcy-stress-starter.py 0 0 1.0 3.5e-13 20000.0 1.797e-06 100… | |
+python halfshear-darcy-stress-starter.py 1 0 1.0 3.5e-13 20000.0 1.797e-06 125… | |
+python halfshear-darcy-stress-starter.py 2 0 1.0 3.5e-13 20000.0 1.797e-06 150… | |
+wait | |
+ | |
+#cp $WORKDIR/output/* $ORIGDIR/output/ | |
+ | |
+echo "End at `date`" | |
diff --git a/python/halfshear-imper-ss.sh b/python/halfshear-imper-ss.sh | |
t@@ -0,0 +1,50 @@ | |
+#!/bin/sh | |
+#PBS -N hs-imper-ss | |
+#PBS -l nodes=1:ppn=3 | |
+#PBS -l walltime=48:00:00 | |
+#PBS -q qfermi | |
+#PBS -M [email protected] | |
+#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 | |
+# $ ipython halfshear-darcy-stress-starter.py <device> <fluid> <c_phi> <k_c> <… | |
+python halfshear-darcy-stress-starter.py 0 1 1.0 3.5e-15 20000.0 1.797e-06 100… | |
+python halfshear-darcy-stress-starter.py 1 1 1.0 3.5e-15 20000.0 1.797e-06 125… | |
+python halfshear-darcy-stress-starter.py 2 1 1.0 3.5e-15 20000.0 1.797e-06 150… | |
+wait | |
+ | |
+#cp $WORKDIR/output/* $ORIGDIR/output/ | |
+ | |
+echo "End at `date`" | |
diff --git a/python/halfshear-per-ss.sh b/python/halfshear-per-ss.sh | |
t@@ -0,0 +1,50 @@ | |
+#!/bin/sh | |
+#PBS -N hs-per-ss | |
+#PBS -l nodes=1:ppn=3 | |
+#PBS -l walltime=48:00:00 | |
+#PBS -q qfermi | |
+#PBS -M [email protected] | |
+#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 | |
+# $ ipython halfshear-darcy-stress-starter.py <device> <fluid> <c_phi> <k_c> <… | |
+python halfshear-darcy-stress-starter.py 0 1 1.0 3.5e-13 20000.0 1.797e-06 100… | |
+python halfshear-darcy-stress-starter.py 1 1 1.0 3.5e-13 20000.0 1.797e-06 125… | |
+python halfshear-darcy-stress-starter.py 2 1 1.0 3.5e-13 20000.0 1.797e-06 150… | |
+wait | |
+ | |
+#cp $WORKDIR/output/* $ORIGDIR/output/ | |
+ | |
+echo "End at `date`" |