Resistor (2D) - full deck

From Flooxs
Revision as of 18:12, 9 November 2010 by Nrowsey (talk | contribs) (New page: #--------------------------- # Define solution variables #--------------------------- DevicePackage solution name=Potential nosolve solution add name=DevPsi solve negative solution...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
#---------------------------
# Define solution variables
#---------------------------
DevicePackage
solution name=Potential nosolve
solution add name=DevPsi solve negative 
solution add name=Elec solve !negative
solution add name=Hole solve !negative

#---------------------------
# Create 2D structure
#---------------------------
line x loc=0.0 spac=0.01 tag=Top
line x loc=1.0 spac=0.01 tag=Bottom
line y loc=0.0 spac=0.01 tag=Left
line y loc=0.2 spac=0.01 tag=Right
region silicon xlo=Top xhi=Bottom ylo=Left yhi=Right
init

# Create contacts
contact name=VSS silicon xlo=-0.1 xhi=0.0 add depth=1.0 width=1.0
contact name=GND silicon xlo=1.0 xhi=1.1 add depth=1.0 width=1.0
contact name=VSS voltage supply=0.0
contact name=GND voltage supply=0.0

#Plot structure and contacts. The !cle allows features to be added to the current graphic.
plot.2d grid
plot.2d contact=VSS !cle
plot.2d contact=GND !cle

#---------------------------
# Define constants
#---------------------------
set T 300
set k 1.38066e-23
set q 1.619e-19
set Vt [expr {$k*$T/$q}]
set ni 1.1e10
set esi [expr 11.8 * 8.85418e-14]
set eps [expr $esi / $q]
set Emob 350.0
set Hmob 150.0

#---------------------------
# Define Poisson's solution and continuity equations
#---------------------------
set eqnP "$eps * grad(DevPsi) + Doping - Elec + Hole"
set eqnE "ddt(Elec) - ($Emob) * $Vt * sgrad(Elec, DevPsi/$Vt)"
set eqnH "ddt(Hole) - ($Hmob) * $Vt * sgrad(Hole, -DevPsi/$Vt)"
pdbSetDouble Si DevPsi DampValue $Vt
pdbSetString Si DevPsi Equation $eqnP
pdbSetString Si Elec Equation $eqnE
pdbSetString Si Hole Equation $eqnH 

#---------------------------
# Doping profile, n-type resistor
#---------------------------
sel z=1.0e19 name=ND
sel z=1.0e15 name=NA
sel z=ND-NA name=Doping

#---------------------------
# Define ohmic contact equations
#---------------------------
proc ohmic.contact {Contact} {
set vt 0.02558357
set ni 1.1e10
pdbSetBoolean $Contact Elec Flux 1
pdbSetBoolean $Contact Hole Flux 1
pdbSetBoolean $Contact DevPsi Flux 1
pdbSetBoolean $Contact Elec Fixed 1
pdbSetBoolean $Contact Hole Fixed 1
pdbSetBoolean $Contact DevPsi Fixed 1
pdbSetDouble $Contact Elec Flux.Scale 1.619e-19
pdbSetDouble $Contact Hole Flux.Scale 1.619e-19
pdbSetString $Contact DevPsi Equation "ND - NA - Elec + Hole"
pdbSetString $Contact Elec Equation "DevPsi - $vt*log((Elec)/$ni) -$Contact"
pdbSetString $Contact Hole Equation "DevPsi + $vt*log((Hole)/$ni) -$Contact"
}
ohmic.contact VSS
ohmic.contact GND

#---------------------------
# Initial guess procedure, assumes charge neutrality
#---------------------------
proc InitialGuess {Doping} {
	sel z= {(Doping>0.0)  
		?  ( 0.025*log( (Doping+1.0e10) / 1.0e10))
		:  (-0.025*log(-(Doping+1.0e10) / 1.0e10))} name = DevPsi
	sel z=1.0e10*exp(DevPsi/0.025) name=Elec
	sel z=1.0e10*exp(-DevPsi/0.025) name=Hole
} 
InitialGuess Doping

#---------------------------
# Run DC simulation and plot the current output vs. the source voltage
#---------------------------
set Win [CreateGraphWindow]
set bias 0.0
for {set bias 0.0} {$bias < 1.01} {set bias [expr $bias+0.1]} {
	contact name=VSS supply = $bias
	device
	set cur [expr abs([contact name=VSS sol=Elec flux] - [contact name=VSS sol=Hole flux])]
	AddtoLine $Win I $bias $cur
}

Notes

This deck was successfully run by Daniel on 9/15/08 using TEC ~flooxs/linux64