Extending diodes_1D example to multi-layer structure

Hello, Juan.
I have studied diodes_1D example to understand working principle of DEVSIM.
I understood calculation flow but cannot get it how to extend this example to multi-layer structure.
My summary of calculation flow in the example is below.

==================
[Calculation flow]
Create mesh
Set parameters
SetNetDoping
InitialSolution

  • CreateSolution (Potential set)
  • CreateSiliconPotentialOnly (charge, potential model)
    : equation set (solve potential, may be poisson equation)
  • CreateSiliconPotentialOnlyContact
    : contact_equation set (PotentialEquation set)

solve
(to solve potential)

DriftDiffusionInitialSolution

  • CreateSolution (Electrons set)
  • CreateSolution (Holes set)
  • CreateSiliconDriftDiffusion
    • CreatePE (Potential equation set)
    • CreateBernoulli (Bernoulli function set)
    • CreateSRH (SRH set)
    • CreateECE (ElectronContinuityEquation set)
    • CreateHCE (HoleContinuityEquation set)

solve
(to solve eq state)

I understood that 4 Equations are solved in 1-layer structure.
(Potential equation / Contact Equation / Continuity equation for e, h)
Then, in case of 3-layer structure, how equation should be set?

[My Plan]
Potential equation / Continuity equation per 1-layer
Contact equation
Interface equation per 1-interface (If Interface equation API exist)

Since the easiest way to study is to learn example, please cite muli-layer example if exists.
I would like to utilize this excellent software DEVSIM.
Thank you for your support.

For the Potential only case, you should be able to use:
simple_physics.CreateSiliconOxideInterface
for setting continuity in the Poisson equation.

For the Drift-Diffusion case, you would use these functions to set continuity in the Potential, Electrons, and Holes across the interface:

simple_physics.CreateSiliconOxideInterface
simple_physics.CreateSiliconSiliconInterace

Note that the 2nd function sets the boundary condition that the electron and hole densities across the interface are continuous. Once this is working, you can explore the possibility of different boundary conditions, such as continuity in the quasi fermi levels.

Unfortunately, there is not an example for a diode, but you can see similar boundary conditions in testing/res2.py which solves for continuous Potential and Electrons across a resistor with 2 layers.

There are a few discussions in this forum concerning the setup of interface conditions, so you may want to refer to them to understand how the different interface types are supposed to work. For example:
Interface equation for tunneling current

Alse see Could the more information can be offered about fluxterm in interface_equation