Transient simulation of organic light emitting electrochemical cell

This is sam­ple sim­u­la­tion of elec­tro­chem­i­cal dop­ing in light-emit­ting elec­tro­chem­i­cal cell, vi­su­al­iz­ing the ef­fect of as­sumed elec­tron­ic mo­bil­i­ty mod­el.

%matplotlib inline
from matplotlib import colors
import matplotlib.pylab as plt

from oedes.fvm import mesh1d
from oedes import context,init_notebook,testing,models
import numpy as np
from oedes.functions import Aux2

init_notebook()

Model and parameters

class CustomMobility(models.MobilityModel):
    def mu_func(self, T, E, c):
        mu0 = 5e-11
        mu1 = 5e-9
        W = 0.04
        f0 = 0.3
        f = c / 0.3e27
        return (mu1 - mu0) * Aux2((f0 - f) / W) + mu0

    def mobility(self, parent, ctx, eq):
        mu_cell = self.mu_func(ctx.varsOf(eq.thermal)['T'], ctx.varsOf(eq.poisson)['Ecellm'], ctx.varsOf(eq)['c'])
        mu_face = eq.mesh.faceaverage(mu_cell)
        ctx.varsOf(eq).update(mu_face = mu_face, mu_cell = mu_cell)
mesh = mesh1d(2e-6)
def solve(mu_ions, mobility_model, additional_params=None, voltage=5.):
    model = models.BaseModel()
    models.std.electronic_device(model, mesh, 'pn', mobility_model = mobility_model)
    cation, anion, initial_salt = models.std.add_ions(model, mesh, zc=1, za=-1)
    model.setUp()
    xinit = initial_salt(0.1e27)
    params = {'T': 300.,
              'electron.energy': 0.,
              'electron.N0': 0.3e27,
              'hole.energy': -2.,
              'hole.N0': 0.3e27,
              'electrode0.workfunction': 2.,
              'electrode1.workfunction': 0.,
              'electrode0.voltage': voltage,
              'electrode1.voltage': 0,
              'cation.mu': mu_ions,
              'anion.mu': mu_ions,
              'npi': 0,
              'epsilon_r': 3.
              }
    if additional_params is not None:
        params.update(additional_params)
    c = context(model,x=xinit)
    c.transient(params, 1, 1e-9)
    return c
def transientplot(data):
    N0 = 5e27
    n = 20
    for it, t in enumerate(10**np.linspace(-5, -1, n + 1)):
        out = data.attime(t).output()
        c = 1 - (1. - it / n)
        ncolor = colors.rgb2hex((1,1 - c,1 - c))
        pcolor = colors.rgb2hex((1 - c,1 - c,1))
        plt.plot(mesh.cells['center'] * 1e9,out['electron.c'] / N0,ncolor)
        plt.plot(mesh.cells['center'] * 1e9,out['hole.c'] / N0,pcolor)
        testing.store(out['electron.c'], rtol=1e-7, atol=1e-3 * N0)
        testing.store(out['hole.c'], rtol=1e-7, atol=1e-3 * N0)
    plt.yscale('log')
    plt.ylim([1e-5, 1.])
    plt.xlabel('$x$ [nm]')
    plt.ylabel('$c/N_0$')

Results

In the plots be­low, elec­trons are shown in red, and holes are shown in blue.

Concentration independent mobility

mu_params = {'electron.mu':5e-11,'hole.mu':5e-11}
c=solve(5e-11, models.MobilityFromParams(), mu_params)
transientplot(c)

Concentration dependent mobility

c=solve(mu_ions=5e-11, mobility_model=CustomMobility())
transientplot(c)

Reference

S.van Reenen, R.A.J.Janssen, M.Ke­merink Dop­ing dy­nam­ics in light-emit­ting elec­tro­chem­i­cal cells, Or­gan­ic Elec­tron­ics 12 (2011) 1746–1753.