Drift–Diffusion Solver Configuration
The Drift–Diffusion solver can be configured by selecting Configure from the Electrical ribbon. This opens the solver configuration window, where numerical properties such as iteration limits, error tolerances, and convergence strategies can be adjusted. These options allow the user to control solver performance and stability for different device simulations.
Configuring the electrical solver
OghmaNano’s electrical engine solves a tightly coupled set of non-linear equations (Poisson + drift–diffusion, plus any enabled kinetics). These equations contain exponentials and strong couplings, so they are solved iteratively using a Newton–Raphson method on a single global Jacobian. You normally won’t need to change the defaults, but the configuration panel lets you stabilize hard cases, speed up easy ones, or inspect how the numerics behave.
Open the configuration by going to the Electrical tab, selecting Drift–diffusion, and choosing Configure — see DD Solver Open. This brings up the window shown in DD Solver Window, where you can adjust how the solver iterates and converges.
What each section controls
The panel is divided into four main blocks that govern different phases of a run: First iteration, Later iterations, Voltage ramp, and Exit strategy. In all phases the core idea is the same: start from a guess, update the unknowns with Newton steps, and stop when the global error is sufficiently small. A clamp limits the maximum update per step to keep the solver from jumping into unphysical regions. Small clamps → slower but very stable; large clamps → faster but potentially unstable.
First iteration
- Max electrical iterations (first step) — Upper bound on Newton steps for the very first solve (often at 0 V in the dark). A larger allowance helps difficult cold starts.
- Electrical clamp (first step) — Scales the maximum Newton update on the first step. As a rule of thumb: 0.1 is very safe (slow), 1.0 is a good default, ≥2.0 can be fast but less stable.
- Desired solver error (first step) — Convergence target for the first solve (smaller = more accurate but slower). Typical acceptance: not worse than \(1\times10^{-5}\); for robust starts you may set \(1\times10^{-8}\)–\(1\times10^{-9}\).
Later iterations
- Max electrical iterations — Iteration cap for all subsequent solves after the first.
- Electrical clamp — Like above, but applied to every step except the first. You can often relax this compared to the first step for speed.
- Desired solver error — Convergence target for routine steps. Keep consistent with your accuracy needs; \(1\times10^{-6}\)–\(1\times10^{-8}\) are common.
Voltage ramp
When you ramp from an initial bias (e.g. 0 V) to a target operating point (possibly high voltage), the intermediate solves are often just waypoints. This block lets you use looser tolerances or different clamps to move through the ramp faster while keeping the final operating-point solves strict.
- Max electrical iterations (ramp) — Cap for each ramp step.
- Electrical clamp (ramp) — Step-size control during the ramp.
- Desired solver error (ramp) — Convergence target used only for ramp steps.
- Newton minimum iterations — Enforce at least this many steps so the solver doesn’t quit early just because the initial residual happens to be small.
Exit strategy
- Newton solver clever exit — If the residual “bounces in the noise” (up–down with no trend), stop iterating and accept the best state so far.
- Solve Kirchhoff’s current law in Newton solver — Include KCL constraints directly in the Jacobian for tighter current continuity.
- Quit on convergence problem / Quit on inverted Fermi-level — Hard-stop guards for obviously bad states.
Solver type and tools
- Newton solver to use — Choose the algorithm:
none
— No electrical solve (optical/thermal only).newton
— Standard 1D Newton solver.
- Matrix solver / Complex matrix solver — Select the linear solver backend.
- Slotboom T0 / D0 / n0 — Parameters for
newtonnorm
. - Use newton cache (experimental) — Spill large intermediate data to disk to reduce memory pressure (experimental).
- Solver output verbosity — Controls how much progress information is printed.
Practical guidance
If a case is touchy (high doping, extreme fields, strong injection), lower the clamp and tighten the first-step tolerance. For easy, well-behaved cases, raise the clamp to gain speed. Use the ramp block to move quickly to your operating point, then enforce stricter tolerances there.
See also: The configuration entry point shown in DD Solver Open and the full dialog in DD Solver Window.
Solver stability
OghmaNano is a numerical simulator that solves a tightly coupled set of differential equations for charge, potential, and recombination. Like any numerical solver, it requires physically realistic input parameters to converge successfully. Values that are exactly zero, infinitely large, or spread across too many orders of magnitude can cause the underlying matrix operations to become unstable. To help you avoid these problems, this section highlights some practical considerations when configuring your simulations.
Avoiding very big and very small numbers
Open MATLAB (or Octave on Linux) and type the following expression: \(((1e-1+1e1)-1e1)/1e-1\). Before pressing enter, evaluate it in your head: the \(1e1\) and \(-1e1\) cancel, leaving \(\frac{1e-1}{1e-1}=1\). Now replace the powers of 10 with 19 and try: \(((1e-19+1e19)-1e19)/1e-19\). Again, on paper the result should be \(1\).
However, when you let the computer evaluate it, the answer will be \(0\), not \(1\). This happens because computers store numbers with limited precision (about 15–16 decimal digits on a modern machine). When you add \(1e-19\) to \(1e19\), the smaller term is lost in rounding, so the computer sees \(1.000000000000000e19\) instead of \(1.0000000000000000001e19\). Subtracting \(1e19\) then gives exactly zero, and the contribution of \(1e-19\) vanishes.
Numerical precision matters
If your simulation involves parameters spanning too many orders of magnitude, the solver may lose accuracy. Try to avoid extreme ratios, especially in mobility or density of states, to ensure stability.
All computers are affected by this, no matter how powerful. For device simulations this means you should avoid parameter ranges that create matrices with very large and very small numbers side by side. For example, mobilities of \(1e-19\) alongside \(1e5\) will cause numerical difficulties. This is particularly important when simulating insulators.
Avoid zeros
Zero values cause divide-by-zero errors. Do not set mobilities, capture cross sections, tail slopes, or densities of states to exactly zero. It is fine to use zero for recombination constants.
⚠️ Avoid exact zeros
Replace zeros with very small values (e.g. \(1e-30\)) to prevent numerical instabilities while still approximating “nearly zero.”
Very big steps in the band gap
Large energy steps in the band gap produce carrier densities that are either extremely small or extremely large, which leads directly to the same precision problems described in Avoiding very big and very small numbers. Keep energy discretization fine enough to avoid unphysical jumps.
🔍 Check your mesh
If your band-gap discretization is too coarse, you may generate unphysical carrier densities. Refine the mesh to keep values within a numerically stable range.