The continuity equation does not converge

Hello,author:
I ran bjt_dd.py and found that the calculation always does not converge because the Error of ContinuityEquation is too much:

Iteration: 39
Device: “bjt” RelError: 8.23584e+09 AbsError: 2.28440e+37
Region: “bjt” RelError: 8.23584e+09 AbsError: 2.28440e+37
Equation: “ElectronContinuityEquation” RelError: 8.22700e+09 AbsError: 1.00114e+37
Equation: “HoleContinuityEquation” RelError: 8.84553e+06 AbsError: 1.28327e+37
Equation: “PotentialEquation” RelError: 1.39382e+03 AbsError: 9.66731e-01

the mesh used is the one that should be given in your example, and I didn’t change any parameters.What is the reason for this?

I’m very sorry that some of my questions may have been too basic, but I do feel that I’m making progress and your replies are really very important to me, so thank you again for your patience in replying!

Hi @Hay ,

Sorry for the delay, but I have had a very busy week.

Convergence problems can be tricky to diagnose.

If it is diverging as you go to a higher bias, you may need to reduce the voltage step. If it is diverging near dc, there could be a problem with the mesh.

Is it not converging with the mesh that is included in the projects, or is this one that you had created yourself? Did you change many of the parameters or simulation scripts?

Hello, author:
The problem occurs when I run the bjt_dd.py program to generate the bjt_dd_0.msh file, which at this point in time should not have added the applied bias yet, but just the equations, and there is too much error in the continuity equations.

The mesh file I used was exactly the bjt.msh given in your example, and I changed all the parameters that I had previously modified (copied the code you shared on github).

Here is the bjt.msh, is it possible that the one given in your example is not the final msh file? Or something else?

And there is a problem in devsim_bjt_example/simdir/bjt_dd.py at main · devsim/devsim_bjt_example · GitHub

“from physics.new_physics import *” in line 35 which seems to be spare

I got someone else to look at your example for me and found that using your bjt.msh file, I really couldn’t run the bjt_dd.py file, and adding up the number of iterations to 1000 didn’t help convergence.

I didn’t change any parameters in your code.

Can you run the script bjt_dd.py in your spare time? I’ve been stuck on this for quite some time.

Thank you again and again.

Hello @Hay

It looks like there is a bug in the simulation files.

I have updated the setup_dd.py to fix a problem with how the initial Potential solution was being erased. Please see this link

I have also updated the documentation in this commit.

Please try it out and let me know how it works for you.

Hello ,author:
I saw it as soon as you replied to me, but I’m very sorry I’m in class in the morning and don’t have my computer with me, I’ll try to verify your replies first in the future.

The error did get smaller after I changed it, but with only two iterations,Is this normal?Is this too soon?

The generated bjt_dd_0.msh file is only 140,000 lines long, but the file you provided is 190,000 lines long!

This could be caused by the piece of code you removed, I’m not sure if it’s a normal occurrence.

However, the good news is that I was able to generate a normal Ic_vce.pdf using this 140,000 line bjt_dd_0.msh file I generated.

Mostly, I’d like to know what you removed the creation of the potentials because of.

Can you be more specific if you can, thank you very much!

In TCAD device simulation, a full drift-diffusion simulation will not converge without an initial guess.

A potential-only simulation, with flat fermi levels, is equivalent to the solution of the full drift-diffusion simulation. This is since the electrons and holes are determined by the equilibrium potential solution.

Potential was solved in the potential-only simulation. When creating it again, it was reset to zero. This was a poor initial guess, even though the electrons and holes were correctly initialized here:

https://github.com/devsim/devsim_bjt_example/blob/main/simdir/bjt_dd.py#L45

This simulation example was created in the year 2013, and has not been kept up to date with changes to the simulator over the past decade.

Thank you for your interest in devsim, and this bjt example.

Going from a potential-simulation to a drift diffusion simulation should ideally take only 1 or 2 iterations.

The file format has changed over the years. If you compare the files using a diff program, you can see that some unimportant data was removed from the file format.

Thank you ,author:

You explained it in great detail and thank you very much for your patience.

I asked you earlier about grid refinement and I am very sorry that my description may have been too sketchy at the time.

I experimented many times and changed the sentence you mentioned and found that:

“mincl, maxcl”, these two parameters control should be the grid density between the emitter-base-collector region two by two.

“pdiff” has no effect on the generated grid.

After many attempts I still fail, I think the grid generated at each step looks very reasonable, but when running bjt_refine.py for the second time still “devsim_py3.error: DEVSIM FATAL” occurs.

If you have time could you take a look at what the problem is?

bjt.geo: I changed

sf = 1.0e-4;
Mesh.CharacteristicLengthMax = 10e-5; /*maximum characteristic length /
/
characterisitic lengths for meshing /
/
results in coarse mesh */
cl1 = 10e-5;
cl2 = 10e-5;

the result:

I I changed mixcl and maxcl to twice the original:

refinement.run(device, region, outfile=“begin_bjt_bgmesh.pos”, mincl=4.0e-6, maxcl=2e-4, pdiff=0.025)##local refinement

the result:

Finally,when I use the mesh I created to run bjt_refine angin ,devsim has reported an error:

Of course the doped setting I changed, but I don’t think it should be the cause of it.

314e551dd35948432a53b066e5f8d0c

The error indicates that there is something wrong with the input mesh.

https://github.com/devsim/devsim/blob/main/src/Geometry/Region.cc#L467

Unfortunately, devsim aborted when it determined there was something structually wrong with the mesh. I would suggest modifying the mesh and trying again.