Opening MSH files

For the drift-diffusion simulation, I was able to get the simulation to run with this script:

###
### Drift diffusion simulation at equilibrium
###
for region in get_region_list(device=device):
    diode_common.DriftDiffusionInitialSolution(device, region)
for interface in get_interface_list(device=device):
    CreateSiliconSiliconInterface(device=device, interface=interface)

solve(type="dc", absolute_error=1e10, relative_error=1e-4, maximum_iterations=20)

v = 0.1
while v < 0.51:
    set_parameter(device=device, name=GetContactBiasName("top"), value=v)
    solve(type="dc", absolute_error=1e10, relative_error=1e-5, maximum_iterations=30)
    PrintCurrents(device, "top")
    PrintCurrents(device, "bot")
    v += 0.1

Please note that the relative error of 1e-4 is not ideal, and may indicate that there needs to be some work on mesh refinement. However, current continuity is shown in the resulting currents:

top	0.5	5.648157195895404e-06	2.8727882927756355e-14	5.648157224623287e-06
bot	0.0	-1.1296314493460927e-21	-5.648157246730474e-06	-5.648157246730475e-06

I recommend that you first attempt to get a working simulation with your design. Note that I have scripts which should help with doing mesh refinement to get a better solution.

Please note in the above statements, it is best to set remove the region, and possibly device option from the set_parameter command so that the values are global over all regions.

Hello @Juan

Thank you for the explanation and the script!
I think I understand better now what each function is doing, looks like I was misusing some of them earlier.
I made the changes you suggested and I followed your logic and structure in your script for my own design and it seems like it’s working, and with much lower relative error too! Thank you for your help, I really appreciate it!

1 Like