GaN Models Source file (2D) - full deck

From Flooxs
Revision as of 19:18, 31 January 2014 by David (talk | contribs)
Jump to navigation Jump to search

The "DevicePacakge" command initializes a device simulation

DevicePackage

Constants used throughout device equations

set k 1.38066e-23
set q 1.60218e-19
set kev 8.617e-5
set Vt ($k*Temp/$q)
set eps0 8.854e-14
set kev 8.617e-5
set VtRoom [expr $k*300.0/$q]
set hbar 1.054571628e-34
set hbarev 6.5868e-16
set h 4.1385e-15
set pi 3.1415
set egan 7.88e-13
set Me 9.1e-31
set Mestar 0.2*$Me
set tau 1e-8
set Vr sqrt(($k*ETemp)/(2*$pi*$Mestar))
set AR 26

let lamdaR =0.216, AR = lamdaR * Ao from paper "The role of tunneling component in cv characteristics of metal GaN diodes" Ao where Ao = 1.20173e2A/K2cm2.

Parameter database values for materials used in GaN device structure begins here.

#paramaters for gas 
pdbSetString gas YoungsModulus 1e-7
pdbSetString gas PoissonRatio 0.99

GaN and AlGaN stiffness values with lattice temperature feedback

#Set Youngs Modulus and Poissons Ratio(for WZ crystal 0001 plane)
pdbSetString GaN YoungsModulus (3.9e12-0.16e10*(Temp-300.0))
pdbSetString GaN PoissonRatio 0.352
#Set Youngs Modulus and Poissons Ratio(approximation from Nanoindentation in AlGaN paper, Caceres '99)
pdbSetString AlGaN YoungsModulus (3.9e12+(5.555e11*AlN_Ratio)-0.16e10*(Temp-300.0))
pdbSetString AlGaN PoissonRatio 0.352

Silicon Nitride stiffness values

#Set Youngs Modulus and Poissons Ratio
pdbSetString Nitride YoungsModulus 2.0e12
pdbSetString Nitride PoissonRatio 0.24

Oxide phase stiffness values

#Set Youngs Modulus and Poissons Ratio
pdbSetString OxPhase YoungsModulus 3.9e12
pdbSetString OxPhase PoissonRatio 0.352

Material interface continuity stiffness values

#Set Youngs Modulus and Poissons Ratio
pdbSetString AlGaN_GaN YoungsModulus 2.0e12
pdbSetString AlGaN_GaN PoissonRatio 0.24
#Set Youngs Modulus and Poissons Ratio
pdbSetString AlGaN_OxPhase YoungsModulus 3.9e12
pdbSetString AlGaN_OxPhase PoissonRatio 0.352
#Set Youngs Modulus and Poissons Ratio
pdbSetString Metal_Nitride YoungsModulus 3.9e12
pdbSetString Metal_Nitride PoissonRatio 0.352
#Set Youngs Modulus and Poissons Ratio
pdbSetString Metal_OxPhase YoungsModulus 3.9e12
pdbSetString Metal_OxPhase PoissonRatio 0.352
#Set Youngs Modulus and Poissons Ratio
pdbSetString Nitride_OxPhase YoungsModulus 3.9e12
pdbSetString Nitride_OxPhase PoissonRatio 0.352

Gate Metal stiffness values

#Set Youngs Modulus and Poissons Ratio
pdbSetString Metal YoungsModulus 3.9e12
pdbSetString Metal PoissonRatio 0.352

More material interface continuity stiffness values

#Set Youngs Modulus and Poissons Ratio
pdbSetString Gas_Metal YoungsModulus 3.9e12
pdbSetString Gas_Metal PoissonRatio 0.352
#Set Youngs Modulus and Poissons Ratio
pdbSetString Gas_Nitride YoungsModulus 3.9e12
pdbSetString Gas_Nitride PoissonRatio 0.352

Adding GaN parameters of band structure and electrical properties follows here:

mater add name=GaN
#Set Youngs Modulus and Poissons Ratio(for WZ crystal 0001 plane) plus temperature dependence
#pdbSetString GaN YoungsModulus (3.9e12-0.16e10*(Temp-300.0))
pdbSetString GaN PoissonRatio 0.352
   #set some GaN parameters
   pdbSetDouble GaN DevPsi RelEps 8.9
   
   #set GaN electron affinity
   
   pdbSetDouble GaN Affinity 3.1
   #set Bandgap according to Eric Heller info
   pdbSetDouble GaN Eg (3.51-(7.7e-4*Temp*Temp)/(600+Temp))
   #set Ev and Ec for GaN 
   pdbSetDouble GaN Hole Ev "((-[pdbGetDouble GaN Affinity])-([pdbGetDouble GaN Eg])+(DevPsi))"
   pdbSetDouble GaN Elec Ec "((-[pdbGetDouble GaN Affinity])+(DevPsi))"
   pdbSetDouble GaN Hole Nv (4.6e19*sqrt(Temp*Temp*Temp/2.7e7))
   pdbSetDouble GaN Elec Nc (2.3e18*sqrt(Temp*Temp*Temp/2.7e7))
   #set low field electron mobility via analytical expression from Farahmand for low field mobility
   #paramters for GaN for low field mobility from Farahmand
   pdbSetDouble GaN Elec mumin 295.0
   pdbSetDouble GaN Elec mumax 1460.7
   pdbSetDouble GaN Elec alpha 0.66
   pdbSetDouble GaN Elec beta1 -1.02
   pdbSetDouble GaN Elec beta2 -3.84
   pdbSetDouble GaN Elec beta3 3.02
   pdbSetDouble GaN Elec beta4 0.81
   pdbSetDouble GaN Elec Nref 1e17 
   set Gmumin ([pdbGetDouble GaN Elec mumin])
   set Gmumax ([pdbGetDouble GaN Elec mumax])
   set Glowalpha ([pdbGetDouble GaN Elec alpha])
   set Gbeta1 ([pdbGetDouble GaN Elec beta1])
   set Gbeta2 ([pdbGetDouble GaN Elec beta2])
   set Gbeta3 ([pdbGetDouble GaN Elec beta3])
   set Gbeta4 ([pdbGetDouble GaN Elec beta4])
   set GNref ([pdbGetDouble GaN Elec Nref])

   #build equation for low field mobility
   set Gseg1 "$Gmumin*(1*exp(log(Temp/300)*($Gbeta1)))"
   set Gseg2 "($Gmumax-$Gmumin)*(1*exp(log(Temp/300)*($Gbeta2)))"
   set Gseg3 "$GNref*(1*exp(log(Temp/300)*($Gbeta3)))"
   set Gseg4 "abs((Doping+1)/$Gseg3)"
   set Gseg5 "$Glowalpha*(1*exp(log(Temp/300)*($Gbeta4)))"
   set Gseg6 "1*exp(log($Gseg4)*($Gseg5))"
   set Gseg7 "1+$Gseg6"
   set Gseg8 "($Gseg2)/($Gseg7)"
   #pdbSetDouble GaN Elec lowfldmob "($Gseg1+(($Gseg2)/($Gseg7)))"
   #pdbSetDouble GaN Elec lowfldmob $Gseg1+((($Gmumax-$Gmumin)*(exp(log(Temp/300)*($Gbeta2))))/($Gseg7))
   pdbSetDouble GaN Elec lowfldmob "($Gseg1)+($Gseg8)"
   #parameters for GaN low field mobility using Eric Heller's equations
   set top "1630"
   set bot1 "(Temp/300)"
   set bot2 "exp(log($bot1)*(1.88))"
   set ericmob "($top)/($bot2)"
   pdbSetDouble GaN Elec lowfldmob $ericmob
  
   #parameters and expression for high field mobility using Eric Heller's equations
   set Gvsat "3.3e7-(3.0e6*(Temp/300))"
   set Gbeta "0.85*(exp(log(Temp/300)*(0.4)))"
   #set GEfield "abs(dot(DevPsi,y*1e-4))+1"
   #set GEfield "(sqrt(dot(Qfn,Qfn)+1.0e6))"
   set GEfield "(sqrt(dot(DevPsi,DevPsi)+1.0))"
   #set GEfield "(sqrt(dot(Qfn,Qfn)+1.0))"
   set G1 "((([pdbGetDouble GaN Elec lowfldmob])*($GEfield))/($Gvsat))"
   set G2 "(exp(log($G1)*($Gbeta)))"
   set G3 "(1+($G2))"
   set G4 "(1/$Gbeta)"
   set G5 "(exp(log($G3)*($G4)))"
   set Ghigh "(([pdbGetDouble GaN Elec lowfldmob])/($G5))"
   ######HHHHHHHHHHHHHHHHHH new hot carrier mobility adjustment HHHHHHHHHHHHHHHHHHHHHHHH#######
   
   pdbSetDouble GaN Elec mob $Ghigh 
  
   #set parameters for GaN High Field mobility from Farahmand 
   pdbSetDouble GaN Elec alpha 6.1973
   pdbSetDouble GaN Elec n1 7.2044
   pdbSetDouble GaN Elec n2 0.7857
   pdbSetDouble GaN Elec Ecmob 220893.6
   pdbSetDouble GaN vsat 1.9064e7 
   pdbSetDouble GaN vsat (2.7e7/(1+0.8*exp(Temp/600)))
   #set electron mobility via analytical expression from Farahmand for high field mobility
   set Glowfldmob ([pdbGetDouble GaN Elec lowfldmob]) 
   set Ghighalpha ([pdbGetDouble GaN Elec alpha])
   set Gn1 ([pdbGetDouble GaN Elec n1])
   set Gn2 ([pdbGetDouble GaN Elec n2])
   set GEcmob ([pdbGetDouble GaN Elec Ecmob])
   set Gvsat ([pdbGetDouble GaN vsat])
   #set GEfield1 "abs(dot(DevPsi,y*1.e-4))+1"    
   #set GEfield1 "(sqrt(dot(Qfn,Qfn)+1.0e6))"
   set GEfield1 "(sqrt(dot(DevPsi,DevPsi)+1.0))"
   set GEfield_EcRatio1 "(($GEfield1)/($GEcmob))"
   set GEn1_1 "(exp(log($GEfield1)*($Gn1-1)))"
   set GEn1_3 "(exp(log($GEcmob)*($Gn1)))"
   set GEn1_2 "(exp(log($GEfield_EcRatio1)*($Gn1)))"
   set GEn2_1 "(exp(log($GEfield_EcRatio1)*($Gn2)))"
   set num1 "($Glowfldmob+($Gvsat*(($GEn1_1)/($GEn1_3))))"
   set denom1 "(1.0+($Ghighalpha*($GEn2_1))+($GEn1_2))"
   pdbSetDouble GaN Hole mob 100

Adding AlGaN parameters of band structure and electrical properties follows here:

mater add name=AlGaN
   #define the parameters for AlGaN - all depend on a AlN_Ratio being set as a spatial variable
   pdbSetDouble AlGaN DevPsi RelEps 9.0
  #pdbSetString AlGaN YoungsModulus (3.9e12+(5.555e11*AlN_Ratio)-0.16e10*(Temp-300.0))
  pdbSetString AlGaN PoissonRatio 0.352
 
   #set AlN_Eg 6.13
   #set AlGaN electron affinity
   pdbSetDouble AlGaN Affinity "((2.02275*(1-AlN_Ratio))+1.07725)"
   #set AlGaN bandgap
   pdbSetDouble AlGaN Eg "(6.13*AlN_Ratio+[pdbDelayDouble GaN Eg]*(1-AlN_Ratio)-1.0*AlN_Ratio*(1-AlN_Ratio))"
   
   #Set Ev and Ec using AlGaN Ei as zero
   pdbSetDouble AlGaN Hole Ev "((-[pdbGetDouble AlGaN Affinity])-([pdbGetDouble AlGaN Eg])+(DevPsi))"
   pdbSetDouble AlGaN Elec Ec "((-[pdbGetDouble AlGaN Affinity])+(DevPsi))"
   #copied from Full deck
   pdbSetDouble AlGaN Elec me "((0.4*AlN_Ratio+0.20*(1-AlN_Ratio)))"
   pdbSetDouble AlGaN Hole mh "((1.5*AlN_Ratio+3.53*(1-AlN_Ratio)))"
   set me ([pdbDelayDouble AlGaN Elec me])
   set mh ([pdbDelayDouble AlGaN Hole mh])
   pdbSetDouble AlGaN Elec Nc (2.50945e19*sqrt($me*$me*$me)*sqrt(Temp*Temp*Temp/2.7e7))
   pdbSetDouble AlGaN Hole Nv (2.50945e19*sqrt($mh*$mh*$mh)*sqrt(Temp*Temp*Temp/2.7e7))
 
   #parameters for AlGaN low field mobility U=0
   pdbSetDouble AlGaN Elec mumin 312.1
   pdbSetDouble AlGaN Elec mumax 1401.3
   pdbSetDouble AlGaN Elec alpha 0.74
   pdbSetDouble AlGaN Elec beta1 -6.51
   pdbSetDouble AlGaN Elec beta2 -2.31
   pdbSetDouble AlGaN Elec beta3 7.07
   pdbSetDouble AlGaN Elec beta4 -0.86
   pdbSetDouble AlGaN Elec Nref 1e17
   set Amumin ([pdbGetDouble AlGaN Elec mumin])
   set Amumax ([pdbGetDouble AlGaN Elec mumax])
   set Alowalpha ([pdbGetDouble AlGaN Elec alpha])
   set Abeta1 ([pdbGetDouble AlGaN Elec beta1])
   set Abeta2 ([pdbGetDouble AlGaN Elec beta2])
   set Abeta3 ([pdbGetDouble AlGaN Elec beta3])
   set Abeta4 ([pdbGetDouble AlGaN Elec beta4])
   set ANref ([pdbGetDouble AlGaN Elec Nref])

   #build equation for low field mobility
   set Aseg1 "$Amumin*(exp(log(Temp/300)*($Abeta1)))"
   set Aseg2 "($Amumax-$Amumin)*(exp(log(Temp/300)*($Abeta2)))"
   set Aseg3 "$ANref*(exp(log(Temp/300)*($Abeta3)))"
   set Aseg4 "abs((Doping+1)/$Aseg3)"
   set Aseg5 "$Alowalpha*(exp(log(Temp/300)*($Abeta4)))"
   set Aseg6 "exp(log($Aseg4)*($Aseg5))"
   set Aseg7 "1+$Aseg6"
   pdbSetDouble AlGaN Elec lowfldmob "($Aseg1+(($Aseg2)/($Aseg7)))"
 
   #set electron mobility via analytical expression from Farahmand for high field mobility U=0
   #pdbSetDouble AlGaN Elec lowfldmob 213.1
   pdbSetDouble AlGaN Elec alpha 6.9502
   pdbSetDouble AlGaN Elec n1 7.8138
   pdbSetDouble AlGaN Elec n2 0.7897
   pdbSetDouble AlGaN Elec Ecmob 245579.4
   pdbSetDouble AlGaN vsat 2.02e7 
   #pdbSetDouble AlGel N vsat ((2.5e7*AlN_Ratio)+(1.4e7*(1-AlN_Ratio)))
   set Alowfldmob ([pdbGetDouble AlGaN Elec lowfldmob]) 
   set Ahighalpha ([pdbGetDouble AlGaN Elec alpha])
   set An1 ([pdbGetDouble AlGaN Elec n1])
   set An2 ([pdbGetDouble AlGaN Elec n2])
   set AEcmob ([pdbGetDouble AlGaN Elec Ecmob])
   set Avsat ([pdbGetDouble AlGaN vsat])
   #set AEfield "(sqrt(dot(DevPsi,DevPsi)+1.0e2))"
   #set AEfield "(sqrt(dot(Qfn,Qfn)+1.0e6))"
   set AEfield "(sqrt(dot(DevPsi,DevPsi)+1.0))"
   set AEfield_EcRatio "($AEfield)/($AEcmob)"
   set AEn1 "exp(log($AEfield_EcRatio)*($An1-1))"
   set AEn2 "exp(log($AEfield_EcRatio)*($An2))"
   set Anum "($Alowfldmob+($Avsat*($AEn1)/($AEcmob)))"
   set Aden "(1.0+($Ahighalpha*($AEn2))+($AEn1*$AEfield_EcRatio))"
   
   #pdbSetDouble AlGaN Elec mob "($Anum)/($Aden)"
   pdbSetDouble AlGaN Elec mob 213.3
   pdbSetDouble AlGaN Hole mob 0.2
   #pdbSetDouble AlGaN Hole mob 100

Adding Oxide Phase parameters of band structure and electrical properties follows here:

  mater add name=OxPhase    
  #set OxPhase electron affinity
  pdbSetDouble OxPhase Affinity "((2.02275*(1-AlN_Ratio))+1.07725)"
     
  #set Ox bandgap-Don't know where the 1.3 value comes from
   
   pdbSetDouble OxPhase Eg "(6.13*AlN_Ratio+[pdbDelayDouble GaN Eg]*(1-AlN_Ratio)-1.0*AlN_Ratio*(1-AlN_Ratio))"
   #pdbSetDouble OxPhase Eg 7.13
   #Set Ev and Ec using AlGaN Ei as zero
   pdbSetDouble OxPhase Hole Ev "((-[pdbGetDouble OxPhase Affinity])-([pdbGetDouble OxPhase Eg])+(DevPsi))"
   pdbSetDouble OxPhase Elec Ec "((-[pdbGetDouble OxPhase Affinity])+(DevPsi))"
   #copied from Full deck
   pdbSetDouble OxPhase Elec me "((0.4*AlN_Ratio+0.20*(1-AlN_Ratio)))"
   pdbSetDouble OxPhase Hole mh "((1.5*AlN_Ratio+3.53*(1-AlN_Ratio)))"
   
   set me ([pdbDelayDouble OxPhase Elec me])
   set mh ([pdbDelayDouble OxPhase Hole mh])
   pdbSetDouble OxPhase Elec Nc (2.50945e19*sqrt($me*$me*$me)*sqrt(Temp*Temp*Temp/2.7e7))
   pdbSetDouble OxPhase Hole Nv (2.50945e19*sqrt($mh*$mh*$mh)*sqrt(Temp*Temp*Temp/2.7e7))
   
   #parameters for OxPhase(same as AlGaN for continuity) low field mobility U=0
   pdbSetDouble OxPhase Elec mumin 312.1
   pdbSetDouble OxPhase Elec mumax 1401.3
   pdbSetDouble OxPhase Elec alpha 0.74
   pdbSetDouble OxPhase Elec beta1 -6.51
   pdbSetDouble OxPhase Elec beta2 -2.31
   pdbSetDouble OxPhase Elec beta3 7.07
   pdbSetDouble OxPhase Elec beta4 -0.86
   pdbSetDouble OxPhase Elec Nref 1e17
   set Omumin ([pdbGetDouble OxPhase Elec mumin])
   set Omumax ([pdbGetDouble OxPhase Elec mumax])
   set Olowalpha ([pdbGetDouble OxPhase Elec alpha])
   set Obeta1 ([pdbGetDouble OxPhase Elec beta1])
   set Obeta2 ([pdbGetDouble OxPhase Elec beta2])
   set Obeta3 ([pdbGetDouble OxPhase Elec beta3])
   set Obeta4 ([pdbGetDouble OxPhase Elec beta4])
   set ONref ([pdbGetDouble OxPhase Elec Nref])

   #build equation for low field mobility
   set Oseg1 "$Omumin*(exp(log(Temp/300)*($Obeta1)))"
   set Oseg2 "($Omumax-$Omumin)*(exp(log(Temp/300)*($Obeta2)))"
   set Oseg3 "$ONref*(exp(log(Temp/300)*($Obeta3)))"
   set Oseg4 "abs((Doping+1)/$Oseg3)"
   set Oseg5 "$Olowalpha*(exp(log(Temp/300)*($Obeta4)))"
   set Oseg6 "exp(log($Oseg4)*($Oseg5))"
   set Oseg7 "1+$Oseg6"
   pdbSetDouble OxPhase Elec lowfldmob "($Oseg1+(($Oseg2)/($Oseg7)))"
 
   #set electron mobility via analytical expression from Farahmand for high field mobility U=0
   #pdbSetDouble OxPhase Elec lowfldmob 213.1
   pdbSetDouble OxPhase Elec alpha 6.9502
   pdbSetDouble OxPhase Elec n1 7.8138
   pdbSetDouble OxPhase Elec n2 0.7897
   pdbSetDouble OxPhase Elec Ecmob 245579.4
   pdbSetDouble OxPhase vsat 2.02e7 
   
   set Olowfldmob ([pdbGetDouble OxPhase Elec lowfldmob]) 
   set Ohighalpha ([pdbGetDouble OxPhase Elec alpha])
   set On1 ([pdbGetDouble OxPhase Elec n1])
   set On2 ([pdbGetDouble OxPhase Elec n2])
   set OEcmob ([pdbGetDouble OxPhase Elec Ecmob])
   set Ovsat ([pdbGetDouble OxPhase vsat])
   #set OEfield "(sqrt(dot(DevPsi,DevPsi)+1.0e2))"
   #set OEfield "(sqrt(dot(Qfn,Qfn)+1.0e6))"
   set OEfield "(sqrt(dot(DevPsi,DevPsi)+1.0))"
   set OEfield_EcRatio "($OEfield)/($OEcmob)"
   set OEn1 "exp(log($OEfield_EcRatio)*($On1-1))"
   set OEn2 "exp(log($OEfield_EcRatio)*($On2))"
   set Onum "($Olowfldmob+($Ovsat*($OEn1)/($OEcmob)))"
   set Oden "(1.0+($Ohighalpha*($OEn2))+($OEn1*$OEfield_EcRatio))"
   #pdbSetDouble OxPhase Elec mob "($Onum)/($Oden)"
   pdbSetDouble OxPhase Elec mob 213.3
   #pdbSetDouble OxPhase Elec mob 3e6
   pdbSetDouble OxPhase Hole mob 0.2
   #pdbSetDouble OxPhase Hole mob 100

Adding Silicon Carbide parameters of band structure and electrical properties follows here:

mater add name=SiC
   
   #Set Youngs Modulus and Poissons Ratio(google)
 pdbSetString SiC YoungsModulus 4.50e12    
 pdbSetString SiC PoissonRatio 0.183
   
   #define the parameters for SiC 
   pdbSetDouble SiC DevPsi RelEps 9.6
   #set SiC electron affinity
   pdbSetDouble SiC Affinity 3.7
   #set SiC bandgap
   pdbSetDouble SiC Eg "3.2-((3.3e-2*Temp*Temp)/(1.0e5+Temp))"
   
   #Set Ev and Ec using SiC Ei as zero
   pdbSetDouble SiC Hole Ev "((-[pdbGetDouble SiC Affinity])-([pdbGetDouble SiC Eg])+(DevPsi))"
   pdbSetDouble SiC Elec Ec "((-[pdbGetDouble SiC Affinity])+(DevPsi))"
   #copied from GaN need to look up constants for SiC   
   pdbSetDouble SiC Hole Nv (4.6e19*sqrt(Temp*Temp*Temp/2.7e7))
   pdbSetDouble SiC Elec Nc (2.3e18*sqrt(Temp*Temp*Temp/2.7e7))
   #parameters for SiC low field mobility copied from AlGaN
   pdbSetDouble SiC Elec mumin 312.1
   pdbSetDouble SiC Elec mumax 1401.3
   pdbSetDouble SiC Elec alpha 0.74
   pdbSetDouble SiC Elec beta1 -6.51
   pdbSetDouble SiC Elec beta2 -2.31
   pdbSetDouble SiC Elec beta3 7.07
   pdbSetDouble SiC Elec beta4 -0.86
   pdbSetDouble SiC Elec Nref 1e17
   set Smumin ([pdbGetDouble SiC Elec mumin])
   set Smumax ([pdbGetDouble SiC Elec mumax])
   set Slowalpha ([pdbGetDouble SiC Elec alpha])
   set Sbeta1 ([pdbGetDouble SiC Elec beta1])
   set Sbeta2 ([pdbGetDouble SiC Elec beta2])
   set Sbeta3 ([pdbGetDouble SiC Elec beta3])
   set Sbeta4 ([pdbGetDouble SiC Elec beta4])
   set SNref ([pdbGetDouble SiC Elec Nref])

   #build equation for low field mobility
   set Sseg1 "($Smumin)*(exp(log(Temp/300)*($Sbeta1)))"
   set Sseg2 "($Smumax-$Smumin)*(exp(log(Temp/300)*($Sbeta2)))"
   set Sseg3 "$SNref*(exp(log(Temp/300)*($Sbeta3)))"
   set Sseg4 "abs((Doping+1)/$Sseg3)"
   set Sseg5 "$Slowalpha*(exp(log(Temp/300)*($Sbeta4)))"
   set Sseg6 "exp(log($Sseg4)*($Sseg5))"
   set Sseg7 "1+$Sseg6"
   pdbSetDouble SiC Elec lowfldmob "($Sseg1+(($Sseg2)/($Sseg7)))"
 
   #set electron mobility copied from AlGaN
   #pdbSetDouble SiC Elec lowfldmob 213.1
   pdbSetDouble SiC Elec alpha 6.9502
   pdbSetDouble SiC Elec n1 7.8138
   pdbSetDouble SiC Elec n2 0.7897
   pdbSetDouble SiC Elec Ecmob 245579.4
   pdbSetDouble SiC vsat 2.02e7 
  
   set Slowfldmob ([pdbGetDouble SiC Elec lowfldmob]) 
   set Shighalpha ([pdbGetDouble SiC Elec alpha])
   set Sn1 ([pdbGetDouble SiC Elec n1])
   set Sn2 ([pdbGetDouble SiC Elec n2])
   set SEcmob ([pdbGetDouble SiC Elec Ecmob])
   set Svsat ([pdbGetDouble SiC vsat])
   #set SEfield "(sqrt(dot(DevPsi,DevPsi)+1.0e2))"
   set SEfield "(sqrt(dot(Qfn,Qfn)+1.0e6))"
   set SEfield_EcRatio "($SEfield)/($SEcmob)"
   set SEn1 "exp(log($SEfield_EcRatio)*($Sn1-1))"
   set SEn2 "exp(log($SEfield_EcRatio)*($Sn2))"
   set Snum "($Slowfldmob+($Svsat*($SEn1)/($SEcmob)))"
   set Sden "(1.0+($Shighalpha*($SEn2))+($SEn1*$SEfield_EcRatio))"
   pdbSetDouble SiC Elec mob $Slowfldmob
   #pdbSetDouble SiC Elec mob "($Snum)/($Sden)"
   #pdbSetDouble SiC Elec mob 230
   
   pdbSetDouble SiC Hole mob 0.20

Adding Aluminium Nitride parameters of band structure and electrical properties follows here:

mater add name=AlN
   
   #Set Youngs Modulus and Poissons Ratio(google)
pdbSetString AlN YoungsModulus 3.31e12
pdbSetString AlN PoissonRatio 0.22
    
   #define the parameters for AlN 
   pdbSetDouble AlN DevPsi RelEps 8.5
   #set AlN electron affinity
   pdbSetDouble AlN Affinity 1.2121
   #set AlN bandgap
   #pdbSetDouble AlN Eg 3.0
   pdbSetDouble AlN Eg "6.13+((1.80e-3*300*300)/(1.462e3+300))-((1.80e-3*Temp*Temp)/(1.462e3+Temp))"
   
   #Set Ev and Ec using AlN Ei as zero
   pdbSetDouble AlN Hole Ev "((-[pdbGetDouble AlN Affinity])-([pdbGetDouble AlN Eg])+(DevPsi))"
   pdbSetDouble AlN Elec Ec "((-[pdbGetDouble AlN Affinity])+(DevPsi))"
   #Set AlN Nc and Nv 
   pdbSetDouble AlN Hole Nv (4.6e19*sqrt(Temp*Temp*Temp/2.7e7))
   pdbSetDouble AlN Elec Nc (2.3e18*sqrt(Temp*Temp*Temp/2.7e7))
   #parameters for AlN low field mobility from Farahmand
   pdbSetDouble AlN Elec mumin 297.8
   pdbSetDouble AlN Elec mumax 683.8
   pdbSetDouble AlN Elec alpha 1.16
   pdbSetDouble AlN Elec beta1 -1.82
   pdbSetDouble AlN Elec beta2 -3.43
   pdbSetDouble AlN Elec beta3 3.78
   pdbSetDouble AlN Elec beta4 0.86
   pdbSetDouble AlN Elec Nref 1e17
   set ANmumin ([pdbGetDouble AlN Elec mumin])
   set ANmumax ([pdbGetDouble AlN Elec mumax])
   set ANlowalpha ([pdbGetDouble AlN Elec alpha])
   set ANbeta1 ([pdbGetDouble AlN Elec beta1])
   set ANbeta2 ([pdbGetDouble AlN Elec beta2])
   set ANbeta3 ([pdbGetDouble AlN Elec beta3])
   set ANbeta4 ([pdbGetDouble AlN Elec beta4])
   set ANNref ([pdbGetDouble AlN Elec Nref])

   #build equation for low field mobility
   set ANseg1 "($ANmumin)*(exp(log(Temp/300)*($ANbeta1)))"
   set ANseg2 "($ANmumax-$ANmumin)*(exp(log(Temp/300)*($ANbeta2)))"
   set ANseg3 "$ANNref*(exp(log(Temp/300)*($ANbeta3)))"
   set ANseg4 "abs((Doping+1)/$ANseg3)"
   set ANseg5 "$ANlowalpha*(exp(log(Temp/300)*($ANbeta4)))"
   set ANseg6 "exp(log($ANseg4)*($ANseg5))"
   set ANseg7 "1+$ANseg6"
   pdbSetDouble AlN Elec lowfldmob "($ANseg1+(($ANseg2)/($ANseg7)))"
 
   #set electron mobility via analytical expression from Farahmand for high field mobility U=0
   #pdbSetDouble AlN Elec lowfldmob 213.1
   pdbSetDouble AlN Elec alpha 8.7253
   pdbSetDouble AlN Elec n1 17.3681
   pdbSetDouble AlN Elec n2 0.8554
   pdbSetDouble AlN Elec Ecmob 447033.9
   pdbSetDouble AlN vsat 2.167e7 
  
   set ANlowfldmob ([pdbGetDouble AlN Elec lowfldmob]) 
   set ANhighalpha ([pdbGetDouble AlN Elec alpha])
   set ANn1 ([pdbGetDouble AlN Elec n1])
   set ANn2 ([pdbGetDouble AlN Elec n2])
   set ANEcmob ([pdbGetDouble AlN Elec Ecmob])
   set ANvsat ([pdbGetDouble AlN vsat])
   set ANEfield "(sqrt(dot(DevPsi,DevPsi)+1.0e2))"
   set ANEfield_EcRatio "($ANEfield)/($ANEcmob)"
   set ANEn1 "exp(log($ANEfield_EcRatio)*($ANn1-1))"
   set ANEn2 "exp(log($ANEfield_EcRatio)*($ANn2))"
   set ANnum "($ANlowfldmob+($ANvsat*($ANEn1)/($ANEcmob)))"
   set ANden "(1.0+($ANhighalpha*($ANEn2))+($ANEn1*$ANEfield_EcRatio))"
   pdbSetDouble AlN Elec mob $ANlowfldmob
   #pdbSetDouble AlN Elec mob "($ANnum)/($ANden)"
   #pdbSetDouble AlN Elec mob 230
   
   pdbSetDouble AlN Hole mob 0.20

Adding Metal parameters of band structure and electrical properties follows here:

 mater add name=Metal    
 #set Metal electron affinity
  #pdbSetDouble Metal Affinity 4.1
  pdbSetDouble Metal Affinity 0.01
  set affM ([pdbDelayDouble Metal Affinity])
   #pdbSetDouble Nitride DevPsi RelEps 3.9
   
   #set Metal bandgap
   pdbSetDouble Metal Eg 0.033
   
   #Set Ev and Ec using AlGaN Ei as zero
   pdbSetDouble Metal Hole Ev "((-[pdbGetDouble Metal Affinity])-([pdbGetDouble Metal Eg])+(DevPsi))"
   pdbSetDouble Metal Elec Ec "((-[pdbGetDouble Metal Affinity])+(DevPsi))"
   #copied from Full deck, don't know where the constants come from
   pdbSetDouble Metal Elec me "((0.4*AlN_Ratio+0.20*(1-AlN_Ratio)))"
   pdbSetDouble Metal Hole mh "((1.5*AlN_Ratio+3.53*(1-AlN_Ratio)))"
   
   set meM ([pdbDelayDouble Metal Elec me])
   set mhM ([pdbDelayDouble Metal Hole mh])
   pdbSetDouble Metal Elec Nc (2.50945e22*sqrt($meM*$meM*$meM)*sqrt(Temp*Temp*Temp/2.7e7))
   pdbSetDouble Metal Hole Nv (2.50945e22*sqrt($mhM*$mhM*$mhM)*sqrt(Temp*Temp*Temp/2.7e7))
   set ncM ([pdbDelayDouble Metal Elec Nc])
   pdbSetDouble Metal vsat 1.9064e7 
   pdbSetDouble Metal Elec mob 3e6
   #set Efield "(abs(1)/(sqrt(dot(Qfn,Qfn)+1)))"
   #set Efield "(sqrt(dot(Qfn,Qfn)+1.0e6))"
   set Efield "(sqrt(dot(DevPsi,DevPsi)+1.0))"
   pdbSetDouble Metal Hole mob 0.2

Adding Silicon Nitride parameters of band structure and electrical properties follows here:

  mater add name=Nitride    
  #set Nitride electron affinity
  pdbSetDouble Nitride Affinity 0.95
  set affO ([pdbDelayDouble Nitride Affinity])
   pdbSetDouble Nitride DevPsi RelEps 3.9
   
   #set Metal bandgap-Don't know where the 1.3 value comes from
   pdbSetDouble Nitride Eg 9.0
   #pdbSetDouble Nitride Eg "(6.13*AlN_Ratio+[pdbDelayDouble GaN Eg]*(1-AlN_Ratio)-1.3*AlN_Ratio*(1-AlN_Ratio))"
   #Set Ev and Ec using AlGaN Ei as zero
   pdbSetDouble Nitride Hole Ev "((-[pdbGetDouble Nitride Affinity])-([pdbGetDouble Nitride Eg])+(DevPsi))"
   pdbSetDouble Nitride Elec Ec "((-[pdbGetDouble Nitride Affinity])+(DevPsi))"
   #copied from Full deck, don't know where the constants come from
   pdbSetDouble Nitride Elec me "((0.4*AlN_Ratio+0.20*(1-AlN_Ratio)))"
   pdbSetDouble Nitride Hole mh "((1.5*AlN_Ratio+3.53*(1-AlN_Ratio)))"
   
   set meO ([pdbDelayDouble Nitride Elec me])
   set mhO ([pdbDelayDouble Nitride Hole mh])
   pdbSetDouble Nitride Elec Nc (2.50945e15*sqrt($meO*$meO*$meO)*sqrt(Temp*Temp*Temp/2.7e7))
   pdbSetDouble Nitride Hole Nv (2.50945e15*sqrt($mhO*$mhO*$mhO)*sqrt(Temp*Temp*Temp/2.7e7))
   set ncO ([pdbDelayDouble Nitride Elec Nc])
   pdbSetDouble Nitride vsat 1.9064e2 
   pdbSetDouble Nitride Elec mob 3e1
   #set Efield "(abs(1)/(sqrt(dot(Qfn,Qfn)+1)))"
   #set Efield "(sqrt(dot(DevPsi,DevPsi)+1.0e2))"
   #set Efield "(sqrt(dot(Qfn,Qfn)+1.0e6))"
   set Efield "(sqrt(dot(DevPsi,DevPsi)+1.0))"
   pdbSetDouble Nitride Hole mob 0.2


Solution variables are added here:

solution add name=Temp solve pde !negative continuous damp
#solution add name=Temp const val=300.0
solution add name=Impurity solve negative damp
solution add name=Oxin solve negative damp
solution add name=Traps solve negative damp
solution add name=hotMu solve !negative continuous  
solution add name=ETemp solve pde !negative continuous 


pdbSetDouble AlGaN Temp Abs.Error 0.1
pdbSetDouble AlGaN Temp Rel.Error 1.0e-2
pdbSetDouble AlGaN Temp DampValue 10.0
pdbSetDouble GaN Temp Abs.Error 0.1
pdbSetDouble GaN Temp Rel.Error 1.0e-2
pdbSetDouble GaN Temp DampValue 10.0
pdbSetDouble SiC Temp Abs.Error 0.1
pdbSetDouble SiC Temp Rel.Error 1.0e-2
pdbSetDouble SiC Temp DampValue 10.0
pdbSetDouble AlN Temp Abs.Error 0.1
pdbSetDouble AlN Temp Rel.Error 1.0e-2
pdbSetDouble AlN Temp DampValue 10.0
pdbSetDouble Metal Temp Abs.Error 0.1
pdbSetDouble Metal Temp Rel.Error 1.0e-2
pdbSetDouble Metal Temp DampValue 10.0
pdbSetDouble Nitride Temp Abs.Error 0.1
pdbSetDouble Nitride Temp Rel.Error 1.0e-2
pdbSetDouble Nitride Temp DampValue 10.0
pdbSetDouble OxPhase Temp Abs.Error 0.1
pdbSetDouble OxPhase Temp Rel.Error 1.0e-2
pdbSetDouble OxPhase Temp DampValue 10.0

Thermal transport parameters for materials are set here:

pdbSetDouble GaN Thermalk "2.6725+(-4.25e-3*Temp)+(3.0e-6*Temp*Temp)"
pdbSetDouble GaN Heatcap "1.395+(5.14e-3*Temp)+(-3.67e-6*Temp*Temp)"
pdbSetDouble AlGaN Thermalk 0.33
pdbSetDouble AlGaN Heatcap 2.0
pdbSetDouble SiC Thermalk 1.20
pdbSetDouble SiC Heatcap 2.40
pdbSetDouble AlN Thermalk 2.85
pdbSetDouble AlN Heatcap 2.584
pdbSetDouble Nitride Thermalk 2.85
pdbSetDouble Nitride Heatcap 2.584
pdbSetDouble OxPhase Thermalk 2.85
pdbSetDouble OxPhase Heatcap 2.584

Thermal Transport Equations. These determine lattice temperatures within the device structure. The variable is defined as, "Temp".

set eqn "((([pdbGetDouble GaN Heatcap]) * ddt(Temp))) - ([pdbGetDouble GaN Thermalk] * grad(Temp)) - ($q * [pdbGetDouble  GaN Elec mob] * (Elec) * dot(Qfn,Qfn))"
pdbSetString GaN Temp Equation $eqn
set eqn "((([pdbGetDouble AlGaN Heatcap]) * ddt(Temp))) - (([pdbGetDouble AlGaN Thermalk]) * (grad(Temp))) - ($q * pdbGetDouble AlGaN Elec mob] * (Elec) * dot(Qfn,Qfn))"
pdbSetString AlGaN Temp Equation $eqn
set eqn "([pdbGetDouble SiC Heatcap] * ddt(Temp)) - (([pdbGetDouble SiC Thermalk]) * (grad(Temp))) - ($q * [pdbGetDouble  SiC Elec mob] * (Elec) * dot(Qfn,Qfn)"
pdbSetString SiC Temp Equation $eqn
set eqn "([pdbGetDouble AlN Heatcap] * ddt(Temp)) - (([pdbGetDouble AlN Thermalk]) * (grad(Temp))) - ($q * [pdbGetDouble  AlN Elec mob] * (Elec) * dot(Qfn,Qfn))"
pdbSetString AlN Temp Equation $eqn
set eqn "([pdbGetDouble Nitride Heatcap] * ddt(Temp)) - (([pdbGetDouble Nitride Thermalk]) * (grad(Temp))) - ($q *  [pdbGetDouble Nitride Elec mob] * (Elec) * dot(Qfn,Qfn))"
pdbSetString Nitride Temp Equation $eqn
set eqn "([pdbGetDouble OxPhase Heatcap] * ddt(Temp)) - (([pdbGetDouble OxPhase Thermalk]) * (grad(Temp))) - ($q *  [pdbGetDouble OxPhase Elec mob] * (Elec) * dot(Qfn,Qfn))"
pdbSetString OxPhase Temp Equation $eqn

New electron temperature( electron energy) added here:

pdbSetDouble AlGaN ETemp Abs.Error 0.1
pdbSetDouble AlGaN ETemp Rel.Error 1.0e-2
pdbSetDouble AlGaN ETemp DampValue 10.0
pdbSetDouble GaN ETemp Abs.Error 0.1
pdbSetDouble GaN ETemp Rel.Error 1.0e-2
pdbSetDouble GaN ETemp DampValue 10.0
pdbSetDouble Metal ETemp Abs.Error 0.1
pdbSetDouble Metal ETemp Rel.Error 1.0e-2
pdbSetDouble Metal ETemp DampValue 10.0
pdbSetDouble Nitride ETemp Abs.Error 0.1
pdbSetDouble Nitride ETemp Rel.Error 1.0e-2
pdbSetDouble Nitride ETemp DampValue 10.0
pdbSetDouble OxPhase ETemp Abs.Error 0.1
pdbSetDouble OxPhase ETemp Rel.Error 1.0e-2
pdbSetDouble OxPhase ETemp DampValue 10.0

Non-equilibrium transport parameters for materials are set here:

pdbSetDouble GaN Kgan "5/2*($kev)*($kev)*$q*($ericmob*sqrt((Temp/(ETemp+10))))*(Elec+1e2)/5e5" 
pdbSetDouble AlGaN Kalgan "5/2*($kev)*($kev)*$q*213.3*(Elec+1e2)/5e5" 
pdbSetDouble OxPhase Kox "5/2*($kev)*($kev)*$q*213.3*(Elec+1e2)/5e5" 
pdbSetDouble Nitride Knit "5/2*($kev)*($kev)*$q*3e1*(Elec+1e2)/5e5" 

Energy Balance Equations. These determine electron energies (expressed as the equivalent temperatures) within the device structure. The variable is defined as, "ETemp".

set eqn "(1.5 * (Elec) * $k * ddt(ETemp)) - (([pdbGetDouble GaN Kgan]) * (ETemp) * grad(ETemp)) - (2.5 * $k * (Elec) *  ($ericmob*sqrt((Temp/(ETemp+10)))) * dot(Qfn,y*1e-6)) + ($q * ($ericmob*sqrt((Temp/(ETemp+10)))) * (Elec) * dot(Qfn,y*1e- 6) * (sqrt(dot(Qfn*1e-4,Qfn*1e-4)+1.0))) + ((Elec) * $k *1.5 * ((ETemp) - (Temp)) / $tau)"
pdbSetString GaN ETemp Equation $eqn
set eqn "(1.5 * (Elec) * $k * ddt(ETemp)) - (([pdbGetDouble AlGaN Kalgan]) * (ETemp) * grad(ETemp)) - (2.5 * $k * (Elec)  * 213.3 * dot(Qfn,y*1e-6)) + ($q * 213.3 * (Elec) * dot(Qfn,y*1e-6) * (sqrt(dot(Qfn*1e-4,Qfn*1e-4)+1.0))) +  ((Elec) * $k * 1.5 * ((ETemp) - (Temp)) / $tau)"
pdbSetString AlGaN ETemp Equation $eqn
set eqn "(1.5 * (Elec) * $k * ddt(ETemp)) - (([pdbGetDouble OxPhase Kgan]) * (ETemp) * grad(ETemp)) - (2.5 * $k * (Elec)  * 213.3 * dot(Qfn,y*1e-6)) + ($q * 213.3 * (Elec) * dot(Qfn,y*1e-6) * (sqrt(dot(Qfn*1e-4,Qfn*1e-4)+1.0))) +  ((Elec) * $k *1.5 * ((ETemp) - (Temp)) / $tau)"
pdbSetString OxPhase ETemp Equation $eqn
set eqn "(1.5 * (Elec) * $k * ddt(ETemp)) - (([pdbGetDouble Nitride Kalgan]) * (ETemp) * grad(ETemp)) - (2.5 * $k *  (Elec) * 3e1 * dot(Qfn,y*1e-6)) + ($q * 3e1 * (Elec) * dot(Qfn,y*1e-6) * (sqrt(dot(Qfn*1e-4,Qfn*1e-4)+1.0))) + ((Elec) *  $k * 1.5 * ((ETemp) - (Temp)) / $tau)"
pdbSetString Nitride ETemp Equation $eqn

Device equations,(Poisson & Continuity equations),and solution variables for equations set here:

solution add name=DevPsi solve negative damp continuous
solution add name=Qfp solve negative damp continuous
solution add name=Qfn solve negative damp continuous
pdbSetDouble OxPhase DevPsi RelEps 9.0
pdbSetDouble metal DevPsi RelEps 5e6
proc HCarrier {Mat} {
   
   pdbSetDouble $Mat hotMu DampValue 10
   pdbSetDouble $Mat hotMu Abs.Error 1.0e-2
   pdbSetDouble $Mat hotMu Rel.Error 1.0e-2
   set eqn " hotMu - sqrt((Temp/(ETemp+10))) "
   pdbSetString $Mat hotMu Equation $eqn
}
HCarrier GaN
HCarrier AlGaN
HCarrier OxPhase
HCarrier Nitride

Poisson equation for device with no added impurities other than initially set Doping:

proc Poisson {Mat} {
   global k q eps0
   pdbSetDouble $Mat DevPsi DampValue 0.025
   pdbSetDouble $Mat DevPsi Abs.Error 1.0e-2
   pdbSetDouble $Mat DevPsi Rel.Error 1.0e-2
   set eqn "- ($eps0 * [pdbDelayDouble $Mat DevPsi RelEps] * grad(DevPsi) / $q) + Doping - Elec + Hole"
   pdbSetString $Mat DevPsi Equation $eqn
}
#Poisson AlGaN
#Poisson metal
#Poisson Oxide
#Poisson SiC
#Poisson AlN
#Poisson GaN

Poisson equation for device with impurities introduced other than initially set Doping, eg from metal diffusion into AlGaN:

proc TrapsPoisson {Mat} {
   global VtRoom k q eps0
   pdbSetDouble $Mat DevPsi DampValue $VtRoom
   pdbSetDouble $Mat DevPsi Abs.Error 1.0e-2
   pdbSetDouble $Mat DevPsi Rel.Error 1.0e-2
   solution name=DevPsi damp negative add solve
   set eqn "- ($eps0 * [pdbDelayDouble $Mat DevPsi RelEps] * grad(DevPsi) / $q) + Doping - Elec + Hole +Impurity +Oxin"
   pdbSetString $Mat DevPsi Equation $eqn
}
TrapsPoisson GaN
TrapsPoisson AlGaN
#TrapsPoisson OxPhase

Poisson equation for insulator material within device:

proc InsPoisson {Mat} {
   global VtRoom k q eps0
   pdbSetDouble $Mat DevPsi DampValue $VtRoom
   pdbSetDouble $Mat DevPsi Abs.Error 1.0e-2
   pdbSetDouble $Mat DevPsi Rel.Error 1.0e-2
   #set eqn "- ($eps0 * [pdbDelayDouble $Mat DevPsi RelEps] * grad(DevPsi) / $q) + HotE " 
   set eqn "- ($eps0 * [pdbDelayDouble $Mat DevPsi RelEps] * grad(DevPsi) / $q)" 
   pdbSetString $Mat DevPsi Equation $eqn
}
#InsPoisson Metal
InsPoisson Nitride
InsPoisson OxPhase
proc PoissonAcceptorTrap {Mat Conc Level} {
   global k q eps0 Vt
   pdbSetDouble $Mat DevPsi DampValue 0.025
   pdbSetDouble $Mat DevPsi Abs.Error 1.0e-2
   pdbSetDouble $Mat DevPsi Rel.Error 1.0e-2
   #set Trap "(($Conc) / 1 + 2 * exp( (Eval + $Level - Qfp) / ($Vt) ))"
   #set e "$Trap"

   set e "(($Conc) / 1 + 2 * exp( (Eval + $Level - Qfp) / ($Vt) ))"
   solution add name=Trap solve $Mat const val = ($e)
   set eqn "- ($eps0 * [pdbDelayDouble $Mat DevPsi RelEps] * grad(DevPsi) / $q) + Doping - Trap - Elec + Hole"
   pdbSetString $Mat DevPsi Equation $eqn
}
#PoissonAcceptorTrap GaN 6.5e16 0.9
#PoissonAcceptorTrap AlGaN 6.5e16 0.9
proc PoissonAcceptorTrap {Mat Level} {
   global k q eps0 Vt
   pdbSetDouble $Mat DevPsi DampValue 0.025
   pdbSetDouble $Mat DevPsi Abs.Error 1.0e-2
   pdbSetDouble $Mat DevPsi Rel.Error 1.0e-2
   #set Trap "(($Conc) / 1 + 2 * exp( (Eval + $Level - Qfp) / ($Vt) ))"
   #set e "$Trap"

   set e "((Oxin) / 1 + 2 * exp( (Eval + $Level - Qfp) / ($Vt) ))"
   solution add name=Traps solve $Mat const val = ($e)
   set eqn "- ($eps0 * [pdbDelayDouble $Mat DevPsi RelEps] * grad(DevPsi) / $q) + Doping - Traps - Elec + Hole"
   pdbSetString $Mat DevPsi Equation $eqn
}
#PoissonAcceptorTrap GaN 1.0
#PoissonAcceptorTrap AlGaN 1.0

Continuity equations (elec and hole):

proc ElecContinuity {Mat} {
   global Vt kev
   pdbSetDouble $Mat Qfn Rel.Error 1.0e-2
   pdbSetDouble $Mat Qfn Abs.Error 1.0e-2
   pdbSetDouble $Mat Qfn DampValue 0.025
   set eqn "ddt(Elec) - ([pdbDelayDouble $Mat Elec mob]) * (Elec+1.0e0) * grad(Qfn)"
   #set eqn "ddt(Elec) - ([pdbDelayDouble $Mat Elec mob]) * Elec * grad(Qfn)"
  
   pdbSetString $Mat Qfn Equation $eqn
   pdbSetString $Mat Qfn Equation $eqn
     
   pdbSetString $Mat Qfn Equation $eqn
   pdbSetString $Mat Qfn Equation $eqn
   set e "([pdbDelayDouble $Mat Elec Ec])"
   solution add name=Econd solve $Mat const val = ($e)
   set e "([pdbDelayDouble $Mat Elec Nc]) * exp( -(Econd-Qfn) / ($Vt) )"
   #set e "([pdbDelayDouble $Mat Elec Nc]) * exp( -(Econd-Qfn) / ($Vet) )"
   solution add name=Elec solve $Mat const val = "($e)"
}
ElecContinuity GaN
ElecContinuity AlGaN
ElecContinuity SiC
ElecContinuity AlN
ElecContinuity OxPhase
ElecContinuity Nitride
proc HoleContinuity {Mat} {
   global Vt kev
   pdbSetDouble $Mat Qfp Rel.Error 1.0e-2
   pdbSetDouble $Mat Qfp Abs.Error 1.0e-2
   pdbSetDouble $Mat Qfp DampValue 0.025
   #set eqn "ddt(Hole) - ([pdbDelayDouble $Mat Hole mob]) * (Hole+1.0e10) * grad(Qfp)"
   set eqn "ddt(Hole) - ([pdbDelayDouble $Mat Hole mob]) * (Hole+1.0e0) * grad(Qfp)"
   pdbSetString $Mat Qfp Equation $eqn
   set e "([pdbDelayDouble $Mat Hole Ev])"
   solution add name=Eval solve $Mat const val = ($e)
   set e "([pdbDelayDouble $Mat Hole Nv]) * exp( -(Qfp - Eval) / ($Vt) )"
   #set e "([pdbDelayDouble $Mat Hole Nv]) * exp( -(Qfp - Eval) / ($Vet) )"
   solution name=Hole solve $Mat const val = "($e)"
}
HoleContinuity GaN
HoleContinuity AlGaN
HoleContinuity SiC
HoleContinuity AlN
HoleContinuity OxPhase
HoleContinuity Nitride
solution name=Hole Gas const val=0.0
solution name=Eval Gas const val=0.0

The interface charge which forms the 2DEG is an AlGaN/GaN device is added here. It can be changed according to the AlN ratio which is set in the script which builds the device eg T_gateDiff or ETemp1 given as examples. It is now set to 1.0e13/cm2:

pdbSetString AlGaN_GaN DevPsi Equation "1.0e13"
#pdbSetString AlGaN_GaN DevPsi Equation "7e12"
#pdbSetString AlGaN_GaN DevPsi Equation "1.0e13*exp(-(y*y)/(0.2))"
#pdbSetString AlGaN_GaN DevPsi Equation "(1e13*log(AlN_Ratio)+3e13)"

Barrier height (Ec energy difference) between metal and AlGaN. Given as "phiB":

#set phiB 
#per Ambacher et al, used by Heller, 1.3x+0.84, with x=0.26
set phiB 1.5
#set phiB 1.2255

Fixes gate as a Schottky contact:

pdbSetString G DevPsi Equation "([pdbDelayDouble OxPhase Elec Ec])+G-$phiB"
pdbSetBoolean G DevPsi Fixed 1
pdbSetDouble G DevPsi Flux.Scale 1.602e-19
pdbSetString G Qfp Equation "Qfp+G"
pdbSetBoolean G Qfp Fixed 1
pdbSetDouble G Qfp Flux.Scale 1.602e-19

Electrical Boundary Conditions. Assume source, drain and body contacts are ohmic:

#create a procedure for ohmic contacts
proc Ohmic {Mat Contact} {
   global Vt
   pdbSetDouble $Contact Qfp Rel.Error 1.0e-2
   pdbSetDouble $Contact Qfp Abs.Error 1.0e-2
   pdbSetDouble $Contact Qfp DampValue 0.025
   pdbSetDouble $Contact Qfn Rel.Error 1.0e-2
   pdbSetDouble $Contact Qfn Abs.Error 1.0e-2
   pdbSetDouble $Contact Qfn DampValue 0.025
   pdbSetDouble $Contact DevPsi Rel.Error 1.0e-2
   pdbSetDouble $Contact DevPsi Abs.Error 1.0e-2
   pdbSetDouble $Contact DevPsi DampValue 0.025
   #set all quantities fixed here
   pdbSetBoolean $Contact Qfn Fixed 1
   pdbSetBoolean $Contact Qfp Fixed 1
   pdbSetBoolean $Contact DevPsi Fixed 1
   #we'd like to keep fluxes around
   pdbSetBoolean $Contact Qfn Flux 1
   pdbSetBoolean $Contact Qfp Flux 1
   pdbSetBoolean $Contact DevPsi Flux 1
   pdbSetDouble $Contact Qfn Flux.Scale 1.602e-19
   pdbSetDouble $Contact Qfp Flux.Scale 1.602e-19
   pdbSetDouble $Contact DevPsi Flux.Scale 1.602e-19
   #this needs streamlining!
   set e "([pdbDelayDouble $Mat Elec Nc]) * exp(-([pdbDelayDouble $Mat Elec Ec] - Qfn) / ($Vt) )"
   set h "([pdbDelayDouble $Mat Hole Nv]) * exp(-(Qfp - [pdbDelayDouble $Mat Hole Ev]) / ($Vt) )"
   pdbSetString $Contact DevPsi Equation "Doping-$e+$h"
   pdbSetString $Contact Qfn Equation "Qfn+$Contact"
   pdbSetString $Contact Qfp Equation "Qfp+$Contact"
}
Ohmic AlGaN S
Ohmic AlGaN D
Ohmic GaN B
Ohmic AlGaN F1
Ohmic AlGaN F2
pdbSetBoolean B Temp Fixed 0
pdbSetString B Temp Equation "(2.7*(Temp-300.0))/0.00125"

Electrical Initial Conditions. The Initialize procedure:

proc Initialize {} {
   global Vt
   sel z=300.00 name=Temp
   sel z=300.00 name=ETemp
   sel z=1.00 name=hotMu
   #four components - GaN ntype, GaN ptype, AlGaN ntype, AlGaN ptype
   #GaN First
   set nc "([pdbDelayDouble GaN Elec Nc])"
   set nv "([pdbDelayDouble GaN Hole Nv])"
   set aff "([pdbGetDouble GaN Affinity])"
   set Eg "([pdbGetDouble GaN Eg])"
   sel z= abs(Doping)+1.0 name=AbsDop
   sel z = "Mater(GaN) * ((Doping>0.0) ? (-$Vt * log( AbsDop / $nc) + $aff) : 0.0)"  name=GaN_N
   sel z = "Mater(GaN) * ((Doping<0.0) ? ($Vt * log(AbsDop / $nv) + $aff + $Eg) : 0.0)"  name=GaN_P
   #now AlGaN
   set nc "([pdbDelayDouble AlGaN Elec Nc])"
   set nv "([pdbDelayDouble AlGaN Hole Nv])"
   set aff "([pdbGetDouble AlGaN Affinity])"
   set Eg "([pdbGetDouble AlGaN Eg])"
   sel z = "Mater(AlGaN) * ((Doping>0.0) ? (-$Vt * log(AbsDop / $nc) + $aff) : 0.0)"  name=AlGaN_N
   sel z = "Mater(AlGaN) * ((Doping<0.0) ? ($Vt * log(AbsDop / $nv) + $aff + $Eg) : 0.0)"  name=AlGaN_P

   #now SiC
   set nc "([pdbDelayDouble SiC Elec Nc])"
   set nv "([pdbDelayDouble SiC Hole Nv])"
   set aff "([pdbGetDouble SiC Affinity])"
   set Eg "([pdbGetDouble SiC Eg])"
   sel z = "Mater(SiC) * ((Doping>0.0) ? (-$Vt * log(AbsDop / $nc) + $aff) : 0.0)"  name=SiC_N
   sel z = "Mater(SiC) * ((Doping<0.0) ? ($Vt * log(AbsDop / $nv) + $aff + $Eg) : 0.0)"  name=SiC_P
   #now AlN
   set nc "([pdbDelayDouble AlN Elec Nc])"
   set nv "([pdbDelayDouble AlN Hole Nv])"
   set aff "([pdbGetDouble AlN Affinity])"
   set Eg "([pdbGetDouble AlN Eg])"
   sel z = "Mater(AlN) * ((Doping>0.0) ?  (-$Vt * log(AbsDop / $nc) + $aff) : 0.0)"  name=AlN_N
   sel z = "Mater(AlN) * ((Doping<0.0) ?  ($Vt * log(AbsDop / $nv) + $aff + $Eg) : 0.0)"  name=AlN_P
   #now Metal
   set nc "([pdbDelayDouble Metal Elec Nc])"
   set nv "([pdbDelayDouble Metal Hole Nv])"
   set aff "([pdbGetDouble Metal Affinity])"
   set Eg "([pdbGetDouble Metal Eg])"
   sel z = "Mater(Metal) * ((Doping>0.0) ? (-$Vt * log(AbsDop / $nc) + $aff) : 0.0)"  name=Metal_N
   sel z = "Mater(Metal) * ((Doping<0.0) ? ($Vt * log(AbsDop / $nv) + $aff + $Eg) : 0.0)"  name=Metal_P
   #now OxPhase
   set nc "([pdbDelayDouble OxPhase Elec Nc])"
   set nv "([pdbDelayDouble OxPhase Hole Nv])"
   set aff "([pdbGetDouble OxPhase Affinity])"
   set Eg "([pdbGetDouble OxPhase Eg])"
   sel z = "Mater(OxPhase) * ((Doping>0.0) ? (-$Vt * log(AbsDop / $nc) + $aff) : 0.0)"  name=OxPhase_N
   sel z = "Mater(OxPhase) * ((Doping<0.0) ? ($Vt * log(AbsDop / $nv) + $aff + $Eg) : 0.0)"  name=OxPhase_P
  #now Nitride
   set nc "([pdbDelayDouble OxPhase Elec Nc])"
   set nv "([pdbDelayDouble OxPhase Hole Nv])"
   set aff "([pdbGetDouble OxPhase Affinity])"
   set Eg "([pdbGetDouble OxPhase Eg])"
   sel z = "Mater(Nitride) * ((Doping>0.0) ? (-$Vt * log(AbsDop / $nc) + $aff) : 0.0)"  name=Nitride_N
   sel z = "Mater(Nitride) * ((Doping<0.0) ? ($Vt * log(AbsDop / $nv) + $aff + $Eg) : 0.0)"  name=Nitride_P
   #sel z=GaN_N+GaN_P+AlGaN_N+AlGaN_P+Metal_N+Metal_P+OxPhase_N+OxPhase_P name=DevPsi
   sel z=GaN_N+GaN_P+AlGaN_N+AlGaN_P+Metal_N+Metal_P name=DevPsi
   #sel z=GaN_N+GaN_P+AlGaN_N+AlGaN_P+SiC_N+SiC_P+AlN_N+AlN_P name=DevPsi
  sel z=0 name=DonorTraps
  sel z=0.0 name=Qfn
  sel z=0.0 name=Qfp
  sel z=0.0 name=Impurity
  sel z=0.0 name=Oxin
  sel z=0.0 name=Traps
  sel z=0.0 name=HotE
   }

Secondary Initialize procedure. Used to begin a simulation in a device which has already been biased to a certain point, and lattice temp is no longer at room temp:

proc Initialize2 {} {
   global Vt
   #sel z=300.00 name=Temp
   #four components - GaN ntype, GaN ptype, AlGaN ntype, AlGaN ptype
   #GaN First
   set nc "([pdbDelayDouble GaN Elec Nc])"
   set nv "([pdbDelayDouble GaN Hole Nv])"
   set aff "([pdbGetDouble GaN Affinity])"
   set Eg "([pdbGetDouble GaN Eg])"
   sel z= abs(Doping)+1.0 name=AbsDop
   sel z = "Mater(GaN) * ((Doping>0.0) ? (-$Vt * log( AbsDop / $nc) + $aff) : 0.0)"  name=GaN_N
   sel z = "Mater(GaN) * ((Doping<0.0) ? ($Vt * log(AbsDop / $nv) + $aff + $Eg) : 0.0)"  name=GaN_P
   #now AlGaN
   set nc "([pdbDelayDouble AlGaN Elec Nc])"
   set nv "([pdbDelayDouble AlGaN Hole Nv])"
   set aff "([pdbGetDouble AlGaN Affinity])"
   set Eg "([pdbGetDouble AlGaN Eg])"
   sel z = "Mater(AlGaN) * ((Doping>0.0) ? (-$Vt * log(AbsDop / $nc) + $aff) : 0.0)"  name=AlGaN_N
   sel z = "Mater(AlGaN) * ((Doping<0.0) ? ($Vt * log(AbsDop / $nv) + $aff + $Eg) : 0.0)"  name=AlGaN_P

   #now SiC
   set nc "([pdbDelayDouble SiC Elec Nc])"
   set nv "([pdbDelayDouble SiC Hole Nv])"
   set aff "([pdbGetDouble SiC Affinity])"
   set Eg "([pdbGetDouble SiC Eg])"
   sel z = "Mater(SiC) * ((Doping>0.0) ? (-$Vt * log(AbsDop / $nc) + $aff) : 0.0)"  name=SiC_N
   sel z = "Mater(SiC) * ((Doping<0.0) ? ($Vt * log(AbsDop / $nv) + $aff + $Eg) : 0.0)"  name=SiC_P
   #now AlN
   set nc "([pdbDelayDouble AlN Elec Nc])"
   set nv "([pdbDelayDouble AlN Hole Nv])"
   set aff "([pdbGetDouble AlN Affinity])"
   set Eg "([pdbGetDouble AlN Eg])"
   sel z = "Mater(AlN) * ((Doping>0.0) ?  (-$Vt * log(AbsDop / $nc) + $aff) : 0.0)"  name=AlN_N
   sel z = "Mater(AlN) * ((Doping<0.0) ?  ($Vt * log(AbsDop / $nv) + $aff + $Eg) : 0.0)"  name=AlN_P
   #now Metal
   set nc "([pdbDelayDouble Metal Elec Nc])"
   set nv "([pdbDelayDouble Metal Hole Nv])"
   set aff "([pdbGetDouble Metal Affinity])"
   set Eg "([pdbGetDouble Metal Eg])"
   sel z = "Mater(Metal) * ((Doping>0.0) ? (-$Vt * log(AbsDop / $nc) + $aff) : 0.0)"  name=Metal_N
   sel z = "Mater(Metal) * ((Doping<0.0) ? ($Vt * log(AbsDop / $nv) + $aff + $Eg) : 0.0)"  name=Metal_P
   #now OxPhase
   set nc "([pdbDelayDouble OxPhase Elec Nc])"
   set nv "([pdbDelayDouble OxPhase Hole Nv])"
   set aff "([pdbGetDouble OxPhase Affinity])"
   set Eg "([pdbGetDouble OxPhase Eg])"
   sel z = "Mater(OxPhase) * ((Doping>0.0) ? (-$Vt * log(AbsDop / $nc) + $aff) : 0.0)"  name=OxPhase_N
   sel z = "Mater(OxPhase) * ((Doping<0.0) ? ($Vt * log(AbsDop / $nv) + $aff + $Eg) : 0.0)"  name=OxPhase_P
   #now Nitride
   set nc "([pdbDelayDouble OxPhase Elec Nc])"
   set nv "([pdbDelayDouble OxPhase Hole Nv])"
   set aff "([pdbGetDouble OxPhase Affinity])"
   set Eg "([pdbGetDouble OxPhase Eg])"
   sel z = "Mater(Nitride) * ((Doping>0.0) ? (-$Vt * log(AbsDop / $nc) + $aff) : 0.0)"  name=Nitride_N
   sel z = "Mater(Nitride) * ((Doping<0.0) ? ($Vt * log(AbsDop / $nv) + $aff + $Eg) : 0.0)"  name=Nitride_P


   #sel z=GaN_N+GaN_P+AlGaN_N+AlGaN_P+Metal_N+Metal_P+OxPhase_N+OxPhase_P name=DevPsi
   #sel z=GaN_N+GaN_P+AlGaN_N+AlGaN_P+SiC_N+SiC_P+AlN_N+AlN_P name=DevPsi
   #sel z=GaN_N+GaN_P+AlGaN_N+AlGaN_P+Metal_N+Metal_P name=DevPsi
  sel z=GaN_N+GaN_P+AlGaN_N+AlGaN_P+Metal_N+Metal_P name=DevPsi
  sel z=0 name=DonorTraps
  sel z=0.0 name=Qfn
  sel z=0.0 name=Qfp
  #sel z=0.0 name=Impurity
  #sel z=0.0 name=Oxin
  #sel z=0.0 name=Traps
   }