diff options
Diffstat (limited to 'Materials_science_and_engineering_an_introduction/CH5.ipynb')
-rw-r--r-- | Materials_science_and_engineering_an_introduction/CH5.ipynb | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/Materials_science_and_engineering_an_introduction/CH5.ipynb b/Materials_science_and_engineering_an_introduction/CH5.ipynb index 5b193d64..caf36165 100644 --- a/Materials_science_and_engineering_an_introduction/CH5.ipynb +++ b/Materials_science_and_engineering_an_introduction/CH5.ipynb @@ -27,19 +27,15 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#Diffusion Flux Computation\n",
"\n",
- "#Given\n",
"Ca=1.2 #Concentration at A in kg/m**3\n",
"Cb=0.8 #Concentration at B in kg/m**3\n",
"xa=5*10**-3 #Position 1 in m\n",
"xb=10*10**-3 #Position 2 in m\n",
"\n",
- "#Calculation\n",
"D=3*10**-11 #Diffusion coefficient in m**2/s\n",
"J=-D*(Ca-Cb)/(xa-xb)\n",
"\n",
- "#Result\n",
"print\"Diffusion flux is \",J,\"kg/m**2-s\"\n",
"\n"
],
@@ -68,16 +64,13 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#Nonsteady-State Diffusion Time Computation I\n",
"from scipy.optimize import fsolve\n",
- "#Given\n",
"Co=0.25 #Initial Conc. in wt%\n",
"Cs=1.2 #Surface conc. in wt%\n",
"Cx=0.8 #Conc. at any x in wt%\n",
"x=5*10**-4 #Position in m\n",
"D=1.6*10**-11 #Diffusion coeff in m**2/s\n",
"\n",
- "#Calculation\n",
"import math\n",
"C=1-((Cx-Co)/(Cs-Co))\n",
"\n",
@@ -86,7 +79,6 @@ "z=fsolve(f,1)\n",
"t=x**2/(4.0*D*z**2.0)\n",
"\n",
- "#Result\n",
"print\"Time required is \",round(t/3600.0,1),\"h\"\n",
"\n"
],
@@ -115,17 +107,13 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#Nonsteady-State Diffusion Time Computation II\n",
"\n",
- "#Given\n",
"D500=4.8*10**-14 #Diffusion coefficient at 500 C\n",
"D600=5.3*10**-13 #Diffusion coefficient at 600 C\n",
"t600=10 #Time in hours to diffuse\n",
"\n",
- "#Calcuation\n",
"t500=D600*t600/D500\n",
"\n",
- "#Result\n",
"print\"Time to diffuse at 500 C is \",round(t500,1),\"h\"\n",
"\n"
],
@@ -154,19 +142,15 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#Diffusion Coefficient Determination\n",
"\n",
- "#Given\n",
"T=550+273 #in K\n",
"D0=1.2*10**-4 #Temperature independent preexponential in m**2/s\n",
"Qd=131000 #Activation energy in J/mol-K\n",
"R=8.31 #Universal Gas constt\n",
"\n",
- "#Calculation\n",
"import math\n",
"D=D0*math.exp(-Qd/(R*T))\n",
"\n",
- "#Result\n",
"print\"Diffusion coefficient is \",round(D,14),\"m**2/s\"\n",
"\n"
],
@@ -195,21 +179,16 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#Diffusion Coefficient Activation Energy and Preexponential Calculations\n",
"\n",
- "#Given\n",
- "#From graph log D ad 1/T are deducted\n",
"inv_T1=0.8*10**-3 #Reciprocal of temp. in K**-1\n",
"inv_T2=1.1*10**-3 #Reciprocal of temp. in K**-1\n",
"logD1=-12.4\n",
"logD2=-15.45\n",
"R=8.31 #Gas law Constant in J/mol-K\n",
"\n",
- "#Calculation\n",
"Qd=-2.3*R*(logD1-logD2)/(inv_T1-inv_T2)\n",
"print\"Activation energy is\",round(Qd/1000,0),\"KJ\"\n",
"\n",
- "#For calculating Peexponential factor\n",
"D0=10**(logD2+(Qd*inv_T2/(2.3*R)))\n",
"print\"Preexponential factor is\",round(D0,6),\"m**2/s\"\n",
"\n"
@@ -240,9 +219,7 @@ "cell_type": "code",
"collapsed": false,
"input": [
- "#Diffusion Temperature\u2013Time Heat Treatment Specification\n",
"\n",
- "#Given\n",
"C0=0.2 #Initial concentration in wt%\n",
"Cs=1 #Surface conc in wt%\n",
"Cx=0.6 #Conc at any position X in wt%\n",
@@ -255,10 +232,8 @@ "z=0.4747\n",
"Dt=(x/(2*z))**2\n",
"\n",
- "#Dt=D0*exp(-Qd/RT)*t = value of variable Dt\n",
"D=Dt/D0\n",
"\n",
- "#The tempratures are\n",
"T1=900.0\n",
"T2=950.0\n",
"T3=1000.0\n",
@@ -268,7 +243,6 @@ "t3=D/math.exp(-Qd/(R*(T3+273)))/3600.0\n",
"t4=D/math.exp(-Qd/(R*(T4+273)))/3600.0\n",
"\n",
- "#Result\n",
"print\"Temperature in Celcius are\",T1,T2,T3,T4\n",
"print\"Time is respectively \",round(t1,1),\"h,\",round(t2,1),\"h,\",round(t3,1),\"h,\",round(t4,1),\"h\"\n",
"\n"
|