An open source drift diffusion code based in MATLAB for simulating solar cells
Authors: Philip Calado, Piers RF Barnes, Ilario Gelmetti, Mohammed Azzouzi, Benjamin Hilton
Imperial College London, 2019
If you use Driftfusion please let us know by emailing: firstname.lastname@example.org
Please log bugs through GitHub.
To get started do the following:
If you are new to GitHub it is highly recommended that you download GitHub desktop at: https://desktop.github.com/. Alternatively, you can download Driftfusion standalone as a folder but you won’t easily be able to synch to the latest version.
Fork the Driftfusion GitHub repository (project). Instructions can be found here: https://help.github.com/en/articles/fork-a-repo
Navigate to your repository/project folder in MATLAB.
initialise_dfinto the command prompt. This adds the subfolders and associated functions to the file path.
The parameters class
pcdefines all the parameters for your device. You can edit the parameters directly in
pc(found in the
/Core folderand create a parameters object by typing:
par = pc;
The names of properties and their units are given in the commented code in the
- A better way of defining your device is to use the .csv files contained in the
/Input_filesfolder. For example, to create a parameters object with default parameters to simulate an inverted PTPD/perovskite/PCBM stack type:
par = pc('Input_files/ptpd_mapi_pcbm.csv');
It is recommended to duplicate the existing .csv files to define your own device and use a programme like Excel or Open Office to edit them. Ensure that the material name given in the 'stack' column matches with one of the materials in the
Libraries/Index_of_Refraction_library.xls if you wish to use the Beer-Lambert optical model.
- Obtain equilibrium solutions for your device by typing:
soleq = equilibrate(par)
Inside soleq are 2 solutions:
soleq.ion. For perovskites you should generally use
soleq.el is the same device at equilibrium without mobile ions.
- Try running a JV using:
JVsol = doJV(soleq.ion, 1e-2, 100, 1, 1, 0, 1.4, 3)
The various input arguments are discussed in the comments of each code. At any time you can plot the JV using
Try using doJV as a model for writing functions of your own.
The example script shows you how to produce two devices with different transport layers and scan current-voltage scans at 50 mVs-1 for each and plot the current-voltage curve, an energy level diagram and the currents using
Replicating published paper's data
Impedance Spectroscopy on homojunction model, applying an oscillating voltage profile
Check out the
2018-EIS branch of this repository or download directly just this branch.
Then follow the instructions in the branch readme or on this wiki page.