• R/O
  • SSH

提交

标签
No Tags

Frequently used words (click to add to your profile)

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

Commit MetaInfo

修订版be27b5118aa0ebdcc1f3afa0ce7cff3528d4c3af (tree)
时间2007-07-10 23:21:44
作者iselllo
Commiteriselllo

Log Message

Now air-mean-free-path.py calculated the total and time-dependent
thermophoretic deposition efficiency assuming a specific representative
size for the particles involved. Also the plots are now saved in a
specific directory.

更改概述

差异

diff -r 8eb0114540a0 -r be27b5118aa0 Python-codes/air-mean-free-path.py
--- a/Python-codes/air-mean-free-path.py Tue Jul 10 14:18:54 2007 +0000
+++ b/Python-codes/air-mean-free-path.py Tue Jul 10 14:21:44 2007 +0000
@@ -2,6 +2,7 @@
22 from scipy import *
33 import pylab
44
5+
56 def v_th(T):
67 k_B=1.38e-23
78 m_air=28.8*1.66e-27
@@ -55,7 +56,7 @@
5556
5657 return K_tb
5758
58-def K_talbot(T):
59+def K_talbot(T,diam_seq):
5960 lam_air=l_air(T)
6061 #print 'lam_air is',lam_air
6162 #print 'diam_seq is', diam_seq
@@ -72,7 +73,7 @@
7273 return K_tb
7374
7475 def V_thermo(T):
75- K=K_talbot(T)
76+ K=K_talbot(T,diam_seq)
7677 nu=nu_T(T)
7778 Re=U*2.*R/nu
7879 Nusselt=0.023*Re**0.8*Prandtl**0.4
@@ -80,107 +81,161 @@
8081 return vel
8182
8283
84+def f_th(T,t):
85+ theta_star=T_w/(T-T_w)
86+ K=K_talbot(T,diam_seq)
87+ nu=nu_T(T) #viscosity, NOT the Nusselt number!
88+ Re=U*2.*R/nu
89+ Nusselt=0.023*Re**0.8*Prandtl**0.4
90+ z=((theta_star+exp(-2.*Nusselt*U*t/(R*Re*Prandtl)))/(1+theta_star))**(Prandtl*K)
91+ return z
92+
93+def f_th_asym(T,t):
94+ theta_star=T_w/(T-T_w)
95+ K=K_talbot(T,diam_seq)
96+ nu=nu_T(T)
97+ Re=U*2.*R/nu
98+ Nusselt=0.023*Re**0.8*Prandtl**0.4
99+ z=(theta_star/(1+theta_star))**(Prandtl*K)
100+ return z
101+
102+
103+
104+
105+
106+
83107 #l_air_vec=vectorize(l_air)
84-T=linspace(293.,450.,100)
85-T_new=T
108+T_seq=linspace(293.,450.,100)
109+#T_new=T
86110 #p=zeros(len(T))
87111 p=101325. #1atm in bars
88112
89-
113+t=linspace(0.,20.,400)
90114
91-l_mean=map(l_air,T)
115+#################################################################################
116+#In the following calculations I vary the temperature and fix the particle size#######
117+#################################################################################
92118
93-diam_seq=70.e-9
119+l_mean=map(l_air,T_seq)
94120
95-pylab.plot(T,l_mean,linewidth=2.)
121+diam_seq=70.e-9 #I fix the particle size
122+
123+pylab.plot(T_seq,l_mean,linewidth=2.)
96124 pylab.xlabel('Temperature[K]',fontsize=20.)
97125 pylab.ylabel('air mean free path [m]',fontsize=20.)
98126 #pylab.legend(('prey population','predator population'))
99127 pylab.title('Air Mean Free Path',fontsize=20.)
100128 pylab.grid(True)
101-pylab.savefig('air_free_path')
129+pylab.savefig('./plots-air-mean-free-paths/air_free_path')
102130
103131 pylab.hold(False)
104132
105-k_air=cond_air(T)
133+k_air=cond_air(T_seq)
106134
107-pylab.plot(T,k_air,linewidth=2.)
135+pylab.plot(T_seq,k_air,linewidth=2.)
108136 pylab.xlabel('Temperature[K]',fontsize=20.)
109137 pylab.ylabel('air conductivity [W/mK]',fontsize=20.)
110138 #pylab.legend(('prey population','predator population'))
111139 pylab.title('Gas Conductivity',fontsize=20.)
112140 pylab.grid(True)
113-pylab.savefig('air_conductivity')
141+pylab.savefig('./plots-air-mean-free-paths/air_conductivity')
114142
115143 pylab.hold(False)
116144
117145
118146
119-mu=mu_T(T)
147+mu=mu_T(T_seq)
120148
121-pylab.plot(T,mu,linewidth=2.)
149+pylab.plot(T_seq,mu,linewidth=2.)
122150 pylab.xlabel('Temperature[K]',fontsize=20.)
123151 pylab.ylabel('air dynamic viscosity [Kg/(m*s)]',fontsize=20.)
124152 #pylab.legend(('prey population','predator population'))
125153 pylab.title('Air dynamic viscosity',fontsize=20.)
126154 pylab.grid(True)
127-pylab.savefig('air_dynamic_viscosity')
155+pylab.savefig('./plots-air-mean-free-paths/air_dynamic_viscosity')
128156
129157 pylab.hold(False)
130158
131-rho=rho_T(T)
159+rho=rho_T(T_seq)
132160
133161
134-pylab.plot(T,rho,linewidth=2.)
162+pylab.plot(T_seq,rho,linewidth=2.)
135163 pylab.xlabel('Temperature[K]',fontsize=20.)
136164 pylab.ylabel('air density [Kg/m**3]',fontsize=20.)
137165 #pylab.legend(('prey population','predator population'))
138166 pylab.title('Air density',fontsize=20.)
139167 pylab.grid(True)
140-pylab.savefig('air_density')
168+pylab.savefig('./plots-air-mean-free-paths/air_density')
141169
142170 pylab.hold(False)
143171
144-pylab.plot(T,mu/rho,linewidth=2.)
172+pylab.plot(T_seq,mu/rho,linewidth=2.)
145173 pylab.xlabel('Temperature[K]',fontsize=20.)
146174 pylab.ylabel('air kinematic viscosity [Kg/(m*s)]',fontsize=20.)
147175 #pylab.legend(('prey population','predator population'))
148176 pylab.title('Air kinematic viscosity',fontsize=20.)
149177 pylab.grid(True)
150-pylab.savefig('air_kinematic_viscosity')
178+pylab.savefig('./plots-air-mean-free-paths/air_kinematic_viscosity')
151179
152180 pylab.hold(False)
153181
154182 #print 'rho and T are', rho, T
155183
184+
185+
186+
187+######################################################################
188+#Now I fix T (i.e. T_0) and consider later on a set of particle sizes#########
189+####################################################################
190+
191+
156192 #Now I choose a particular value of T and save the properties of air
157193 input_air=pylab.load('input_air')
158194 input_air=input_air*1.0 # to get a floating point array
159-T=input_air[0] # careful about what I choose here to get a sensible estimate of air properties
195+T_0=input_air[0] # careful about what I choose here to get a sensible estimate of air properties
160196 T_w=273.+70.
161-print 'T_0 and T_w are', T,T_w
197+print 'T_0 and T_w are', T_0,T_w
162198 data_save=zeros(6)
163199
164-#p=p[1]
165200
166-data_save[0]=T
167-data_save[1]=l_air(T)
168-data_save[2]=nu_T(T)
169-data_save[3]=mu_T(T)
170-data_save[4]=rho_T(T)
201+
202+data_save[0]=T_0
203+data_save[1]=l_air(T_0)
204+data_save[2]=nu_T(T_0)
205+data_save[3]=mu_T(T_0)
206+data_save[4]=rho_T(T_0)
171207 # although it is not calculated here at all, but it is simply an experimental datum,
172208 # I add here the mean axial velocity, which is also included into the input file
173209 U=input_air[1]
174-Prandtl=0.679 # treated a constant
210+Prandtl=0.69 # treated a constant
175211 R=0.05 # radius of the anaconda
176212 data_save[5]=U
177213
214+#Now some calculations of the depositio efficiency: I fixed T_0 and the particle size
215+#is still fixed
216+
217+f_time=f_th(T_0,t)
218+
219+f_no_time=zeros(len(f_time))
220+f_no_time[:]=f_th_asym(T_0,t)
221+
222+#print 'f_no_time is', f_no_time
223+
224+pylab.plot(t,f_time,t,f_no_time,linewidth=2.)
225+pylab.xlabel('Ut [m]',fontsize=20.)
226+pylab.ylabel('Thermophoretic Deposition Efficiency',fontsize=20.)
227+#pylab.legend(('prey population','predator population'))
228+pylab.title('Thermophoretic Deposition',fontsize=20.)
229+pylab.grid(True)
230+pylab.savefig('./plots-air-mean-free-paths/thermophoretic_deposition_efficiency')
231+
232+#pylab.hold(False)
178233
179234 pylab.save("output_air", data_save)
180235
181236 print 'data_save is', data_save
182237
183-nu_2=-1.1555e-14*T**3. + 9.5728e-11*T**2. + 3.7604e-08*T - 3.448e-06
238+nu_2=-1.1555e-14*T_0**3. + 9.5728e-11*T_0**2. + 3.7604e-08*T_0 - 3.448e-06
184239
185240 #print 'the two estimates of nu are', data_save[2], nu_2
186241
@@ -188,21 +243,21 @@
188243 knudsen=logspace(-2.,1.,10)
189244 Ra=1e-3
190245
191-K_thermo=K_talbot_test(T,knudsen,Ra)
246+K_thermo=K_talbot_test(T_0,knudsen,Ra)
192247
193248 #pylab.semilogx(knudsen,K_thermo,linewidth=2.)
194249 #pylab.xlabel('knudsen number',fontsize=20.)
195250 #pylab.ylabel('K_th',fontsize=20.)
196251 #pylab.title('Thermophoretic coefficient',fontsize=20.)
197252 #pylab.grid(True)
198-#pylab.savefig('thermophoretic_coefficient')
253+#pylab.savefig('./plots-air-mean-free-paths/thermophoretic_coefficient')
199254
200255 #pylab.hold(False)
201256
202257
203258 #diam_seq=linspace(2.,600.,100)
204259
205-diam_seq=pylab.load("D_mean_seq")
260+diam_seq=pylab.load("D_mean_seq") #now diam_seq stands for a list of diameters
206261
207262 diam_seq=diam_seq/1e9
208263
@@ -210,7 +265,7 @@
210265
211266 #print "diam_seq is", diam_seq
212267
213-K_bis=K_talbot(T)
268+K_bis=K_talbot(T_0,diam_seq)
214269 #print 'K_bis is', K_bis
215270 print 'the shape of k_bis is', shape(K_bis)
216271
@@ -218,24 +273,27 @@
218273 pylab.plot((diam_seq*1e9),K_bis,linewidth=2.)
219274 pylab.xlabel('diameter [nm]',fontsize=20.)
220275 pylab.ylabel('K_th',fontsize=20.)
221-pylab.title('Thermophoretic coefficient at T=350K',fontsize=20.)
276+pylab.title('Thermophoretic coefficient at fixed T-T_w',fontsize=20.)
222277 pylab.grid(True)
223-pylab.savefig('thermophoretic_coefficient_vs_particle_diameter')
278+pylab.savefig('./plots-air-mean-free-paths/thermophoretic_coefficient_vs_particle_diameter')
224279
225280 pylab.hold(False)
226281
227-V_th=V_thermo(T)
282+V_th=V_thermo(T_0)
283+
284+
228285
229286 pylab.plot((diam_seq*1e9),V_th,linewidth=2.)
230287 pylab.xlabel('diameter [nm]',fontsize=20.)
231288 pylab.ylabel('K_th',fontsize=20.)
232-pylab.title('Thermophoretic velocity',fontsize=20.)
289+pylab.title('Thermophoretic velocity at fixed T-T_w',fontsize=20.)
233290 pylab.grid(True)
234-pylab.savefig('thermophoretic_velocity_vs_particle_diameter')
291+pylab.savefig('./plots-air-mean-free-paths/thermophoretic_velocity_vs_particle_diameter')
235292
236293 pylab.hold(False)
237294
238295 pylab.save('v_thermophoresis',V_th)
239296
297+#Now I calculate the deposition efficiency
240298
241299 print 'So far so good'
\ No newline at end of file