ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/applications/utilities/stat2dielectric
(Generate patch)

Comparing trunk/src/applications/utilities/stat2dielectric (file contents):
Revision 2009 by gezelter, Tue Jul 8 15:03:26 2014 UTC vs.
Revision 2010 by gezelter, Wed Jul 16 14:42:50 2014 UTC

# Line 147 | Line 147 | def computeAverages(outFileName, Q):
147          Vol += volume[i] * a3tom3
148          Vavg = Vol / float(1+i)
149  
150 <        d1 = 1.0 + (M2avg - Mavg) / (3.0*eps0*kB*Tavg*Vavg)
151 <        d2 = 1.0 + (M2avg - Mavg2*Mavg2) / (3.0*eps0*kB*Tavg*Vavg)
150 >        x1 = (M2avg - Mavg) / (9.0*eps0*kB*Tavg*Vavg)
151 >        x2 = (M2avg - Mavg2*Mavg2) / (9.0*eps0*kB*Tavg*Vavg)      
152  
153 +        # Clausius-Mossotti
154 +        d1 = (2.0 * x1 + 1.0) / (1.0 - x1)
155 +        d2 = (2.0 * x2 + 1.0) / (1.0 - x2)
156  
157 <        corrected1 = ((Q+2.0)*(d1 - 1.0) + 3.0)/((Q-1.0) * (d1 - 1.0) + 3.0)
158 <        corrected2 = ((Q+2.0)*(d2 - 1.0) + 3.0)/((Q-1.0) * (d2 - 1.0) + 3.0)
157 >        # Conducting boundary conditions
158 >        d3 = 1.0 + 3.0*x1
159 >        d4 = 1.0 + 3.0*x2
160          
161 <        outFile.write("%lf\t%lf\t%lf\t%lf\t%lf\n" % (time[i], d1, d2, corrected1, corrected2))
161 >        #d1 = 1.0 + (M2avg - Mavg) / (3.0*eps0*kB*Tavg*Vavg)
162 >        #d2 = 1.0 + (M2avg - Mavg2*Mavg2) / (3.0*eps0*kB*Tavg*Vavg)
163  
164 +        corrected1 = ((Q+2.0)*(d3 - 1.0) + 3.0)/((Q-1.0) * (d3 - 1.0) + 3.0)
165 +        corrected2 = ((Q+2.0)*(d4 - 1.0) + 3.0)/((Q-1.0) * (d4 - 1.0) + 3.0)
166 +
167 +        #corrected1 = (1.0 + 2.0*x1 + Q*x1)/(1.0 - x1 - Q*x1)
168 +        #corrected2 = (1.0 + 2.0*x2 + Q*x2)/(1.0 - x2 - Q*x2)
169 +        
170 +        outFile.write("%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\n" % (time[i], x1, x2, d1, d2, d3, d4, corrected1, corrected2))
171 +
172      outFile.close()
173  
174  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines