Introduction
Introduction Statistics Contact Development Disclaimer Help
tfinalize plotting routine - sphere - GPU-based 3D discrete element method algo…
git clone git://src.adamsgaard.dk/sphere
Log
Files
Refs
LICENSE
---
commit cb202e45887b3246e155760cef1ecfef296ab0c2
parent f8105c6601545b7c196f9273330dc5b3a75c6e18
Author: Anders Damsgaard <[email protected]>
Date: Thu, 4 Sep 2014 12:37:59 +0200
finalize plotting routine
Diffstat:
M python/diffusivity-results.py | 50 ++++++++++++++++++++---------…
1 file changed, 33 insertions(+), 17 deletions(-)
---
diff --git a/python/diffusivity-results.py b/python/diffusivity-results.py
t@@ -7,38 +7,54 @@ import os
import sphere
import numpy
import matplotlib.pyplot as plt
-import diffusivitycalc
-
+#import diffusivitycalc
c_phi = 1.0
c_grad_p = 1.0
-sigma0_list = numpy.array([5.0e3, 10.0e3, 20.0e3, 40.0e3, 80.0e3, 160.0e3])
-alpha = numpy.empty(len(sigma0_list))
+#sigma0_list = numpy.array([5.0e3, 10.0e3, 20.0e3, 40.0e3, 80.0e3, 160.0e3])
+sigma0_list = numpy.array([10.0e3, 20.0e3, 40.0e3, 80.0e3, 160.0e3])
+alpha = numpy.empty_like(sigma0_list)
+phi_bar = numpy.empty_like(sigma0_list)
-dc = diffusivitycalc.DiffusivityCalc()
+#dc = diffusivitycalc.DiffusivityCalc()
i = 0
for sigma0 in sigma0_list:
- sim = sphere.sim('cons-sigma0=' + str(sigma0) + '-c_phi=' + \
- str(c_phi) + '-c_grad_p=' + str(c_grad_p), fluid=True)
+ sid = 'cons-sigma0=' + str(sigma0) + '-c_phi=' + \
+ str(c_phi) + '-c_grad_p=' + str(c_grad_p)
+ if os.path.isfile('../output/' + sid + '.status.dat'):
+ sim = sphere.sim(sid, fluid=True)
+
+ sim.visualize('walls')
+ sim.plotLoadCurve()
+ alpha[i] = sim.c_v
+ phi_bar[i] = sim.phi_bar
+ #sim.writeVTKall()
- sim.visualize('walls')
- sim.plotLoadCurve()
- #sim.writeVTKall()
+ else:
+ print(sid + ' not found')
i += 1
+fig, ax1 = plt.subplots()
+sigma0_list /= 1000.0
+
-plt.xlabel('Normal stress $\\sigma_0$ [kPa]')
-plt.ylabel('Hydraulic diffusivity $\\alpha$ [m$^2$s$^{-1}$]')
#plt.ticklabel_format(style='sci', axis='y', scilimits=(0,0))
-sigma0 /= 1000.0
-plt.plot(sigma0, alpha, 'o-k')
-plt.grid()
+ax1.plot(sigma0_list, alpha, '.-k')
+ax1.set_xlabel('Normal stress $\\sigma_0$ [kPa]')
+ax1.set_ylabel('Hydraulic diffusivity $\\alpha$ [m$^2$s$^{-1}$]')
+#ax1.grid()
+
+ax2 = ax1.twinx()
+color = 'b'
+ax2.plot(sigma0_list, phi_bar, '.--' + color)
+ax2.set_ylabel('Mean porosity $\\bar{\\phi}$ [-]')
+for tl in ax2.get_yticklabels():
+ tl.set_color(color)
-plt.tight_layout()
filename = 'diffusivity-sigma0-vs-alpha.pdf'
+plt.tight_layout()
plt.savefig(filename)
print(os.getcwd() + '/' + filename)
-plt.savefig(filename)
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.