• R/O
  • SSH

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisión984b2e295e24b79e3bf0ac393ee70649ea8d4830 (tree)
Tiempo2007-07-13 23:02:20
Autoriselllo
Commiteriselllo

Log Message

I added the code plot_section.py, which is useful to plot e.g. a
countour plot of the axial velocity along a cross section of the tube.
As an input, it simply needs a snapshot of v_z along the whole pipe (or
directly along a cross-section of the pipe).

Cambiar Resumen

Diferencia incremental

diff -r a9e32a8d3ded -r 984b2e295e24 Python-codes/plot_section.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Python-codes/plot_section.py Fri Jul 13 14:02:20 2007 +0000
@@ -0,0 +1,59 @@
1+#! /usr/bin/env python
2+from scipy import *
3+import pylab
4+
5+nt=129
6+nr=88
7+nz=129
8+read3d=0
9+
10+if (read3d!=0):
11+
12+ vel3d=pylab.load("vsection")
13+ print 'the shape of vel3d is', shape(vel3d)
14+ vel3d=vel3d.reshape(nt,nr,nz)
15+ vel_section=vel3d[:,:,65]
16+ pylab.save("vel_cross_section",vel_section)
17+
18+elif (read3d==0):
19+ vel_section=pylab.load("vel_cross_section")
20+
21+rg2=pylab.load("rg2.out")
22+r=rg2[:,0]
23+
24+pylab.hold(False)
25+# the following plot is just a test to make sure I can read the cross-section file correctly
26+pylab.plot(r,vel_section[34,:])
27+
28+pylab.xlabel('Radial Coordinate')
29+pylab.ylabel('Vz')
30+pylab.title('Radial Grid')
31+pylab.grid(True)
32+pylab.savefig("test-plot")
33+pylab.hold(False)
34+#now I create a grid for the cross-section plotting
35+
36+theta=linspace(0.,2.*pi,nt)
37+#print "theta is ", theta
38+sin_t=sin(theta)
39+cos_t=cos(theta)
40+rsin_t=r[newaxis,:]*sin_t[:,newaxis]
41+rcos_t=r[newaxis,:]*cos_t[:,newaxis]
42+rsin_t=ravel(rsin_t)
43+rcos_t=ravel(rcos_t)
44+
45+rsin_t.shape=(nt,nr)
46+rcos_t.shape=(nt,nr)
47+
48+
49+#pylab.colorbar()
50+pylab.clf()
51+pylab.contourf(rsin_t.transpose(), rcos_t.transpose(), vel_section.transpose(),interpolation="bilinear")
52+pylab.colorbar()
53+
54+#pylab.show()
55+
56+pylab.savefig("velocity_on_section.pdf")
57+pylab.hold(False)
58+
59+print 'So far so good'
\ No newline at end of file