def simple_mesh(meshname='default_mesh', region='default_region', material='Si', top='top', bottom='bottom', thickness=10, spacing=0.1): """ Creates a simple 1D mesh made of Si with metal contacts :param meshname: :param region: :param material: :param top: :param bottom: :param thickness: in nm, specify the thickness of the resistor :param spacing: :return: """ thickness = thickness * 1E-4 spacing = spacing * 1E-4 # convert nm to cm ds.create_1d_mesh(mesh=meshname) ds.add_1d_mesh_line(mesh=meshname, pos=0, ps=spacing, tag=top) ds.add_1d_mesh_line(mesh=meshname, pos=thickness, ps=spacing, tag=bottom) ds.add_1d_region(mesh=meshname, tag1=top, tag2=bottom, region=region, material=material) ds.add_1d_contact(material='metal', mesh=meshname, name=f"{top}_contact", tag=top) ds.add_1d_contact(material='metal', mesh=meshname, name=f"{bottom}_contact", tag=bottom) ds.finalize_mesh(mesh=meshname) return meshname, region, top, bottom
def CreateMesh2(device, region): create_1d_mesh(mesh="dio") add_1d_mesh_line(mesh="dio", pos=0, ps=1e-7, tag="top") add_1d_mesh_line(mesh="dio", pos=0.5e-5, ps=1e-8, tag="mid") add_1d_mesh_line(mesh="dio", pos=1e-5, ps=1e-7, tag="bot") add_1d_contact(mesh="dio", name="top", tag="top", material="metal") add_1d_contact(mesh="dio", name="bot", tag="bot", material="metal") add_1d_region(mesh="dio", material="Si", region=region, tag1="top", tag2="bot") finalize_mesh(mesh="dio") create_device(mesh="dio", device=device)
def p_n_junction(meshname='default_mesh', region1='p_region', region2='n_region', material1='CdS', material2='CdTe', thickness1=0.2, thickness2=2, spacing=0.05, top='top', interface='interface', bottom='bottom'): thickness1 = thickness1 * 1E-4 thickness2 = thickness2 * 1E-4 spacing = spacing * 1E-4 # convert nm to cm ds.create_1d_mesh(mesh=meshname) ds.add_1d_mesh_line(mesh=meshname, pos=0, ps=spacing/10, tag=top) ds.add_1d_mesh_line(mesh=meshname, pos=thickness1, ps=spacing/50, tag=interface) ds.add_1d_region(mesh=meshname, tag1=top, tag2=interface, region=region1, material='Si') ds.add_1d_mesh_line(mesh=meshname, pos=thickness1+thickness2, ps=spacing, tag=bottom) ds.add_1d_region(mesh=meshname, tag1=interface, tag2=bottom, region=region2, material='InAs') ds.add_1d_contact(material='metal', mesh=meshname, name=f"{top}_contact", tag=top) ds.add_1d_contact(material='metal', mesh=meshname, name=f"{bottom}_contact", tag=bottom) ds.add_1d_interface(mesh=meshname, tag=interface, name=interface) ds.finalize_mesh(mesh=meshname) return meshname
def CreateMesh(device, region, meshname='diode'): ''' Meshing ''' create_1d_mesh(mesh=meshname) add_1d_mesh_line(mesh=meshname, pos=0, ps=1e-7, tag="top") add_1d_mesh_line(mesh=meshname, pos=0.5e-5, ps=1e-9, tag="mid") add_1d_mesh_line(mesh=meshname, pos=1e-5, ps=1e-7, tag="bot") add_1d_contact(mesh=meshname, name="top", tag="top", material="metal") add_1d_contact(mesh=meshname, name="bot", tag="bot", material="metal") add_1d_region(mesh=meshname, material="Si", region=region, tag1="top", tag2="bot") finalize_mesh(mesh=meshname) create_device(mesh=meshname, device=device)
def __init__(self, **kwargs): super().__init__(**kwargs) self.mesh = create_1d_mesh(mesh=self.name)
CdS_params = { 'permittivity': 10, 'electron_affinity': 4.0, 'band_gap': 2.4, 'N_cond': 2.2E18, 'N_val': 1.8E19, 'mobility_n': 25, 'mobility_p': 100, 'p_doping': 0, 'n_doping': 1.1E18 } # Devsim requires you create the entire mesh first include interfaces before specifying regions # Create mesh ds.create_1d_mesh(mesh=meshname) # n1 top_tag = f"top_{CdS_region}" interface_tag = f"bot_{CdS_region}" bottom_tag = f"bot_{CdTe_region}" ds.add_1d_mesh_line(mesh=meshname, pos=0, ps=spacing, tag=top_tag) # add_1d_mesh_line(mesh=meshname, pos=n1_thick/2, ps=spacing, tag="mid_n1") ds.add_1d_mesh_line(mesh=meshname, pos=CdS_thickness, ps=spacing, tag=interface_tag) ds.add_1d_region(mesh=meshname, material="CdS", region=CdS_region, tag1=top_tag, tag2=interface_tag)
CreateSiliconDriftDiffusion(device, region) for i in get_contact_list(device=device): if circuit_contacts and i in circuit_contacts: CreateSiliconDriftDiffusionAtContact(device, region, i, True) else: CreateSiliconDriftDiffusionAtContact(device, region, i) #---- Start ---- device = "MyDevice" region = "MyRegion" # Make a mesh for this device and region # CreateMesh(device=device, region=region) meshname = 'diode' create_1d_mesh(mesh=meshname) add_1d_mesh_line(mesh=meshname, pos=0, ps=1e-7, tag="top") add_1d_mesh_line(mesh=meshname, pos=0.5e-5, ps=1e-9, tag="mid") add_1d_mesh_line(mesh=meshname, pos=1e-5, ps=1e-7, tag="bot") add_1d_contact(mesh=meshname, name="top", tag="top", material="metal") add_1d_contact(mesh=meshname, name="bot", tag="bot", material="metal") add_1d_region(mesh=meshname, material="Si", region=region, tag1="top", tag2="bot") finalize_mesh(mesh=meshname) create_device(mesh=meshname, device=device) SetSiliconParameters(device, region, 300) set_parameter(device=device, region=region, name="taun", value=1e-8) set_parameter(device=device, region=region, name="taup", value=1e-8)