Home Examples Screenshots User manual Bluesky logo
OghmaNano Simulate organic/Perovskite Solar Cells, OFETs, and OLEDs DOWNLOAD

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

Later iterations

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.

Exit strategy

Solver type and tools

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.