Fermi-Dirac Statistics

From Flooxs
Revision as of 20:03, 28 January 2010 by Nrowsey (talk | contribs) (created page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Add and call this procedure to define the solution variables gamma_n, gamma_p, eta_n, and eta_p for use in the Fermi-Dirac statistics model implementation. These are used in the BandTerms procedure to define band terms, as well as in the sharfetter-gummel drift-diffusion continuity equations for electrons and holes.

proc FermiDirac {} {;#defines gamma for sgrad() and eta for FD QFL's
       set mat Silicon
       pdbSetBoolean $mat FD 1
       set MAX 5
       set pi 3.1415926535
   #Forward Transform	
       #Define eta's
       solution add name=Eta_n  solve $mat const val = "((nQFL-Ec)/Vt)"
       solution add name=Eta_p  solve $mat const val = "((Ev-pQFL)/Vt)"
       solution add name=Eta_n0 solve $mat const val = "((0.0-Ec)/Vt)"
       solution add name=Eta_p0 solve $mat const val = "((Ev-0.0)/Vt)"

       #Define gamma's
       for {set i 1} {$i <= $MAX} {incr i} {
           #calculate gm's: Laplace transform of x^(1/2)
               set sign [expr {pow(-1,[expr {$i+1}])}]
               set g    [expr {(sqrt($pi)/2.0)*pow($i,-1.5)}]
               set coef [expr {$i-1}]
               #gamma=(F1/2(eta))/exp(eta))
               append gamma_n  "+($sign)*$g*exp($coef*Eta_n)"
               append gamma_p  "+($sign)*$g*exp($coef*Eta_p)"
               append gamma_n0 "+($sign)*$g*exp($coef*Eta_n0)"
               append gamma_p0 "+($sign)*$g*exp($coef*Eta_p0)"
       }
       solution add name=Gamma_n  solve $mat const val = $gamma_n
       solution add name=Gamma_p  solve $mat const val = $gamma_p
       solution add name=Gamma_n0 solve $mat const val = $gamma_n0
       solution add name=Gamma_p0 solve $mat const val = $gamma_p0

   #Reverted Series
       set A1  3.53553e-1
       set A2 -4.95009e-3
       set A3  1.48386e-4
       set A4 -4.42563e-6

       set Xn "((Elec+1.0)/Nc)"
       set Xp "((Hole+1.0)/Nv)"

       set eta_n_rev "(log($Xn))"
       set eta_p_rev "(log($Xp))"

       for {set i 1} {$i <= 4} {incr i} {
           eval set A \$A$i;puts "A is $A"
           append eta_n_rev "+($A)*(($Xn)^($i))"
           append eta_p_rev "+($A)*(($Xp)^($i))"
       }
	
       solution add name=Eta_n_rev solve $mat const val = $eta_n_rev
       solution add name=Eta_p_rev solve $mat const val = $eta_p_rev
}


warnings

Works only for silicon. Known bug: can't always put all 4 terms in the series (means series approx is slightly less accurate)