def createSiliconDriftDiffusionAtContact(device, region, contact): format_dict = {"contact": contact} for name, equation in ( ("%(contact)snodeelectrons", "ifelse(NetDoping > 0, Electrons - celec_%(contact)s, Electrons - n_i^2/chole_%(contact)s)" ), ("%(contact)snodeholes", "ifelse(NetDoping < 0, Holes - chole_%(contact)s, Holes - n_i^2/celec_%(contact)s)" ), ("%(contact)snodeelectrons:Electrons", "1.0"), ("%(contact)snodeholes:Holes", "1.0"), ): 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="ElectronContinuityEquation", variable_name="Electrons", node_model="%snodeelectrons" % contact, edge_current_model="ElectronCurrent") devsim.contact_equation(device=device, contact=contact, name="HoleContinuityEquation", variable_name="Holes", node_model="%snodeholes" % contact, edge_current_model="HoleCurrent")
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 SetupCarrierResistorContact(device, contact, use_circuit_bias=False, circuit_node=""): ''' Electron continuity equation at contact ''' if circuit_node: bias_name = circuit_node else: bias_name = contact + "bias" region = devsim.get_region_list(device=device, contact=contact)[0] if 'celec' not in devsim.get_node_model_list(device=device, region=region): devsim.node_model( device=device, region=region, name="celec", equation= "0.5*(NetDoping+(NetDoping^2 + 4 * IntrinsicDensity^2)^(0.5))") for name, equation in ( ("%snodeelectrons" % contact, "Electrons - celec"), ("%snodeelectrons:Electrons" % contact, "1."), ): devsim.contact_node_model(device=device, contact=contact, name=name, equation=equation) if use_circuit_bias: devsim.contact_equation(device=device, contact=contact, name="ElectronContinuityEquation", variable_name="Electrons", node_model="%snodeelectrons" % contact, edge_current_model="ElectronCurrent", circuit_node=bias_name) else: devsim.contact_equation(device=device, contact=contact, name="ElectronContinuityEquation", variable_name="Electrons", node_model="%snodeelectrons" % contact, edge_current_model="ElectronCurrent")
def CreateContactNodeModel(device, contact, model, expression): ''' Creates a contact node model ''' result = ds.contact_node_model(device=device, contact=contact, name=model, equation=expression) if debug: print(("CONTACTNODEMODEL {d} {c} {m} \"{re}\"".format(d=device, c=contact, m=model, re=result)))
def SetupInitialResistorContact(device, contact, use_circuit_bias=False, circuit_node=""): if circuit_node: bias_name = circuit_node else: bias_name = contact + "bias" bias_node_model = contact + "node_model" devsim.contact_node_model(device=device, contact=contact, name=bias_node_model, equation="Potential - %s" % bias_name) devsim.contact_node_model(device=device, contact=contact, name="%s:Potential" % bias_node_model, equation="1") if use_circuit_bias: devsim.contact_node_model(device=device, contact=contact, name="%s:%s" % (bias_node_model, bias_name), equation="-1") #edge_model -device $device -region $region -name "contactcharge_edge_top" -equation $conteq if use_circuit_bias: devsim.contact_equation(device=device, contact=contact, name="PotentialEquation", variable_name="Potential", node_model=bias_node_model, circuit_node=bias_name) else: devsim.contact_equation(device=device, contact=contact, name="PotentialEquation", variable_name="Potential", node_model=bias_node_model)