Hi @Juan
Thank you for the list of functions and sorry for the late reply.
I’ve been trying to get these functions to work, but I haven’t had much luck with them.
For easier reference, I tried making this work in the test.py
file that I mentioned last time:
https://github.com/devsim/devsim_misc/blob/main/gmsh/test.py
For my case, I think CreateSiliconSiliconInterface
would be more helpful, but I couldn’t get it to work.
So instead I tried to start with using CreateSiliconOxideInterface
, for which I found an example in examples\mobility\gmsh_mos2d_kla.py
.
At first, I tried simply calling CreateSiliconOxideInterface
right after setting the Net Doping equations, but when the solve()
function was called it gave me an error that the equation for continuousPotential
evaluates to an invalid.
So I modified it to try and follow the structure of gmsh_mos2d_kla.py
. With this, I was able to get the Potential equation, but then when the solve()
function is called I get a DEVSIM FATAL error, and this is printed out right before the error:
Device: mydevice Region: nlayer contact: bot Contact Equation: ElectronContinuityEquation Circuit node “bot_bias” does not exist
I tried to find where the ElectronContinuityEquation
is set up but I haven’t been able to make any helpful changes.
As of right now, this is what I have in the file test.py
up to the point where the error occurs:
(For now, I avoided calling functions that call multiple functions in them to be able to see better what is going in on)
from devsim import *
from devsim.python_packages.simple_physics import *
import diode_common
mesh="mymesh"
device="mydevice"
create_gmsh_mesh(mesh=mesh, file='newTest.msh')
add_gmsh_region (mesh=mesh, gmsh_name="bulk", region="bulk", material="Silicon")
add_gmsh_region (mesh=mesh, gmsh_name="disk", region="disk", material="Silicon")
add_gmsh_region (mesh=mesh, gmsh_name="nlayer", region="nlayer", material="Silicon")
add_gmsh_contact (mesh=mesh, gmsh_name="top", region="disk", material="metal", name="top")
add_gmsh_contact (mesh=mesh, gmsh_name="bot", region="nlayer", material="metal", name="bot")
add_gmsh_interface (mesh=mesh, gmsh_name="disk_bulk", region0="disk", region1="bulk", name="disk_bulk")
add_gmsh_interface (mesh=mesh, gmsh_name="bulk_nlayer", region0="bulk", region1="nlayer", name="bulk_nlayer")
finalize_mesh (mesh=mesh)
create_device (mesh=mesh, device=device)
write_devices (file="test_out.msh")
# copied for other file
def SetupContinuousPotentialAtInterface(device, interface):
# type continuous means that regular equations in both regions are swapped into the primary region
interface_model(device=device, interface=interface, name="continuousPotential", equation="Potential@r0-Potential@r1")
interface_model(device=device, interface=interface, name="continuousPotential:Potential@r0", equation= "1")
interface_model(device=device, interface=interface, name="continuousPotential:Potential@r1", equation="-1")
interface_equation(device=device, interface=interface, name="PotentialEquation", variable_name="Potential", interface_model="continuousPotential", type="continuous")
# copied for other file
def SetupContinuousElectronsAtInterface(device, interface):
# type continuous means that regular equations in both regions are swapped into the primary region
interface_model(device=device, interface=interface, name="continuousElectrons", equation="Electrons@r0-Electrons@r1")
interface_model(device=device, interface=interface, name="continuousElectrons:Electrons@r0", equation= "1")
interface_model(device=device, interface=interface, name="continuousElectrons:Electrons@r1", equation="-1")
interface_equation(device=device, interface=interface, name="ElectronContinuityEquation", variable_name="Electrons", interface_model="continuousElectrons", type="continuous")
# copied for other file
def DriftDiffusionInitialSolution(device, region, circuit_contacts=None):
#### drift diffusion solution variables
CreateSolution(device, region, "Electrons")
CreateSolution(device, region, "Holes")
#### create initial guess from dc only solution
set_node_values(device=device, region=region, name="Electrons", init_from="IntrinsicElectrons")
set_node_values(device=device, region=region, name="Holes", init_from="IntrinsicHoles")
###
### Set up equations
###
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)
diode_common.SetParameters(device=device, region="bulk")
diode_common.SetParameters(device=device, region="disk")
diode_common.SetParameters(device=device, region="nlayer")
# Same carrier number, reference at z=0.5e-5
node_model(device=device, region="bulk", name="Acceptors", equation="1.0e18*step(0-z);")
node_model(device=device, region="bulk", name="Donors", equation="1.0e18*step(z-0);")
node_model(device=device, region="bulk", name="NetDoping", equation="Donors-Acceptors;")
node_model(device=device, region="disk", name="Acceptors", equation="1.0e18*step(0-z);")
node_model(device=device, region="disk", name="Donors", equation="1.0e18*step(z-0);")
node_model(device=device, region="disk", name="NetDoping", equation="Donors-Acceptors;")
node_model(device=device, region="nlayer", name="Acceptors", equation="1.0e18*step(0-z);")
node_model(device=device, region="nlayer", name="Donors", equation="1.0e18*step(z-0);")
node_model(device=device, region="nlayer", name="NetDoping", equation="Donors-Acceptors;")
CreateSolution(device=device, region="bulk", name = "Potential")
CreateSolution(device=device, region="disk", name = "Potential")
CreateSolution(device=device, region="nlayer", name = "Potential")
# Having these next 6 lines or not, doesn't seem to make a difference
CreateSolution(device=device, region="bulk", name = "Electrons")
CreateSolution(device=device, region="disk", name = "Electrons")
CreateSolution(device=device, region="nlayer", name = "Electrons")
CreateSolution(device=device, region="bulk", name = "Holes")
CreateSolution(device=device, region="disk", name = "Holes")
CreateSolution(device=device, region="nlayer", name = "Holes")
SetSiliconParameters(device=device, region="bulk", T=300)
SetSiliconParameters(device=device, region="disk", T=300)
SetSiliconParameters(device=device, region="nlayer", T=300)
CreateSiliconPotentialOnly(device=device, region="bulk")
CreateSiliconPotentialOnly(device=device, region="disk")
CreateSiliconPotentialOnly(device=device, region="nlayer")
SetOxideParameters(device=device, region="bulk", T=300)
SetOxideParameters(device=device, region="disk", T=300)
SetOxideParameters(device=device, region="nlayer", T=300)
CreateOxidePotentialOnly(device=device, region="bulk")
CreateOxidePotentialOnly(device=device, region="disk")
CreateOxidePotentialOnly(device=device, region="nlayer")
CreateSiliconPotentialOnlyContact(device=device, region="disk", contact="top")
CreateSiliconPotentialOnlyContact(device=device, region="nlayer", contact="bot")
# If next 2 lines are commented out, error changes to:
# Value for "bot_bias" not available
#set_parameter(device=device, region="disk", name=GetContactBiasName(contact="top"), value=0.0)
#set_parameter(device=device, region="nlayer", name=GetContactBiasName(contact="bot"), value=0.0)
CreateSiliconOxideInterface(device=device, interface="disk_bulk")
CreateSiliconOxideInterface(device=device, interface="bulk_nlayer")
###########################################################
# Error occurs in this line
solve(type="dc", absolute_error=1.0, relative_error=1e-5, maximum_iterations=30)
(I also tried using SetupContinuousElectronsAtInterface
but there seems to be a similar issue with getting the ElectronContinuityEquation
)
Do you know what I’m missing or what I’m doing wrong?
If possible, could you explain how to correctly use CreateSiliconSiliconInterface
in the case of test.py
?