修订版 | be27b5118aa0ebdcc1f3afa0ce7cff3528d4c3af (tree) |
---|---|
时间 | 2007-07-10 23:21:44 |
作者 | iselllo |
Commiter | iselllo |
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.
@@ -2,6 +2,7 @@ | ||
2 | 2 | from scipy import * |
3 | 3 | import pylab |
4 | 4 | |
5 | + | |
5 | 6 | def v_th(T): |
6 | 7 | k_B=1.38e-23 |
7 | 8 | m_air=28.8*1.66e-27 |
@@ -55,7 +56,7 @@ | ||
55 | 56 | |
56 | 57 | return K_tb |
57 | 58 | |
58 | -def K_talbot(T): | |
59 | +def K_talbot(T,diam_seq): | |
59 | 60 | lam_air=l_air(T) |
60 | 61 | #print 'lam_air is',lam_air |
61 | 62 | #print 'diam_seq is', diam_seq |
@@ -72,7 +73,7 @@ | ||
72 | 73 | return K_tb |
73 | 74 | |
74 | 75 | def V_thermo(T): |
75 | - K=K_talbot(T) | |
76 | + K=K_talbot(T,diam_seq) | |
76 | 77 | nu=nu_T(T) |
77 | 78 | Re=U*2.*R/nu |
78 | 79 | Nusselt=0.023*Re**0.8*Prandtl**0.4 |
@@ -80,107 +81,161 @@ | ||
80 | 81 | return vel |
81 | 82 | |
82 | 83 | |
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 | + | |
83 | 107 | #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 | |
86 | 110 | #p=zeros(len(T)) |
87 | 111 | p=101325. #1atm in bars |
88 | 112 | |
89 | - | |
113 | +t=linspace(0.,20.,400) | |
90 | 114 | |
91 | -l_mean=map(l_air,T) | |
115 | +################################################################################# | |
116 | +#In the following calculations I vary the temperature and fix the particle size####### | |
117 | +################################################################################# | |
92 | 118 | |
93 | -diam_seq=70.e-9 | |
119 | +l_mean=map(l_air,T_seq) | |
94 | 120 | |
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.) | |
96 | 124 | pylab.xlabel('Temperature[K]',fontsize=20.) |
97 | 125 | pylab.ylabel('air mean free path [m]',fontsize=20.) |
98 | 126 | #pylab.legend(('prey population','predator population')) |
99 | 127 | pylab.title('Air Mean Free Path',fontsize=20.) |
100 | 128 | pylab.grid(True) |
101 | -pylab.savefig('air_free_path') | |
129 | +pylab.savefig('./plots-air-mean-free-paths/air_free_path') | |
102 | 130 | |
103 | 131 | pylab.hold(False) |
104 | 132 | |
105 | -k_air=cond_air(T) | |
133 | +k_air=cond_air(T_seq) | |
106 | 134 | |
107 | -pylab.plot(T,k_air,linewidth=2.) | |
135 | +pylab.plot(T_seq,k_air,linewidth=2.) | |
108 | 136 | pylab.xlabel('Temperature[K]',fontsize=20.) |
109 | 137 | pylab.ylabel('air conductivity [W/mK]',fontsize=20.) |
110 | 138 | #pylab.legend(('prey population','predator population')) |
111 | 139 | pylab.title('Gas Conductivity',fontsize=20.) |
112 | 140 | pylab.grid(True) |
113 | -pylab.savefig('air_conductivity') | |
141 | +pylab.savefig('./plots-air-mean-free-paths/air_conductivity') | |
114 | 142 | |
115 | 143 | pylab.hold(False) |
116 | 144 | |
117 | 145 | |
118 | 146 | |
119 | -mu=mu_T(T) | |
147 | +mu=mu_T(T_seq) | |
120 | 148 | |
121 | -pylab.plot(T,mu,linewidth=2.) | |
149 | +pylab.plot(T_seq,mu,linewidth=2.) | |
122 | 150 | pylab.xlabel('Temperature[K]',fontsize=20.) |
123 | 151 | pylab.ylabel('air dynamic viscosity [Kg/(m*s)]',fontsize=20.) |
124 | 152 | #pylab.legend(('prey population','predator population')) |
125 | 153 | pylab.title('Air dynamic viscosity',fontsize=20.) |
126 | 154 | pylab.grid(True) |
127 | -pylab.savefig('air_dynamic_viscosity') | |
155 | +pylab.savefig('./plots-air-mean-free-paths/air_dynamic_viscosity') | |
128 | 156 | |
129 | 157 | pylab.hold(False) |
130 | 158 | |
131 | -rho=rho_T(T) | |
159 | +rho=rho_T(T_seq) | |
132 | 160 | |
133 | 161 | |
134 | -pylab.plot(T,rho,linewidth=2.) | |
162 | +pylab.plot(T_seq,rho,linewidth=2.) | |
135 | 163 | pylab.xlabel('Temperature[K]',fontsize=20.) |
136 | 164 | pylab.ylabel('air density [Kg/m**3]',fontsize=20.) |
137 | 165 | #pylab.legend(('prey population','predator population')) |
138 | 166 | pylab.title('Air density',fontsize=20.) |
139 | 167 | pylab.grid(True) |
140 | -pylab.savefig('air_density') | |
168 | +pylab.savefig('./plots-air-mean-free-paths/air_density') | |
141 | 169 | |
142 | 170 | pylab.hold(False) |
143 | 171 | |
144 | -pylab.plot(T,mu/rho,linewidth=2.) | |
172 | +pylab.plot(T_seq,mu/rho,linewidth=2.) | |
145 | 173 | pylab.xlabel('Temperature[K]',fontsize=20.) |
146 | 174 | pylab.ylabel('air kinematic viscosity [Kg/(m*s)]',fontsize=20.) |
147 | 175 | #pylab.legend(('prey population','predator population')) |
148 | 176 | pylab.title('Air kinematic viscosity',fontsize=20.) |
149 | 177 | pylab.grid(True) |
150 | -pylab.savefig('air_kinematic_viscosity') | |
178 | +pylab.savefig('./plots-air-mean-free-paths/air_kinematic_viscosity') | |
151 | 179 | |
152 | 180 | pylab.hold(False) |
153 | 181 | |
154 | 182 | #print 'rho and T are', rho, T |
155 | 183 | |
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 | + | |
156 | 192 | #Now I choose a particular value of T and save the properties of air |
157 | 193 | input_air=pylab.load('input_air') |
158 | 194 | 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 | |
160 | 196 | 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 | |
162 | 198 | data_save=zeros(6) |
163 | 199 | |
164 | -#p=p[1] | |
165 | 200 | |
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) | |
171 | 207 | # although it is not calculated here at all, but it is simply an experimental datum, |
172 | 208 | # I add here the mean axial velocity, which is also included into the input file |
173 | 209 | U=input_air[1] |
174 | -Prandtl=0.679 # treated a constant | |
210 | +Prandtl=0.69 # treated a constant | |
175 | 211 | R=0.05 # radius of the anaconda |
176 | 212 | data_save[5]=U |
177 | 213 | |
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) | |
178 | 233 | |
179 | 234 | pylab.save("output_air", data_save) |
180 | 235 | |
181 | 236 | print 'data_save is', data_save |
182 | 237 | |
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 | |
184 | 239 | |
185 | 240 | #print 'the two estimates of nu are', data_save[2], nu_2 |
186 | 241 |
@@ -188,21 +243,21 @@ | ||
188 | 243 | knudsen=logspace(-2.,1.,10) |
189 | 244 | Ra=1e-3 |
190 | 245 | |
191 | -K_thermo=K_talbot_test(T,knudsen,Ra) | |
246 | +K_thermo=K_talbot_test(T_0,knudsen,Ra) | |
192 | 247 | |
193 | 248 | #pylab.semilogx(knudsen,K_thermo,linewidth=2.) |
194 | 249 | #pylab.xlabel('knudsen number',fontsize=20.) |
195 | 250 | #pylab.ylabel('K_th',fontsize=20.) |
196 | 251 | #pylab.title('Thermophoretic coefficient',fontsize=20.) |
197 | 252 | #pylab.grid(True) |
198 | -#pylab.savefig('thermophoretic_coefficient') | |
253 | +#pylab.savefig('./plots-air-mean-free-paths/thermophoretic_coefficient') | |
199 | 254 | |
200 | 255 | #pylab.hold(False) |
201 | 256 | |
202 | 257 | |
203 | 258 | #diam_seq=linspace(2.,600.,100) |
204 | 259 | |
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 | |
206 | 261 | |
207 | 262 | diam_seq=diam_seq/1e9 |
208 | 263 |
@@ -210,7 +265,7 @@ | ||
210 | 265 | |
211 | 266 | #print "diam_seq is", diam_seq |
212 | 267 | |
213 | -K_bis=K_talbot(T) | |
268 | +K_bis=K_talbot(T_0,diam_seq) | |
214 | 269 | #print 'K_bis is', K_bis |
215 | 270 | print 'the shape of k_bis is', shape(K_bis) |
216 | 271 |
@@ -218,24 +273,27 @@ | ||
218 | 273 | pylab.plot((diam_seq*1e9),K_bis,linewidth=2.) |
219 | 274 | pylab.xlabel('diameter [nm]',fontsize=20.) |
220 | 275 | 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.) | |
222 | 277 | pylab.grid(True) |
223 | -pylab.savefig('thermophoretic_coefficient_vs_particle_diameter') | |
278 | +pylab.savefig('./plots-air-mean-free-paths/thermophoretic_coefficient_vs_particle_diameter') | |
224 | 279 | |
225 | 280 | pylab.hold(False) |
226 | 281 | |
227 | -V_th=V_thermo(T) | |
282 | +V_th=V_thermo(T_0) | |
283 | + | |
284 | + | |
228 | 285 | |
229 | 286 | pylab.plot((diam_seq*1e9),V_th,linewidth=2.) |
230 | 287 | pylab.xlabel('diameter [nm]',fontsize=20.) |
231 | 288 | 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.) | |
233 | 290 | pylab.grid(True) |
234 | -pylab.savefig('thermophoretic_velocity_vs_particle_diameter') | |
291 | +pylab.savefig('./plots-air-mean-free-paths/thermophoretic_velocity_vs_particle_diameter') | |
235 | 292 | |
236 | 293 | pylab.hold(False) |
237 | 294 | |
238 | 295 | pylab.save('v_thermophoresis',V_th) |
239 | 296 | |
297 | +#Now I calculate the deposition efficiency | |
240 | 298 | |
241 | 299 | print 'So far so good' |
\ No newline at end of file |