usnistgov / sesame

2-d drift-diffusion-Poisson python code
Other
19 stars 9 forks source link

p-i-n junction #5

Open FrancescBonnin opened 5 years ago

FrancescBonnin commented 5 years ago

Dear all,

I am trying to simulate a p-i-n junction with sesame. I have defined the three regions, all of material properties, the mesh and so on. The first calculation (Equilibrium potential already computed. Moving on.) has been done correctly. However, when a applied voltage is applied an error occurs: The Newton-Raphson algorithm diverged, try a better guess or finer grid . Any ideas? Have you already tried to simulate this kind of junctions?

Thanks!

phaney2 commented 5 years ago

There can be many reasons why the Newton-Raphson algorithm fails to converge to the solution. Generically, it's because the initial guess provided to the algorithm is not sufficiently close to the correct answer. There are a number of tricks to play to improve convergence, such as using a more refined grid, or using the solution of a simpler simulation as a guess for the troublesome simulation. A common way I've done the latter is to slowly "turn on" a parameter from a value of zero (where convergence is attained) to the value I want, using the solution from each parameter value as a guess for the subsequent parameter value.

If you want to post the input file, it may be useful to help diagnose the problem (it's always possible that converge is not attained due to simple mistakes in defining the input, resulting in an unphysical system).

tcaduser commented 5 years ago

One method I have used successfully is logarithmic damping. Assuming that carrier density has an exponential dependence on potential, the potential updates between iterations is scaled logarithmically to keep the simulation from diverging. Here is an example from devsim: https://github.com/devsim/devsim/blob/8ea795a06c86f8834696ada0018dfaed2d0b6079/src/Equation/Equation.cc#L130