• 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

修订版cef3a753d86068239da13ef704b67722e66848e7 (tree)
时间2008-08-15 19:40:52
作者iselllo
Commiteriselllo

Log Message

I modified the code adding the possibility of entering by hand the
radius of gyration of certain small clusters. I also am first defining
the number of monomers and THEN the volume grid (otherwise, the
statement if n_mon=2. then... can fail since n_mon could be slightly
different from two).

更改概述

差异

diff -r 0576b292dec2 -r cef3a753d860 Python-codes/smoluchowski_adjusted_kernel.py
--- a/Python-codes/smoluchowski_adjusted_kernel.py Tue Aug 12 19:50:47 2008 +0000
+++ b/Python-codes/smoluchowski_adjusted_kernel.py Fri Aug 15 10:40:52 2008 +0000
@@ -13,9 +13,13 @@
1313
1414 print "the monodisperse volume is, ", v_mono
1515
16-x=s.logspace(s.log10(v_mono), s.log10(v_mono*2500.),200) # volume grid
1716
18-n_mon=x/v_mono #volume of solids expressed in terms of number of monomers
17+n_mon=s.logspace(s.log10(1.), s.log10(2500.),200) # volume grid
18+
19+x=n_mon*v_mono #volume of solids expressed in terms of number of monomers
20+
21+
22+
1923
2024 print "n_mon is, ", n_mon
2125
@@ -53,7 +57,7 @@
5357
5458 rho=0.01 #monomer density in the box
5559
56-choice_kernel= 5 #0: standard continuum kernel (and standard diffusion_coefficient)
60+choice_kernel= 10 #0: standard continuum kernel (and standard diffusion_coefficient)
5761 #1: constant kernel
5862 #2: continuum kernel, 2 df's and special treatment of monomers (special diffusion coeff)
5963 #3: continuum kernel, 1 df and special treatment of monomers (special diffusion coeff)
@@ -69,10 +73,11 @@
6973 #(standard diffusion coeff)
7074 #9: continuum kernel, 2 df's, Fuchs beta without special treatment of monomers, but
7175 # Fuchs correction is applied to monomers only.
76+ #10: as in 5, but this time we introduce by hand the radius of gyration of the smallest
77+ #clusters
7278
7379
7480
75-
7681 choice_slope = 2 #2: 2 different df's
7782 #1: 1 different df
7883
@@ -624,6 +629,102 @@
624629 return kern_mat
625630
626631
632+
633+def Brow_ker_cont_optim_diffusion_adjusted_and_monomer_beta_fuchs_special_rules(Vlist):
634+ #monomer volume
635+ #r_mon=0.5 #monomer radius
636+ #v_mon=4./3.*s.pi*r_mon**3.
637+ #v_mono already defined as a global variable
638+ #n_mon=Vlist/v_mono #number of monomers in each aggregate
639+
640+ #print "n_mon is, ", n_mon
641+
642+ Diff=k_B*T_0/(n_mon*m_mon*beta) #vector with the cluster diffusion coefficients
643+ #which just depends on the cluster size.
644+
645+ R_list=s.zeros(len(Vlist)) #I initialize the array which will contain the
646+ #radia of gyration
647+
648+ #threshold=15.
649+
650+# small=s.where(n_mon<=threshold)
651+# large=s.where(n_mon>threshold)
652+
653+# a_small=0.36
654+# df_small=2.19
655+
656+# a_large=0.241
657+# df_large=1.62
658+
659+
660+ R_list[small]=a_small*n_mon[small]**(1./df_small)
661+
662+ R_list[large]=a_large*n_mon[large]**(1./df_large)
663+
664+ #Now I actually introduce some special rules for the radius of gyration of the smallest clusters
665+
666+ sel=s.where(n_mon == 1.)
667+
668+ R_list[sel]=3.87e-1
669+
670+
671+ sel=s.where(n_mon == 2.)
672+
673+ R_list[sel]=6.39e-1
674+
675+ sel=s.where(n_mon == 3.)
676+
677+ R_list[sel]=7.18e-1
678+
679+ sel=s.where(n_mon == 4.)
680+
681+ R_list[sel]=7.48e-1
682+
683+
684+ print "len(R_list is, )", len(R_list)
685+ print "R_list is, ", R_list
686+
687+
688+
689+
690+# R_list[0]=0.5 #special case for the monomer radius
691+
692+# m=rho_p*Vlist # this holds in general (i.e. for Vlist !=3.)
693+ ## as long as Vlist is the volume of solid
694+ ##and not the space occupied by the agglomerate structure
695+
696+ #m=Vlist #since rho = 1.
697+
698+ c=(8.*k_B*T_0/(s.pi*m))**0.5
699+ #print 'c is', c
700+ l=8.*Diff/(s.pi*c)
701+ #print 'l is', l
702+ diam_seq=2.*R_list
703+
704+ g=1./(3.*diam_seq*l)*((diam_seq+l)**3.-(diam_seq**2.+l**2.)**1.5)-diam_seq
705+
706+ beta_fuchs=(\
707+ (diam_seq[:,s.newaxis]+diam_seq[s.newaxis,:]) \
708+ /(diam_seq[:,s.newaxis]+diam_seq[s.newaxis,:]\
709+ +2.*(g[:,s.newaxis]**2.+g[s.newaxis,:]**2.)**0.5)\
710+ + 8.*(Diff[:,s.newaxis]+Diff[s.newaxis,:])/\
711+ ((c[:,s.newaxis]**2.+c[s.newaxis,:]**2.)**0.5*\
712+ (diam_seq[:,s.newaxis]+diam_seq[s.newaxis,:]))\
713+ )**(-1.)
714+
715+
716+ ## now I have all the bits for the kernel matrix
717+# kern_mat=Brow_ker_cont_optim(Vlist)*beta
718+
719+
720+ kern_mat=4.*s.pi*(Diff[:,s.newaxis]+Diff[s.newaxis,:])* \
721+ (R_list[:,s.newaxis]+R_list[s.newaxis,:])*beta_fuchs
722+
723+
724+ return kern_mat
725+
726+
727+
627728
628729 def beta_fuchs_standalone(Vlist):
629730
@@ -751,6 +852,8 @@
751852 elif (choice_kernel == 9):
752853 kernel=Brow_ker_cont_optim_diffusion_adjusted_and_monomer_beta_fuchs_single_value(x)
753854
855+elif (choice_kernel ==10):
856+ kernel=Brow_ker_cont_optim_diffusion_adjusted_and_monomer_beta_fuchs_special_rules(x)
754857
755858
756859 f_garrick=mycount_garrick(x)
@@ -996,11 +1099,12 @@
9961099 #I have to re-define a number of important quantities
9971100
9981101
999-x=s.linspace(v_mono, (v_mono*2500.), 2500) #new volume grid
1102+n_mon=s.linspace(1., 2500., 2500) #new volume grid
10001103
1001-#I have to redefine this
10021104
1003-n_mon=x/v_mono #volume of solids expressed in terms of number of monomers
1105+x=n_mon*v_mono #new volume grid
1106+
1107+
10041108
10051109 print "n_mon is, ", n_mon
10061110
@@ -1046,6 +1150,8 @@
10461150 elif (choice_kernel == 9):
10471151 kernel=Brow_ker_cont_optim_diffusion_adjusted_and_monomer_beta_fuchs_single_value(x)
10481152
1153+elif (choice_kernel ==10):
1154+ kernel=Brow_ker_cont_optim_diffusion_adjusted_and_monomer_beta_fuchs_special_rules(x)
10491155
10501156
10511157 y_new = si.odeint(coupling_optim, y0, \