#set the interstitial model information

#time dependent injection from the surface
array set $Base {time.inj {Boolean 0}}

#scaling velocity to use - used by both growth and surface recombination
array set $Base {Scale {Double {[Arrhenius 4.7e-2 2.0]}}}

#the very short time, no diffusion, surface concentration
array set $Base {Inj {Double {[Arrhenius 0.0915 -0.55]}}}

#surface recombination velocity
array set $Base {recomb {Boolean 1}}
    array set $Base {KinkSite {Double {([Arrhenius 0.51 -2.63] * 1.0e15 / (1.0e15 + [Arrhenius 0.51 -2.63]))}}}

    array set $Base {Ksurf {Double {[SurfDiffLimit Oxide_Silicon Si Int 0.0]}}}

    array set $Base {Ktrap {Double {[pdbGetDouble Silicon Int D0]*[pdbGetDouble Silicon LatticeSpacing]*31.4159}}}

#growth rate dependent injection
array set $Base {growth.inj {Boolean 1}}
    array set $Base {vmole {Double 5e22}}
    array set $Base {Gpow {Double 0.0}}
    #this is dependent on the surface recombination rate - try

    proc ComputeTheta {} {
	set inj [pdbGetDouble Si_Ox I Inj]
	#set vel [expr [pdbGetDouble Si_Ox I Scale]*[pdbGetDouble Si_Ox I vmole]]

	set scl [pdbGetDouble Si_Ox I Scale]
	set vml [pdbGetDouble Si_Ox I vmole]

	set cs [pdbGetDouble Si I Cstar]
	set ks [pdbGetDouble Si_Ox I Ksurf]
	set kf [pdbGetDouble Silicon I2 Kforward]
	#assume kf makes I2's that are annhilated at the surface
	#set rec [expr $ks*$cs*$inj + 0.1e-4*$kf*$cs*$cs*$inj*$inj]
	#return [expr $rec / $vel]

	return [format {((%s) * (%s) * (%s) + 0.1e-4 * (%s) * (%s) * (%s) * (%s) * (%s)) / ((%s) * (%s))} $ks $cs $inj $kf $cs $cs $inj $inj $scl $vml]
    }

    array set $Base {theta {Double { [ComputeTheta] }}}

#support for Dunham model
array set $Base {segregation {Boolean 0}}
    array set $Base {Seg {Double 1.0}}
    array set $Base {Trn {Double 0.0}}

return { time.inj Scale Inj KinkSite Ksurf Ksurf2 Krat Kpow vmole Gpow  theta segregation Seg Trn }
