def createSiliconPotentialOnlyContact(device, region, contact): bias_name = "%sbias" % contact format_dict = {"contact": contact} devsim.set_parameter(device=device, region=region, name=bias_name, value=0.0) for name, equation in ( ("celec_%(contact)s", "1e-10 + 0.5*abs(NetDoping+(NetDoping^2 + 4 * n_i^2)^(0.5))"), ("chole_%(contact)s", "1e-10 + 0.5*abs(-NetDoping+(NetDoping^2 + 4 * n_i^2)^(0.5))"), ("%(contact)snodemodel", ''' ifelse(NetDoping > 0, Potential-%(contact)sbias-V_t*log(celec_%(contact)s/n_i), Potential-%(contact)sbias+V_t*log(chole_%(contact)s/n_i))'''), ("%(contact)snodemodel:Potential", "1"), ): name_sub = name % format_dict equation_sub = equation % format_dict devsim.contact_node_model(device=device, contact=contact, name=name_sub, equation=equation_sub) devsim.contact_equation(device=device, contact=contact, name="PotentialEquation", variable_name="Potential", node_model="%snodemodel" % contact)
def SetupElectronSRVAtInterface(device, interface): ''' Surface Recombination Velocity At Interface ''' devsim.set_parameter(device=device, name="alpha_n", value=1e-7) iexp = "(alpha_n@r0)*(Electrons@r0-Electrons@r1)" for name, equation in ( ("srvElectrons", iexp), ("srvElectrons2", "srvElectrons"), ("srvElectrons:Electrons@r0", "diff(%s,Electrons@r0)" % iexp), ("srvElectrons:Electrons@r1", "diff(%s,Electrons@r1)" % iexp), ("srvElectrons2:Electrons@r0", "srvElectrons:Electrons@r0"), ("srvElectrons2:Electrons@r1", "srvElectrons:Electrons@r1"), ): devsim.interface_model(device=device, interface=interface, name=name, equation=equation) devsim.interface_equation(device=device, interface=interface, name="ElectronContinuityEquation", variable_name="Electrons", interface_model="srvElectrons2", type="fluxterm")
def setup_edge_volume(device, region): # # Set edge volumes for integration # dim = ds.get_dimension(device=device) if dim == 1: ds.edge_model(device=device, region=region, name="EdgeNodeVolume", equation="0.5*EdgeCouple*EdgeLength") elif dim == 2: ds.edge_model(device=device, region=region, name="EdgeNodeVolume", equation="0.25*EdgeCouple*EdgeLength") elif dim == 3: ds.edge_model(device=device, region=region, name="EdgeNodeVolume", equation="EdgeCouple*EdgeLength/6.0") else: raise NameError("Unhandled dimension %d" % (dim)) ds.set_parameter(device=device, region=region, name="edge_node0_volume_model", value="EdgeNodeVolume") ds.set_parameter(device=device, region=region, name="edge_node1_volume_model", value="EdgeNodeVolume")
def SetupInitialResistorSystem(device, region, net_doping=1e16): ''' resistor physics ''' devsim.set_parameter(device=device, region=region, name='net_doping', value=net_doping) devsim.node_solution(device=device, region=region, name='Potential') devsim.edge_from_node_model(device=device, region=region, node_model='Potential') # node models for name, equation in ( ("NetDoping", "net_doping"), ("IntrinsicElectrons", "NetDoping"), ("IntrinsicCharge", "-IntrinsicElectrons + NetDoping"), ("IntrinsicCharge:Potential", "-IntrinsicElectrons:Potential"), ): devsim.node_model(device=device, region=region, name=name, equation=equation) # edge models for name, equation in ( ("ElectricField", "(Potential@n0 - Potential@n1)*EdgeInverseLength"), ("ElectricField:Potential@n0", "EdgeInverseLength"), ("ElectricField:Potential@n1", "-EdgeInverseLength"), ("PotentialEdgeFlux", "Permittivity*ElectricField"), ("PotentialEdgeFlux:Potential@n0", "diff(Permittivity*ElectricField, Potential@n0)"), ("PotentialEdgeFlux:Potential@n1", "-PotentialEdgeFlux:Potential@n0"), ): devsim.edge_model(device=device, region=region, name=name, equation=equation) #### #### PotentialEquation #### devsim.equation(device=device, region=region, name="PotentialEquation", variable_name="Potential", edge_model="PotentialEdgeFlux", variable_update="log_damp")
def SetUniversalParameters(device, region): universal = { 'q': 1.6e-19, #, 'coul'), 'k': 1.3806503e-23, #, 'J/K'), 'Permittivity_0': 8.85e-14 #, 'F/cm^2') } for k, v in universal.items(): ds.set_parameter(device=device, region=region, name=k, value=v)
def set_permittivities(ox, si): devsim.set_parameter(device=device, region="MySiRegion", name="Permittivity", value=si * 8.85e-14) devsim.set_parameter(device=device, region="MyOxRegion", name="Permittivity", value=ox * 8.85e-14)
def SetupResistorConstants(device, region): for name, value in ( ("Permittivity", 11.1*8.85e-14), ("ElectronCharge", 1.6e-19), ("IntrinsicDensity", 1.0e10), ("ThermalVoltage", 0.0259), ("mu_n", 400), ("mu_p", 200), ): devsim.set_parameter(device=device, region=region, name=name, value=value)
def SetOxideParameters(device, region): ''' Sets physical parameters ''' SetUniversalParameters(device, region) ds.set_parameter( device=device, region=region, name="Permittivity", value=3.9 * ds.get_parameter(device=device, region=region, name='Permittivity_0'))
def ActivateLh(): ds.set_parameter(device=device, region=region_si, name="Gammap", value=3) ds.set_parameter(device=device, region=region_ox, name="Gammap", value=1) #setup_dg_equation(device, region_si, 'Lambda_h', 'Lh', 'del_log_p1', '', 'Lh_eqn') #setup_dg_equation(device, region_ox, 'Lambda_h', 'Lh', 'del_log_p1', '', 'Lh_eqn') setup_dg_equation(device, region_si, 'Lambda_h', 'Lh', 'del_log_p1', 'del_log_p2', 'Lh_eqn') setup_dg_equation(device, region_ox, 'Lambda_h', 'Lh', 'del_log_p1', 'del_log_p2', 'Lh_eqn') for c in ('top', 'bot'): setup_dg_contact(device, c, 'Lambda_h', 'Lh') setup_dg_interface(device, interface_siox, 'Lambda_h', 'Lh')
def setOxideParameters(device, region): q = 1.6e-19 k = 1.3806503e-23 eps = 8.85e-14 T = 300 devsim.set_parameter(device=device, region=region, name="Permittivity", value=3.9 * eps) devsim.set_parameter(device=device, region=region, name="ElectronCharge", value=q)
def simulate_charge(device, contact, equation, solver_params): #charge_factor=1e7 #from F/cm^2 to fF/um^2 dv = 0.001 v1 = ds.get_parameter(device=device, name=GetContactBiasName(contact)) q1 = ds.get_contact_charge(device=device, contact=contact, equation="PotentialEquation") v2 = v1 + dv ds.set_parameter(name=GetContactBiasName(contact), value=v2) ds.solve(**solver_params) q2 = ds.get_contact_charge(device=device, contact=contact, equation="PotentialEquation") return (v1, (charge_factor * (q2 - q1) / dv))
def setMaterialParameters(device, region): q=1.6e-19 k=1.3806503e-23 eps=8.85e-14 T=300 for name, value in ( ("Permittivity", 11.1*eps), ("ElectronCharge", q), ("n_i", 1.0e10), ("kT", eps * T), ("V_t", k*T/q), ("mu_n", 400), ("mu_p", 200), ): devsim.set_parameter(device=device, region=region, name=name, value=value)
def set_default_models(): for r in (region_si, region_ox): ds.edge_from_node_model(device=device, region=r, node_model="x") CreateEdgeModel(device=device, region=r, model="xmid", expression="0.5*(x@n0 + x@n1)") ds.set_parameter(name="T", value=300.0) CreateSolution(device=device, region=region_si, name="Potential") CreateSolution(device=device, region=region_ox, name="Potential") # # need Le and Lh for the Si Equation # setup_dg_variable(device, region_si, "Le") setup_dg_variable(device, region_si, "Lh") setup_dg_variable(device, region_ox, "Le") setup_dg_variable(device, region_ox, "Lh") CreateNodeModel(device=device, region=region_si, model="NetDoping", expression="Nconstant") #set the bias ds.set_parameter(name=GetContactBiasName("bot"), value=0.0) ds.set_parameter(name=GetContactBiasName("top"), value=0.0) #available solution reset ds.node_solution(name='zero', device=device, region=region_ox) ds.node_solution(name='zero', device=device, region=region_si)
def rampparam(device, region, param, stop, step_size, min_step, solver_params=None, callback=None): ''' Ramps param with assignable callback function ''' start_param=ds.get_parameter(device=device, region=region, name=param) if (start_param < stop): step_sign=1 else: step_sign=-1 last_param=start_param while(abs(last_param - stop) > min_step): print("last end %e %e" % (last_param, stop)) next_param=last_param + step_sign * step_size if next_param < stop: next_step_sign=1 else: next_step_sign=-1 if next_step_sign != step_sign: next_param=stop print("setting to last param %e" % (stop)) print("setting next param %e" % (next_param)) ds.set_parameter(device=device, region=region, name=param, value=next_param) try: ds.solve(**solver_params) except ds.error as msg: if str(msg).find("Convergence failure") != 0: raise ds.set_parameter(device=device, region=region, name=param, value=last_param) step_size *= 0.5 print("setting new step size %e" % (step_size)) #raise NameError("STOP") if step_size < min_step: raise RuntimeError("Min step size too small") continue last_param=next_param if callback: callback()
def setup_dd_si(device, region): # this is our solution variable CreateSolution(device, region, "Potential") CreateSolution(device, region, "Electrons") CreateSolution(device, region, "Holes") #These are needed for the Arora model CreateBandEdgeModels(device, region, ("Potential", "Le", "Lh")) #these are needed for velocity saturation #CreateEField(device, region) #CreateDField(device, region) opts = CreateAroraMobilityLF(device, region) #opts = CreateHFMobility(device, region, **opts) CreateSiliconDriftDiffusion(device, region, **opts) for i in get_contact_list(device=device): r = get_region_list(device=device, contact=i)[0] if r == region: ds.set_parameter(name=GetContactBiasName(i), value=0.0) CreateSiliconDriftDiffusionContact(device, region, i, opts['Jn'], opts['Jp']) return opts
region1=regions[1], interface=interface) for region in regions: test_common.SetupResistorConstants(device, region) test_common.SetupInitialResistorSystem(device, region, net_doping=1e16) for contact in contacts: test_common.SetupInitialResistorContact(device, contact=contact) test_common.SetupContinuousPotentialAtInterface(device, interface) ##### ##### Initial DC Solution ##### devsim.set_parameter(name="topbias", value=0.0) devsim.set_parameter(name="botbias", value=0.0) devsim.solve(type='dc', absolute_error=1.0, relative_error=1e-10, maximum_iterations=30) for region in regions: for name in ("Potential", "IntrinsicElectrons"): devsim.print_node_values(device=device, region=region, name=name) for region in regions: test_common.SetupCarrierResistorSystem(device, region) for contact in contacts: test_common.SetupCarrierResistorContact(device, contact=contact)
# See the License for the specific language governing permissions and # limitations under the License. # cap device to test displacement current at contact import devsim import test_common device="MyDevice" region="MyRegion" test_common.CreateSimpleMesh(device, region) ### ### Set parameters on the region ### devsim.set_parameter(device=device, region=region, name="Permittivity", value=3.9*8.85e-14) ### ### Create the Potential solution variable ### devsim.node_solution(device=device, region=region, name="Potential") ### ### Creates the Potential@n0 and Potential@n1 edge model ### devsim.edge_from_node_model(device=device, region=region, node_model="Potential") ### ### Electric field on each edge, as well as its derivatives with respect to ### the potential at each node ###
devsim.add_2d_interface( mesh="dog", name="i1", region0="r1", region1="r2", xl=0, xh=1, yl=ymid2, yh=ymid2, bloat=1.0e-10) devsim.add_2d_contact( mesh="dog", name="top", region="r0", yl=ymin, yh=ymin, bloat=1.0e-10, material="metal") devsim.add_2d_contact( mesh="dog", name="bot", region="r2", yl=ymax, yh=ymax, bloat=1.0e-10, material="metal") #contact can only apply interface devsim.finalize_mesh( mesh="dog") devsim.create_device(mesh="dog", device=device) devsim.node_model(device=device, name="NetDoping", region="gas1", equation="1e18") devsim.node_model(device=device, name="NetDoping", region="r0", equation="1e18") devsim.node_model(device=device, name="NetDoping", region="r1", equation="-1e15") devsim.node_model(device=device, name="NetDoping", region="r2", equation="-1e15") devsim.node_model(device=device, name="NetDoping", region="gas2", equation="-1e15") devsim.interface_normal_model(device=device, region="r0", interface="i0") devsim.interface_normal_model(device=device, region="r1", interface="i0") devsim.interface_normal_model(device=device, region="r1", interface="i1") devsim.interface_normal_model(device=device, region="r2", interface="i1") devsim.set_parameter(name="raxis_zero", value=0.0) devsim.set_parameter(name="raxis_variable", value="x") for region in ("r0", "r1", "r2"): devsim.cylindrical_node_volume( device=device, region=region) devsim.cylindrical_edge_couple( device=device, region=region) devsim.cylindrical_surface_area( device=device, region=region) devsim.write_devices(file="mesh2d.flps", type="floops") devsim.write_devices(file="mesh2d.msh", type="devsim") devsim.write_devices(file="mesh2d.dat", type="tecplot")
# Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import devsim device="MyDevice" region="MyRegion" devsim.load_devices(file="trimesh2.msh") devsim.print_node_values(device="MyDevice", region="MyRegion", name="NodeVolume") devsim.print_edge_values(device="MyDevice", region="MyRegion", name="EdgeCouple") devsim.set_parameter(device=device, region=region, name="Permittivity", value=3.9*8.85e-14) devsim.set_parameter(device=device, region=region, name="ElectricCharge", value=1.6e-19) devsim.node_solution(device=device, region=region, name="Potential") devsim.edge_from_node_model(device=device, region=region, node_model="Potential") devsim.edge_model(device=device, region=region, name="ElectricField", equation="(Potential@n0 - Potential@n1)*EdgeInverseLength") devsim.edge_model(device=device, region=region, name="ElectricField:Potential@n0", equation="EdgeInverseLength") devsim.edge_model(device=device, region=region, name="ElectricField:Potential@n1", equation="-EdgeInverseLength") devsim.set_parameter(device=device, region=region, name="topbias", value=1.0e-0) devsim.set_parameter(device=device, region=region, name="botbias", value=0.0) devsim.edge_model(device=device, region=region, name="PotentialEdgeFlux", equation="Permittivity*ElectricField") devsim.edge_model(device=device, region=region, name="PotentialEdgeFlux:Potential@n0", equation="diff(Permittivity*ElectricField, Potential@n0)") devsim.edge_model(device=device, region=region, name="PotentialEdgeFlux:Potential@n1", equation="-PotentialEdgeFlux:Potential@n0")
#### #### Meshing #### test_common.CreateSimpleMesh(device=devices[0], region=region) devsim.create_device(mesh="dog", device=devices[1]) for device in devices: test_common.SetupResistorConstants(device=device, region="") test_common.SetupInitialResistorSystem(device, region) devsim.add_circuit_node(name="cnode1", variable_update="log_damp") devsim.circuit_element(name="R1", n1="cnode1", n2=0, value=1e15) # ground these contacts devsim.set_parameter(device="MyDevice1", name="topbias", value=0.0) devsim.set_parameter(device="MyDevice2", name="botbias", value=0.0) test_common.SetupInitialResistorContact(device="MyDevice1", contact="top", use_circuit_bias=True, circuit_node="cnode1") test_common.SetupInitialResistorContact(device="MyDevice1", contact="bot", use_circuit_bias=False, circuit_node="topbias") test_common.SetupInitialResistorContact(device="MyDevice2", contact="top", use_circuit_bias=True, circuit_node="cnode1")
# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #### Plan is to use this file for full restart, including equations import devsim device = "mymos" devsim.load_devices(file="mos_2d_dd.msh") import mos_2d_params devsim.set_parameter(name="debug_level", value="info") devsim.set_parameter(device=device, region="gate", name="debug_level", value="verbose") devsim.solve(type="dc", absolute_error=1.0e30, relative_error=1e-5, maximum_iterations=30) devsim.write_devices(file="mos_2d_restart2.msh", type="devsim") #set_parameter -device mymos -region gate -name gatebias -value 0.1 #solve -type dc -absolute_error 1.0e30 -relative_error 1e-9 -maximum_iterations 30
import numpy.linalg except: print("numpy is not available with your installation and is not being run") sys.exit(-1) from devsim import * from laux_common import * import laux_common load_devices(file="gmsh_diode3d_dd.msh") device = "diode3d" region = "Bulk" SetDimension(3) nee = laux_common.nee nen = laux_common.nen dim = laux_common.dim # There are nee edges per tetrahedron #number_elements = len(scalar_efield)/laux_common.nee; number_test = -1 RunTest(device, region, number_test, "ElectricField", "Potential") import devsim devsim.set_parameter(name="V_t", value=0.0259) devsim.set_parameter(name="mu_n", value=400) devsim.set_parameter(name="ElectronCharge", value=1.6e-19) RunTest(device, region, number_test, "ElectronCurrent", "Potential")
devsim.solve(type="dc", absolute_error=1.0, relative_error=1e-14, maximum_iterations=3) devsim.circuit_alter(name="V1", value=2.0) devsim.solve(type="dc", absolute_error=1.0, relative_error=1e-14, maximum_iterations=30) test_common.CreateSimpleMesh(device, region) devsim.node_model(device=device, region=region, name="erf", equation="erf(x);") devsim.print_node_values(device=device, region=region, name="erf") devsim.node_model(device=device, region=region, name="d_erf_dx", equation="diff(erf(x),x);") devsim.print_node_values(device=device, region=region, name="d_erf_dx") devsim.node_model(device=device, region=region, name="erfc", equation="erfc(x);") devsim.print_node_values(device=device, region=region, name="erfc") devsim.node_model(device=device, region=region, name="d_erfc_dx", equation="diff(erfc(x),x);") devsim.print_node_values(device=device, region=region, name="d_erfc_dx") devsim.node_model(device=device, region=region, name="d_abs_dx", equation="diff(abs(x),x);") devsim.print_node_values(device=device, region=region, name="d_abs_dx") devsim.set_parameter(name="param", value=-1.0) devsim.node_model(device=device, region=region, name="deptest", equation="param;") devsim.print_node_values(device=device, region=region, name="deptest") devsim.set_parameter(name="param", value=1.0) devsim.print_node_values(device=device, region=region, name="deptest") devsim.node_model(device=device, region=region, name="cdeptest", equation="cnode1;") devsim.print_node_values(device=device, region=region, name="cdeptest") devsim.set_circuit_node_value(node="cnode1", value=-1.0) devsim.print_node_values(device=device, region=region, name="cdeptest")
def createDriftDiffusion(device, region): for name, equation in ( ("PotentialNodeCharge" , "-ElectronCharge*(Holes -Electrons + NetDoping)"), ("PotentialNodeCharge:Electrons", "+ElectronCharge"), ("PotentialNodeCharge:Holes" , "-ElectronCharge"), ): devsim.node_model(device=device, region=region, name=name, equation=equation) devsim.equation(device=device, region=region, name="PotentialEquation", variable_name="Potential", node_model="PotentialNodeCharge", element_model="PotentialEdgeFlux", variable_update="log_damp") for name, equation in ( ("vdiff" , "(Potential@n0 - Potential@n1)/V_t"), ("vdiff:Potential@n0" , "V_t^(-1)"), ("vdiff:Potential@n1" , "-V_t^(-1)"), ("Bern01" , "B(vdiff)"), ("Bern01:Potential@n0", "dBdx(vdiff)*vdiff:Potential@n0"), ("Bern01:Potential@n1", "dBdx(vdiff)*vdiff:Potential@n1"), ("Bern10" , "Bern01 + vdiff"), ("Bern10:Potential@n0", "Bern01:Potential@n0 + vdiff:Potential@n0"), ("Bern10:Potential@n1", "Bern01:Potential@n1 + vdiff:Potential@n1"), ): devsim.edge_model(device=device, region=region, name=name, equation=equation) Jn ="ElectronCharge*mu_n*EdgeInverseLength*V_t*(Electrons@n1*Bern10 - Electrons@n0*Bern01)" dJndn0 ="simplify(diff( %s, Electrons@n0))" % Jn dJndn1 ="simplify(diff( %s, Electrons@n1))" % Jn dJndpot0="simplify(diff( %s, Potential@n0))" % Jn dJndpot1="simplify(diff( %s, Potential@n1))" % Jn for name, equation in ( ("ElectronCurrent" , Jn), ("ElectronCurrent:Electrons@n0", dJndn0), ("ElectronCurrent:Electrons@n1", dJndn1), ("ElectronCurrent:Potential@n0", dJndpot0), ("ElectronCurrent:Potential@n1", dJndpot1), ): devsim.edge_model(device=device, region=region, name=name, equation=equation) Jp ="-ElectronCharge*mu_p*EdgeInverseLength*V_t*(Holes@n1*Bern01 - Holes@n0*Bern10)" dJpdp0 ="simplify(diff(%s, Holes@n0))" % Jp dJpdp1 ="simplify(diff(%s, Holes@n1))" % Jp dJpdpot0="simplify(diff(%s, Potential@n0))" % Jp dJpdpot1="simplify(diff(%s, Potential@n1))" % Jp for name, equation in ( ("HoleCurrent" , Jp), ("HoleCurrent:Holes@n0" , dJpdp0), ("HoleCurrent:Holes@n1" , dJpdp1), ("HoleCurrent:Potential@n0", dJpdpot0), ("HoleCurrent:Potential@n1", dJpdpot1), ): devsim.edge_model(device=device, region=region, name=name, equation=equation) NCharge="-ElectronCharge * Electrons" dNChargedn="-ElectronCharge" for name, equation in ( ("NCharge", NCharge), ("NCharge:Electrons", dNChargedn), ): devsim.node_model(device=device, region=region, name=name, equation=equation) PCharge="-ElectronCharge * Holes" dPChargedp="-ElectronCharge" for name, equation in ( ("PCharge", PCharge), ("PCharge:Holes", dPChargedp), ): devsim.node_model(device=device, region=region, name=name, equation=equation) ni=devsim.get_parameter(device=device, region=region, name="n_i") for name, value in ( ("n1", ni), ("p1", ni), ("taun", 1e-5), ("taup", 1e-5), ): devsim.set_parameter(device=device, region=region, name=name, value=value) USRH="-ElectronCharge*(Electrons*Holes - n_i^2)/(taup*(Electrons + n1) + taun*(Holes + p1))" dUSRHdn="simplify(diff($USRH, Electrons))" dUSRHdp="simplify(diff($USRH, Holes))" for name, equation in ( ("USRH", USRH), ("USRH:Electrons", dUSRHdn), ("USRH:Holes", dUSRHdp), ): devsim.node_model(device=device, region=region, name=name, equation=equation) devsim.equation(device=device, region=region, name="ElectronContinuityEquation", variable_name="Electrons", edge_model="ElectronCurrent", variable_update="positive", time_node_model="NCharge", node_model="USRH") devsim.equation(device=device, region=region, name="HoleContinuityEquation", variable_name="Holes", edge_model="HoleCurrent", variable_update="positive", time_node_model="PCharge", node_model="USRH")
def set_dg_parameters(device, region): ##From Cogenda default Si physics: #TODO: parameter units ds.set_parameter(device=device, region=region, name="h", value=6.62606876e-34) # J*s ds.set_parameter(device=device, region=region, name="hbar", value=1.054571596e-34) # J*s ds.set_parameter(device=device, region=region, name="Gamman", value=1) ds.set_parameter(device=device, region=region, name="Gammap", value=1) ds.set_parameter(device=device, region=region, name="Gammanox", value=1) ds.set_parameter(device=device, region=region, name="Gammapox", value=1) ds.set_parameter(device=device, region=region, name="mass_electron", value=9.10938188e-31) # kg ds.node_model(device=device, region=region, name="meff_elec", equation="1.0903*mass_electron") ds.node_model(device=device, region=region, name="meff_hole", equation="1.1525*mass_electron") ds.node_model(device=device, region=region, name="b_n", equation="(1e4*Gamman*hbar^2)/(q*6*meff_elec)") # eV*cm^2 ds.node_model(device=device, region=region, name="b_p", equation="(1e4*Gammap*hbar^2)/(q*6*meff_hole)") # eV*cm^2 # Oxide # #ds.node_model(device=device, region=region, name="b_nox", equation="1e-100") # eV*cm^2 ds.node_model( device=device, region=region, name="b_nox", equation="1e4*Gammanox*hbar^2/(6*q*0.14*mass_electron)") # eV*cm^2 ds.node_model( device=device, region=region, name="b_pox", equation="1e4*Gammapox*hbar^2/(6*q*1.0*mass_electron)") # eV*cm^2 #ds.node_model(device=device, region=region, name="b_nox", equation="10*hbar^2/(6*q*0.14*mass_electron)") # eV*cm^2 #ds.node_model(device=device, region=region, name="b_pox", equation="10*hbar^2/(6*q*0.14*mass_electron)") # eV*cm^2 #ds.node_model(device=device, region=region, name="b_nox", equation="(1e4*Gammanox*hbar^2)/(q*6*meff_elec)") # eV*cm^2 #ds.node_model(device=device, region=region, name="b_pox", equation="(1e4*Gammapox*hbar^2)/(q*6*meff_hole)") # eV*cm^2 ds.node_model(device=device, region=region, name="x_np", equation="1e2*hbar/(2*0.4*mass_electron*q*3.15)^0.5") # cm ds.node_model(device=device, region=region, name="x_pp", equation="1e2*hbar/(2*0.4*mass_electron*q*4.50)^0.5") # cm #const PetscScalar b_nox = hbar*hbar/(6*e*0.14*me); #const PetscScalar b_pox = hbar*hbar/(6*e*1.0*me); #const PetscScalar bn = mt->band->Gamman()*hbar*hbar/(6*e*mt->band->EffecElecMass(T)); #const PetscScalar bp = mt->band->Gammap()*hbar*hbar/(6*e*mt->band->EffecHoleMass(T)); # const PetscScalar x_np = hbar/sqrt(2*0.4*me*3.15*eV); # const PetscScalar x_pp = hbar/sqrt(2*0.4*me*4.50*eV); # eV = 1.602176462e-19*J; # e = 1.602176462e-19*C; # ELECMASS = 1.0903*me; # HOLEMASS = 1.1525*me; # # Edge Integration # em = ( ("b_n", "b_ne", "arithmetic", ()), ("b_p", "b_pe", "arithmetic", ()), ) for e in em: ds.edge_average_model(device=device, region=region, node_model=e[0], edge_model=e[1], average_type=e[2]) for d in e[3]: ds.edge_average_model(device=device, region=region, node_model=e[0], edge_model=e[1], average_type=e[2], derivative=d)
# You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from devsim.python_packages.simple_physics import * from devsim.python_packages.ramp import * import refinement2 import devsim devsim.set_parameter(name="extended_solver", value=True) devsim.set_parameter(name="extended_model", value=True) devsim.set_parameter(name="extended_equation", value=True) device = "mos2d" import gmsh_mos2d_create gmsh_mos2d_create.create(device=device, infile="gmsh_mos2d.msh", outfile="gmsh_mos2d_out.msh") silicon_regions = ("gate", "bulk") oxide_regions = ("oxide", ) regions = ("gate", "bulk", "oxide") interfaces = ("bulk_oxide", "gate_oxide")
solver_params = { 'type': "dc", 'relative_error': 1e-11, 'absolute_error': 1, 'maximum_iterations': 50 } for index, d in enumerate(dopings): cdict = { 'doping': format_doping(float(d)), 'q': [], 'v': [], } ds.set_parameter(device=device, region=region_si, name="Nconstant", value=float(d)) ds.set_node_values(device=device, region=region_si, name="Potential", init_from="zero") ds.set_node_values(device=device, region=region_ox, name="Potential", init_from="zero") ds.set_parameter(name=GetContactBiasName("top"), value=vneg) ds.solve(**solver_params) def mycb(): res = simulate_charge(device=device,
def createSiliconDriftDiffusion(device, region): for name, equation in ( ("PotentialNodeCharge", "-ElectronCharge*(Holes -Electrons + NetDoping)"), ("PotentialNodeCharge:Electrons", "+ElectronCharge"), ("PotentialNodeCharge:Holes", "-ElectronCharge"), ): devsim.node_model(device=device, region=region, name=name, equation=equation) devsim.equation(device=device, region=region, name="PotentialEquation", variable_name="Potential", node_model="PotentialNodeCharge", edge_model="PotentialEdgeFlux", variable_update="log_damp") createBernoulli(device, region) createElectronCurrent(device, region) createHoleCurrent(device, region) NCharge = "-ElectronCharge * Electrons" dNChargedn = "-ElectronCharge" devsim.node_model(device=device, region=region, name="NCharge", equation=NCharge) devsim.node_model(device=device, region=region, name="NCharge:Electrons", equation=dNChargedn) PCharge = "-ElectronCharge * Holes" dPChargedp = "-ElectronCharge" devsim.node_model(device=device, region=region, name="PCharge", equation=PCharge) devsim.node_model(device=device, region=region, name="PCharge:Holes", equation=dPChargedp) ni = devsim.get_parameter(device=device, region=region, name="n_i") devsim.set_parameter(device=device, region=region, name="n1", value=ni) devsim.set_parameter(device=device, region=region, name="p1", value=ni) devsim.set_parameter(device=device, region=region, name="taun", value=1e-5) devsim.set_parameter(device=device, region=region, name="taup", value=1e-5) USRH = "-ElectronCharge*(Electrons*Holes - n_i^2)/(taup*(Electrons + n1) + taun*(Holes + p1))" dUSRHdn = "simplify(diff(%s, Electrons))" % USRH dUSRHdp = "simplify(diff(%s, Holes))" % USRH devsim.node_model(device=device, region=region, name="USRH", equation=USRH) devsim.node_model(device=device, region=region, name="USRH:Electrons", equation=dUSRHdn) devsim.node_model(device=device, region=region, name="USRH:Holes", equation=dUSRHdp) devsim.equation(device=device, region=region, name="ElectronContinuityEquation", variable_name="Electrons", edge_model="ElectronCurrent", variable_update="positive", time_node_model="NCharge", node_model="USRH") devsim.equation(device=device, region=region, name="HoleContinuityEquation", variable_name="Holes", edge_model="HoleCurrent", variable_update="positive", time_node_model="PCharge", node_model="USRH")
def ActivateLe2(): ds.set_parameter(device=device, region=region_si, name="Gamman", value=3) ds.set_parameter(device=device, region=region_ox, name="Gamman", value=1) setup_dg_equation(device, region_si, 'Lambda_e', 'Le', 'del_log_n1', 'del_log_n2', 'Le_eqn') setup_dg_contact(device, 'bot', 'Lambda_e', 'Le')
def ActivateLh2(): ds.set_parameter(device=device, region=region_si, name="Gammap", value=3) ds.set_parameter(device=device, region=region_ox, name="Gammap", value=1) setup_dg_equation(device, region_si, 'Lambda_h', 'Lh', 'del_log_p1', 'del_log_p2', 'Lh_eqn') setup_dg_contact(device, 'bot', 'Lambda_h', 'Lh')