timproved result analysis script - sphere - GPU-based 3D discrete element metho… | |
git clone git://src.adamsgaard.dk/sphere | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit 0bddc01962a2c7484665b22c57e537b6f2648513 | |
parent 20e9d14ac850a06a0781cb700d8bdd65381fd1c0 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Wed, 13 Aug 2014 11:32:55 +0200 | |
improved result analysis script | |
Diffstat: | |
M python/permeability-results.py | 38 ++++++++++++++++++++++-------… | |
M python/permeabilitycalculator.py | 6 ++++++ | |
2 files changed, 33 insertions(+), 11 deletions(-) | |
--- | |
diff --git a/python/permeability-results.py b/python/permeability-results.py | |
t@@ -1,15 +1,31 @@ | |
#!/usr/bin/env python | |
+import numpy | |
+import matplotlib.pyplot as plt | |
from permeabilitycalculator import * | |
- | |
-pc = PermeabilityCalc('permeability-dp=1000.0') | |
-pc = PermeabilityCalc('permeability-dp=1000.0-c_phi=1.0-c_grad_p=0.01') | |
-pc = PermeabilityCalc('permeability-dp=1000.0-c_phi=1.0-c_grad_p=0.5') | |
-pc = PermeabilityCalc('permeability-dp=20000.0-c_phi=1.0-c_grad_p=0.01') | |
-pc = PermeabilityCalc('permeability-dp=20000.0-c_phi=1.0-c_grad_p=0.1') | |
-pc = PermeabilityCalc('permeability-dp=20000.0-c_phi=1.0-c_grad_p=0.5') | |
+sids = [ | |
+ 'permeability-dp=1000.0', | |
+ 'permeability-dp=1000.0-c_phi=1.0-c_grad_p=0.01', | |
+ 'permeability-dp=1000.0-c_phi=1.0-c_grad_p=0.5', | |
+ 'permeability-dp=20000.0-c_phi=1.0-c_grad_p=0.01', | |
+ 'permeability-dp=20000.0-c_phi=1.0-c_grad_p=0.1', | |
+ 'permeability-dp=20000.0-c_phi=1.0-c_grad_p=0.5', | |
+ 'permeability-dp=4000.0-c_phi=1.0-c_grad_p=0.01', | |
+ 'permeability-dp=4000.0-c_phi=1.0-c_grad_p=0.1', | |
+ 'permeability-dp=4000.0-c_phi=1.0-c_grad_p=0.5', | |
+ 'permeability-dp=4000.0'] | |
+ | |
+K = numpy.array([]) | |
+c_grad_p = numpy.array([]) | |
-pc = PermeabilityCalc('permeability-dp=4000.0') | |
-pc = PermeabilityCalc('permeability-dp=4000.0-c_phi=1.0-c_grad_p=0.01') | |
-pc = PermeabilityCalc('permeability-dp=4000.0-c_phi=1.0-c_grad_p=0.1') | |
-pc = PermeabilityCalc('permeability-dp=4000.0-c_phi=1.0-c_grad_p=0.5') | |
+for sid in sids: | |
+ pc = PermeabilityCalc(sid) | |
+ K.append(pc.conductivity()) | |
+ c_grad_p.append(pc.c_grad_p()) | |
+ | |
+fig = plt.figure() | |
+plt.xlabel('Pressure gradient coefficient $c$ [-]') | |
+plt.ylabel('Hydraulic conductivity $K$ [m/s]') | |
+plt.plot(c_grad_p, K) | |
+plt.grid() | |
+plt.savefig('c_grad_p-vs-K.png') | |
diff --git a/python/permeabilitycalculator.py b/python/permeabilitycalculator.py | |
t@@ -36,6 +36,12 @@ class PermeabilityCalc: | |
#self.K = self.k/self.sim.mu # m/s | |
self.K = -self.Q * self.dL / (self.A * self.dP) | |
+ def conductivity(self): | |
+ return self.K[0] | |
+ | |
+ def c_grad_p(self): | |
+ return self.sim.c_grad_p[0] | |
+ | |
def findMeanPorosity(self): | |
''' calculate mean porosity in cells beneath the top wall ''' | |