Job Submission¶
The Bumblebee Python API can be used to set up new simulations without going through the web interface.
In this tutorial, we will illustrate how to setup the Ir(ppy3)-based phosphorescent OLED simulations from a previous GUI tutorial.
Create Materials¶
Materials created using the Python API use the default values defined by the web interface. It is not possible to select a template, therefore requiring all relevant parameters to be set manually.
# Create phosphorescent dye
dye = bb_client.new("material")
dye.name = "Irppy3"
dye.homo = -5.27
dye.lumo = -1.86
# Compute the exciton levels from the binding energies
dye.singlet_binding_energy = 0.75
dye.triplet_binding_energy = 1.0
dye.singlet = dye.homo - dye.lumo + dye.singlet_binding_energy
dye.triplet = dye.homo - dye.lumo + dye.triplet_binding_energy
# Configure phosphorescent emission
dye.st_ratio = 0
dye.tta_ratio = 0
dye.isc_rate = 1e10
dye.triplet_rad_decay = 6.1e5
dye.triplet_nonrad_decay = 1.9e4
# Create host matrix
host = bb_client.new("material")
host.name = "CBP"
host.homo = -6.08
host.lumo = -1.75
host.singlet_binding_energy = 1.0
host.triplet_binding_energy = 1.7
host.singlet = host.homo - host.lumo + host.singlet_binding_energy
host.triplet = host.homo - host.lumo + host.triplet_binding_energy
host.dexter_prefactor_singlet = 0.95
host.dexter_prefactor_triplet = 0.95
host.singlet_nonrad_decay = 1e5
host.triplet_nonrad_decay = 1e4
# Create electron transport layer
etl = bb_client.new("material")
etl.name = "TPBi"
etl.homo = -6.2
etl.lumo = -1.7
etl.singlet_binding_energy = 0.75
etl.triplet_binding_energy = 1.0
etl.singlet = etl.homo - etl.lumo + etl.singlet_binding_energy
etl.triplet = etl.homo - etl.lumo + etl.triplet_binding_energy
etl.singlet_nonrad_decay = 1e8
etl.triplet_nonrad_decay = 1e8
# Create hole transport layer
htl = bb_client.new("material")
htl.name = "TAPC"
htl.homo = -5.5
htl.lumo = -0.96
htl.singlet_binding_energy = 1.0
htl.triplet_binding_energy = 1.59
htl.singlet = htl.homo - htl.lumo + htl.singlet_binding_energy
htl.triplet = htl.homo - htl.lumo + htl.triplet_binding_energy
htl.singlet_nonrad_decay = 1e8
htl.triplet_nonrad_decay = 1e8
# Upload the materials to the database
dye.create()
host.create()
etl.create()
htl.create()
Note
If the names of the materials have already been used by the web interface, an upload conflict will occur. Adjust the names of the materials to be descriptively unique in order to successfully upload the new materials.
Create Compositions¶
The add_fraction
method is used when creating layer compositions. Note that the Python API did not automatically create pure compositions for the materials.
# Host-guest mixture
hostguest = bb_client.new("composition")
hostguest.name = "CBP-5Irppy3"
hostguest.add_fraction(0.95, host.id)
hostguest.add_fraction(0.05, dye.id)
hostguest.create()
# Pure HTL
pure_htl = bb_client.new("composition")
pure_htl.name = "Pure TAPC"
pure_htl.add_fraction(1, htl.id)
pure_htl.create()
# Pure ETL
pure_etl = bb_client.new("composition")
pure_etl.name = "Pure TPBi"
pure_etl.add_fraction(1, etl.id)
pure_etl.create()
Note
Make sure that the volume fractions add to 1 in order to successfully create a composition.
Note
Make sure to create
the materials first, otherwise you will not be able to link to a valid ID when adding to the composition.
Create a Stack¶
Layers can be added to the stack in a similar way using the add_layer
method.
# Add layers to the stack
stack = bb_client.new("stack")
stack.name = "TAPC-CBP-5Irppy3-TPBi"
stack.add_layer("HTL", 20, pure_htl.id)
stack.add_layer("EMI", 30, hostguest.id)
stack.add_layer("ETL", 20, pure_etl.id)
Förster interactions must be specified for each donor-acceptor pair. For this tutorial, we will limit ourselves to interactions between the host and guest. Förster processes are each assigned a unique ID, in accordance with their order in the web interface:
Singlet diffusion
Singlet-hole quenching
Singlet-electron quenching
Singlet-singlet annihilation
Singlet-triplet annihilation
Triplet diffusion
Triplet-hole quenching
Triplet-electron quenching
Triplet-singlet annihilation
Triplet-triplet annihilation
# Configure Förster interactions inside host-guest system
donor_layer = 1
acceptor_layer = 1
radius = 1.5
# Only consider triplet processes
for interaction in [5,6,7,9]:
for donor_material in [host.id, dye.id]:
for acceptor_material in [host.id, dye.id]:
stack.add_foerster(interaction,
donor_layer,
donor_mat_index,
acceptor_layer,
acceptor_mat_index,
radius)
# Commit completed stack
stack.create()
Additional processes can be specified using the add_degradation
, add_absorption
, add_dopant
and add_cross_layer_dexter_prefactor
methods.
Create a Parameter Set¶
We select the newly-created stack when configuring the parameter set. Note that the electrode energy levels are not configured automatically by the Python API.
# Link the stack to a new parameter set
parameter_set = bb_client.new("param_set")
parameter_set.name = "SingleVoltage-CBP-5Irppy"
parameter_set.stack_id = stack.id
# Add injection barrier to electrode contacts
parameter_set.fermi_level_left = htl.homo + 0.2
parameter_set.fermi_level_right = etl.lumo - 0.2
# Set the voltage point
parameter_set.voltage = 5
parameter_set.create()
Starting the Simulation¶
Creating a simulation resource will automatically submit the job. The default server will be used to run the simulation, unless specified otherwise.
The simulation type is set using the add_sweep
method.
# Create a single-voltage simulation using the new parameter set
simulation = bb_client.new("simulation")
simulation.name = "1V-CBP-5Irppy"
simulation.add_sweep(parameter_set.id, first_disorder=1, final_disorder=5)
# Submit the simulation
simulation.create()
Parameter sweeps can also be specified, analogous to the web interface:
# Create a voltage sweep
sweep = bb_client.new("simulation")
sweep.name = "Sweep-CBP-5Irppy"
sweep.add_sweep(parameter_set.id, first_disorder=1, final_disorder=2,
sweep_variable='voltage', sweep_from=1, sweep_to=5, sweep_steps=5)
Simulation Output¶
The progress of the simulation can be monitored from within the web interface, or using the native monitoring tools of your compute server. Once the simulation has completed, the available output can be listed using the available
method.
simulation.results.available()