-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWater_vapor_plot_script
75 lines (73 loc) · 3.11 KB
/
Water_vapor_plot_script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/python
#
# To-do list: Adapt this to plot the water vapor data
#
import matplotlib.pyplot as plt
import numpy as np
#
dpiRatio = 300.0/80.0
DishRadius = 0.03
WaterHeight = 0.0035368
GapDistance = 0.0064632
NeedleRadius = .00062
arrowShrinkSize = 0.1
figureFontSize = 12
arrowWidth = 1
#
WaterData = np.loadtxt('H2O.txt')
i = 0
a,b = WaterData.shape
ainitial = a
while i < a:
if np.isnan(WaterData[i,2]):
WaterData = np.delete(WaterData, (i), axis = 0)
a,b = WaterData.shape
else:
i = i + 1
#
afinal = a
#
Nx1, idx1 = np.unique(WaterData[:,0], return_inverse=True)
Nx2, idx2 = np.unique(WaterData[:,1], return_inverse=True)
#
Water = np.empty((Nx1.shape[0],Nx2.shape[0]))
Water[idx1,idx2] = WaterData[:,2]
#
r, z = np.meshgrid(Nx1, Nx2)
#
Water_min, Water_max = np.min(Water), np.max(Water)
#
#fig = plt.figure(figsize=(6.5,5.0), dpi = 80)
fig = plt.figure()
ax = fig.add_subplot(111)
ax.set_aspect((z.max()-z.min())/(r.max()-r.min()))
#
cax = plt.pcolor(r, z, Water.transpose(), cmap = 'jet', vmin= 0, vmax = Water_max, rasterized = True)
plt.axis([r.min(),r.max()+0.001,z.min(),z.max()])
cbar = plt.colorbar()
cbar.set_label('Water Vapor Density (m^-3)')
plt.xlabel('r (m)',fontsize = figureFontSize)
plt.ylabel('z (m)', fontsize = figureFontSize)
#
plt.annotate('Gas-liquid interface', xy=(0.017,0), xytext=(0.010,0.004),arrowprops=dict(facecolor='black',shrink=arrowShrinkSize, width = arrowWidth), fontsize = figureFontSize)
plt.annotate('Dish wall', xy=(DishRadius,0.002), xytext=(DishRadius-0.01, 0.01),arrowprops=dict(facecolor='black',shrink=arrowShrinkSize, width=arrowWidth), fontsize = figureFontSize)
#plt.annotate('Needle/jet outer wall',xy=(NeedleRadius+2.5e-4,0.02), xytext=(0.01,0.022), arrowprops=dict(facecolor='black',shrink=arrowShrinkSize, width = arrowWidth), fontsize = figureFontSize)
plt.annotate('Needle tip/jet outlet', xy = (NeedleRadius+2e-4,GapDistance), xytext = (0.005,0.015),arrowprops=dict(facecolor='black',shrink=arrowShrinkSize,width=arrowWidth), fontsize = figureFontSize)
plt.annotate('Symmetry axis', xy = (0,0.022), xytext = (35,0), textcoords = 'offset points', ha = 'left', va = 'center', arrowprops=dict(facecolor='black',shrink=arrowShrinkSize,width=arrowWidth), fontsize = figureFontSize)
#
plt.plot([DishRadius, DishRadius],[-WaterHeight,GapDistance], color='k', linestyle = '-', linewidth = 2)
plt.plot([NeedleRadius,NeedleRadius],[GapDistance,DishRadius-WaterHeight], color='k', linestyle = '-', linewidth = 2)
plt.plot([NeedleRadius+1e-4,NeedleRadius+1e-4],[GapDistance,DishRadius-WaterHeight], color='k', linestyle = '-', linewidth = 2)
plt.plot([NeedleRadius+2e-4,NeedleRadius+2e-4],[GapDistance,DishRadius-WaterHeight], color='k', linestyle = '-', linewidth = 2)
plt.plot([0,DishRadius],[0,0], color='k', linestyle = '-', linewidth = 2)
#
ax.text(0.020, 0.023, 'Gas phase', fontsize = figureFontSize)
#ax.text(0.020, -0.003, 'Liquid phase', fontsize = figureFontSize)
#
#fig.savefig('test.png',dpi=300)
#fig.savefig('test2.png',dpi=50)
#fig.savefig('test.eps',format='eps',dpi=1000)
#fig.savefig('test2.eps',format='eps',dpi=80)
fig.savefig('WaterVapor2D.eps',format='eps')
#
plt.show()