{ "metadata": { "name": "", "signature": "sha256:625ae8c5d89aa803ec88a91915a577ea6d8b52d1a9407231a8a1fcfb98194291" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Ch-7, Diffusion in solids" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "example-7.1 page no-203" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#given\n", "#outward flux of copper is\n", "Jx=10**21 #per m**2 per sec\n", "#concentration of copper at room temp on one side of aluminium which is 3 mm thickness\n", "C1=2*10**13 # per m**3\n", "dx=3*10**-3 #m\n", "#concentration on the other side of aluminium\n", "C2=4*10**6 # per m**3\n", "#concentration gradient\n", "M=(C1-C2)/dx #m**4\n", "#according to fick's law\n", "#Jx=-Dx*dM/dx\n", "#so Dx will be\n", "Dx=-Jx*1/M #m**2/s\n", "print \"the concentration gradient is %0.2e per m**4and diffusivity of copper is %0.2e m**2/s\"%(M,Dx)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "the concentration gradient is 6.67e+15 per m**4and diffusivity of copper is -1.50e+05 m**2/s\n" ] } ], "prompt_number": 13 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "example-7.2 page no-209" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from math import exp, sqrt\n", "from scipy.special import erfinv\n", "#given\n", "#activation energy and constant D0 are given as\n", "#for notation only we are using D01 and D02\n", "Q1=83*10**3 #J/mol\n", "Q2=157*10**3 #J/mol\n", "D01=8*10**-7 #m**2/s\n", "D02=700*10**-7 #m**2/s\n", "#diffusivity of carbon in alpha-iron at 873 K (600+273) can be obtained by the equation\n", "T=873 #K\n", "#and \n", "#gas constant\n", "R=8.314 #J/mol K\n", "Dx=D01*exp(-Q1/R/T) #m**2/s\n", "#concentration of carbon is given as 0.75% , therefore concentration of steel will be 0.25 %. thus\n", "Ms=0.25 #conc. of steel\n", "Mc=0.75 #conc. of carbon\n", "#time of carburization is 9 hrs\n", "t=9*3600 #sec\n", "#so \n", "C1=Mc\n", "C2=C1-Ms\n", "#carbon content on the surface\n", "M=0.6\n", "#we know that diffusion across a common interface is obtained by:-\n", "#M=C1-C2*erf(x/2*sqrt(Dx/t))\n", "#solving for X where X=erf(x/2*sqrt(Dx/t))\n", "X=((C1-M)/C2)\n", "#now for x\n", "x=erfinv(X)*2*sqrt(Dx*t)*10**4 #m\n", "print \"depth of carburization is %0.2f m\"%(x) " ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "depth of carburization is 2.88 m\n" ] } ], "prompt_number": 14 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "example-7.3 page no-211" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from math import exp\n", "from scipy.special import erfinv\n", "#given\n", "#temp\n", "T=950+273 #K\n", "QA1=83*10**3 #J/mole\n", "QA2=157*10**3 #J/mole\n", "R=8.314\n", "D01=0.008*10**-4 #m**2/s\n", "D02=0.7*10**-4 #m**2/s\n", "Ms=0.8 #%\n", "Mc=0 #%\n", "Mx=0.6 #%\n", "t=4*3600 #sec\n", "D=1.38*10**-11 #m**2/s \n", "#diffusivity at 950 degrees celcius\n", "Dx=D01*exp(-QA2/R/T) #m**2/s\n", "#now we use fick's solution which is given by\n", "#M(x,t)=C1-C2*erf(x/2/sqrt(Dt))\n", "#first boundary condition is \n", "#M(x,0)=0.8 for x<0\n", "#on solving we get\n", "#C1+C2=0.8\n", "#second boundary condition is \n", "#M(0,t)=0\n", "#so we get\n", "#C1-C2=0\n", "#therefore we get\n", "C1=0\n", "C2=0.8\n", "#so we get x as\n", "x=erfinv((C1-Mx)/C2)*2*sqrt(D*t)\n", "print \"post machining is to be done upto %0.2e mm\"%x " ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "post machining is to be done upto -7.25e-04 mm\n" ] } ], "prompt_number": 15 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "example-7.4 page no-213" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from scipy.special import erfinv\n", "#given\n", "D0=0.002*10**-6 #m**2/s\n", "Q=120*10**3 #J/mol\n", "T=550+273 #K\n", "#the condition for diffusion are\n", "#M(x,0)=4% for x>0\n", "#M(x,0)=0% for x<0\n", "x=(0.25-0.10)*10**-3 #m\n", "Mx=0.4 #%\n", "R=8.314 #gas constant\n", "#diffusion at 550 degrees celcius is\n", "Dx=D0*exp(-Q/R/T) #m**2/s\n", "#by using\n", "#M(x,t)=C1-C2*erf(x/2/sqrt(Dx*t))\n", "#putting boundary conditions in above equation we get\n", "C1=2 #%\n", "C2=2 #%\n", "#solving for t\n", "#we get\n", "t=(erfinv((C1-Mx)/C2)*2*sqrt(Dx)/x)**-2 #sec\n", "print \"the duration for which he material is kept at 550 degrees celcius is %0.2e sec\"%(t)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "the duration for which he material is kept at 550 degrees celcius is 1.42e+08 sec\n" ] } ], "prompt_number": 16 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "example-7.5 page no-215" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from __future__ import division\n", "from scipy.special import erfinv\n", "#given\n", "Mx=10**22 #atoms/m**3\n", "M0=10**24 #atoms/m**3\n", "t=3*3600 #sec\n", "T=1100+273 #K\n", "D=7*10**-17 #m**2/s\n", "#boundary cinditions are\n", "#M(x,0)=0 for x>0 at t=0\n", "#M(0,t)=10**24 atoms/m**3\n", "#M(x,t)=C1-C2*erf(x/22/sqrt(D*t))\n", "#putting boundary conditions in the above equation\n", "#we get \n", "C1=10**24 #atoms/m**3\n", "C2=10**24 #atoms/m**3\n", "#solving for x\n", "#now for x we have\n", "x=erfinv((C1-Mx)/C2)*2*sqrt(D*t)*10**3 #mm\n", "print \"depth below the surface at which the concentration is 10**22 atoms/m**3 is %f mm\"%(x)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "depth below the surface at which the concentration is 10**22 atoms/m**3 is 0.003167 mm\n" ] } ], "prompt_number": 17 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "example-7.6 page no-216" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#given\n", "#temp and pressure of Nitrogen gas\n", "T=400 #K\n", "P=15 #atm\n", "#Nitrogen conc at the inner surface of the tank\n", "M=12 #kg/m**3\n", "#constant D0 and activation energy\n", "D0=5*10**-7 # m**2/s\n", "Q=75*10**3 #J/mol\n", "#thickness of tank wall\n", "x=6*10**-3 #m\n", "D=M/x #kg/m**4 (calculation mistake in book)\n", "#gas constant\n", "R=8.314 #J/mol/K\n", "#dufusing flux\n", "#Jx=-Dx*m/x kg/m**2/s\n", "#Dx can be determined as follows\n", "Dx=D0*exp(-Q/R/T) #m**2/s\n", "#so #diffusing flux will be\n", "Jx=Dx*D #kg/m**2/s (calculation mistake in book)\n", "print \"diffusing rate of nitrogen is %0.2e kg/m**2/s\"%(Jx)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "diffusing rate of nitrogen is 1.61e-13 kg/m**2/s\n" ] } ], "prompt_number": 20 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "example-7.7 page no-217" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from math import log\n", "from __future__ import division\n", "#given\n", "#ratio of rate of diffusion at 1350 and 110 degree C is 8\n", "#so\n", "#dM/dt at 1350 degree C(1623K)/dM/dt at 110degree C (1373K)=8\n", "#so \n", "Ratio=8\n", "#we know that\n", "#Dx=D0*exp(-Q/R/T)\n", "#so Dx (at 1623 K)/Dx (at 1373 K)= exp(-Q/R/T1-Q/R/T2)\n", "#where\n", "T1=1623 #K\n", "T2=1373 #K\n", "#gas constant\n", "R=8.314 #J/mol/K\n", "#so we get\n", "#Ratio=exp(-Q/R*(1/T1-1/T2))\n", "#so we get Q as\n", "Q=-log(Ratio)*R/(1/T1-1/T2)/1000 #KJ/mol\n", "print \"the activation energy for sulphur diffusion is %d KJ/mol\"%(Q)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "the activation energy for sulphur diffusion is 154 KJ/mol\n" ] } ], "prompt_number": 19 } ], "metadata": {} } ] }