-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHNO3_convection_2D_plot_script
108 lines (106 loc) · 4.32 KB
/
HNO3_convection_2D_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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/usr/bin/python
#
# To-do list: Adapt this to plot the HNO3Convection vapor data
#
import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np
#
dpiRatio = 300.0/80.0
DishRadius = 0.03
WaterHeight = 0.0035368
GapDistance = 0.0064632
NeedleRadius = .00062
arrowShrinkSize = 0.1
arrowWidth = 1
fontColor = 'r'
darkColor = 'k'
mpl.rcParams.update({'font.size': 16})
#mpl.rcParams.update({'font.color': fontColor})
#
HNO3DiffusionData = np.loadtxt('HNO3_convection.txt')
i = 0
a,b = HNO3DiffusionData.shape
ainitial = a
while i < a:
if np.isnan(HNO3DiffusionData[i,2]):
HNO3DiffusionData = np.delete(HNO3DiffusionData, (i), axis = 0)
a,b = HNO3DiffusionData.shape
else:
i = i + 1
#
afinal = a
#
Nx1, idx1 = np.unique(HNO3DiffusionData[:,0], return_inverse=True)
Nx2, idx2 = np.unique(HNO3DiffusionData[:,1], return_inverse=True)
#
HNO3Diffusion = np.empty((Nx1.shape[0],Nx2.shape[0]))
HNO3Diffusion[idx1,idx2] = HNO3DiffusionData[:,2]
#
r, z = np.meshgrid(Nx1, Nx2)
#
HNO3Diffusion_min, HNO3Diffusion_max = np.min(HNO3Diffusion), np.max(HNO3Diffusion)
#
NO3mDiffusionData = np.loadtxt('NO3m_convection.txt')
i = 0
a,b = NO3mDiffusionData.shape
ainitial = a
while i < a:
if np.isnan(NO3mDiffusionData[i,2]):
NO3mDiffusionData = np.delete(NO3mDiffusionData, (i), axis = 0)
a,b = NO3mDiffusionData.shape
else:
i = i + 1
#
afinal = a
#
Nx1, idx1 = np.unique(NO3mDiffusionData[:,0], return_inverse=True)
Nx2, idx2 = np.unique(NO3mDiffusionData[:,1], return_inverse=True)
#
NO3mDiffusion = np.empty((Nx1.shape[0],Nx2.shape[0]))
NO3mDiffusion[idx1,idx2] = NO3mDiffusionData[:,2]
#
r2, z2 = np.meshgrid(Nx1, Nx2)
#
NO3mDiffusion_min, NO3mDiffusion_max = np.min(NO3mDiffusion), np.max(NO3mDiffusion)
#
#fig = plt.figure(figsize=(6.5,5.0), dpi = 80)
fig = plt.figure()
ax = fig.add_subplot(111)
ax.set_aspect(1.0)
#
HNO3DiffusionAx = plt.pcolor(r, z, HNO3Diffusion.transpose(), cmap = 'jet', vmin= 0, vmax = HNO3Diffusion_max, rasterized = True)
HNO3DiffusionBar = plt.colorbar()
#HNO3DiffusionBar = plt.colorbar(ticks = [0.0, 1.0e16, 2.0e16, 3.0e16, 4.0e16, 5.0e16, 6.0e16, 7.0e16, 8.0e16])
HNO3DiffusionBar.set_label('Gaseous Nitric Acid Density (m^-3)')
#HNO3DiffusionBar.ax.set_yticklabels(['0.00','1.00','2.00','3.00','4.00','5.00','6.00','7.00','8.00'])
NO3mDiffusionAx = plt.pcolor(r2, z2, NO3mDiffusion.transpose(), cmap = 'jet', vmin= 0, vmax = NO3mDiffusion_max, rasterized = True)
NO3mDiffusionBar = plt.colorbar()
NO3mDiffusionBar.set_label('Aqueous Nitrate Density (m^-3)')
plt.axis([0.0,DishRadius+0.001,-WaterHeight,DishRadius-WaterHeight])
#
plt.xlabel('r (m)')
plt.ylabel('z (m)')
#
plt.annotate('Gas-liquid interface', xy=(0.017,0), xytext=(0.010,0.004), color = fontColor, arrowprops=dict(facecolor='fontColor',shrink=arrowShrinkSize, width = arrowWidth, color = fontColor))
plt.annotate('Dish wall', xy=(DishRadius,0.002), xytext=(DishRadius-0.01, 0.01), color = fontColor, arrowprops=dict(color=fontColor,shrink=arrowShrinkSize, width=arrowWidth))
#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))
plt.annotate('Needle tip/jet outlet', xy = (NeedleRadius+2e-4,GapDistance), xytext = (0.005,0.015), color = fontColor, arrowprops=dict(color = fontColor, shrink=arrowShrinkSize,width=arrowWidth))
plt.annotate('Symmetry axis', xy = (0,-0.002), xytext = (0.002,-WaterHeight/2-0.001),color = darkColor, arrowprops=dict(color = darkColor, shrink=arrowShrinkSize,width=arrowWidth))
#
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', color = fontColor)
ax.text(0.018, -0.003, 'Liquid phase')
#
ax.set_xticks([0.000, 0.010, 0.020, 0.030])
ax.set_xticklabels(['0.000','0.010','0.020','0.030'])
#
#fig.savefig('test.png',dpi=80)
fig.savefig('HNO3Convection2D.eps',format='eps')
#
plt.show()