{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import os\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from pathlib import Path" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from solcore import siUnits, material, si\n", "from solcore.interpolate import interp1d\n", "from solcore.solar_cell import SolarCell\n", "from solcore.structure import Junction, Layer\n", "from solcore.solar_cell_solver import solar_cell_solver" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "all_materials = []" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "def this_dir_file(f):\n", " return \"../data/\" + f" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We need to build the solar cell layer by layer.
\n", "We start from the AR coating. In this case, we load it from an an external file" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "refl_nm = np.loadtxt(this_dir_file(\"MgF-ZnS_AR.csv\"), unpack=True, delimiter=\",\")\n", "ref = interp1d(x=siUnits(refl_nm[0], \"nm\"), y=refl_nm[1], bounds_error=False, fill_value=0)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "TOP CELL - GaInP
\n", "Now we build the top cell, which requires the n and p sides of GaInP and a window layer.
\n", "We also load the absorption coefficient from an external file. We also add some extra parameters needed for the
\n", "calculation such as the minority carriers diffusion lengths" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "AlInP = material(\"AlInP\")\n", "InGaP = material(\"GaInP\")\n", "window_material = AlInP(Al=0.52)\n", "top_cell_n_material = InGaP(In=0.49, Nd=siUnits(2e18, \"cm-3\"), hole_diffusion_length=si(\"200nm\"))\n", "top_cell_p_material = InGaP(In=0.49, Na=siUnits(1e17, \"cm-3\"), electron_diffusion_length=si(\"1um\"))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "all_materials.append(window_material)\n", "all_materials.append(top_cell_n_material)\n", "all_materials.append(top_cell_p_material)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "MID CELL - InGaAs
\n", "We add manually the absorption coefficient of InGaAs since the one contained in the database doesn't cover
\n", "enough range, keeping in mind that the data has to be provided as a function that takes wavelengths (m) as input and
\n", "returns absorption (1/m)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "InGaAs = material(\"InGaAs\")\n", "InGaAs_alpha = np.loadtxt(this_dir_file(\"in01gaas.csv\"), unpack=True, delimiter=\",\")\n", "InGaAs.alpha = interp1d(x=1240e-9 / InGaAs_alpha[0][::-1], y=InGaAs_alpha[1][::-1], bounds_error=False, fill_value=0)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "mid_cell_n_material = InGaAs(In=0.01, Nd=siUnits(3e18, \"cm-3\"), hole_diffusion_length=si(\"500nm\"))\n", "mid_cell_p_material = InGaAs(In=0.01, Na=siUnits(1e17, \"cm-3\"), electron_diffusion_length=si(\"5um\"))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "all_materials.append(mid_cell_n_material)\n", "all_materials.append(mid_cell_p_material)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "BOTTOM CELL - Ge
\n", "We add manually the absorption coefficient of Ge since the one contained in the database doesn't cover
\n", "enough range." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "Ge = material(\"Ge\")\n", "Ge_alpha = np.loadtxt(this_dir_file(\"Ge-Palik.csv\"), unpack=True, delimiter=\",\")\n", "Ge.alpha = interp1d(x=1240e-9 / Ge_alpha[0][::-1], y=Ge_alpha[1][::-1], bounds_error=False, fill_value=0)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "bot_cell_n_material = Ge(Nd=siUnits(2e18, \"cm-3\"), hole_diffusion_length=si(\"800nm\"))\n", "bot_cell_p_material = Ge(Na=siUnits(1e17, \"cm-3\"), electron_diffusion_length=si(\"50um\"))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "all_materials.append(bot_cell_n_material)\n", "all_materials.append(bot_cell_p_material)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We add some other properties to the materials, assumed the same in all cases, for simplicity.
\n", "If different, we should have added them above in the definition of the materials." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "for mat in all_materials:\n", " mat.hole_mobility = 5e-2\n", " mat.electron_mobility = 3.4e-3\n", " mat.hole_mobility = 3.4e-3\n", " mat.electron_mobility = 5e-2\n", " mat.relative_permittivity = 9" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "And, finally, we put everything together, adding also the surface recombination velocities. We also add some shading
\n", "due to the metallisation of the cell = 8%, and indicate it has an area of 0.7x0.7 mm2 (converted to m2)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "solar_cell = SolarCell(\n", " [\n", " Junction([Layer(si(\"25nm\"), material=window_material, role='window'),\n", " Layer(si(\"100nm\"), material=top_cell_n_material, role='emitter'),\n", " Layer(si(\"600nm\"), material=top_cell_p_material, role='base'),\n", " ], sn=1, sp=1, kind='DA'),\n", " Junction([Layer(si(\"200nm\"), material=mid_cell_n_material, role='emitter'),\n", " Layer(si(\"3000nm\"), material=mid_cell_p_material, role='base'),\n", " ], sn=1, sp=1, kind='DA'),\n", " # Uncomment the following to add the Ge junction. The calculation will be MUCH longer.\n", " # Junction([Layer(si(\"400nm\"), material=bot_cell_n_material, role='emitter'),\n", " # Layer(si(\"100um\"), material=bot_cell_p_material, role='base'),\n", " # ], sn=1, sp=1, kind='DA'),\n", " ], reflectivity=ref, shading=0.08, cell_area=0.7 * 0.7 / 1e4)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "wl = np.linspace(300, 1800, 700) * 1e-9\n", "solar_cell_solver(solar_cell, 'qe', user_options={'wavelength': wl})" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plt.figure(1)\n", "plt.plot(wl * 1e9, solar_cell[0].eqe(wl) * 100, 'b', label='GaInP')\n", "plt.plot(wl * 1e9, solar_cell[1].eqe(wl) * 100, 'g', label='InGaAs')\n", "# Uncomment to plot the Ge junction\n", "# plt.plot(wl * 1e9, solar_cell[2].eqe(wl) * 100, 'r', label='Ge')\n", "plt.legend()\n", "plt.ylim(0, 100)\n", "plt.ylabel('EQE (%)')\n", "plt.xlabel('Wavelength (nm)')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "V = np.linspace(0, 3, 300)\n", "solar_cell_solver(solar_cell, 'iv', user_options={'voltages': V, 'light_iv': True, 'wavelength': wl})" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plt.figure(2)\n", "plt.plot(V, solar_cell.iv['IV'][1], 'k', linewidth=3, label='Total')\n", "plt.plot(V, -solar_cell[0].iv(V), 'b', label='GaInP')\n", "plt.plot(V, -solar_cell[1].iv(V), 'g', label='InGaAs')\n", "# Uncomment to plot the Ge junction\n", "# plt.plot(V, -solar_cell[2].iv(V), 'r', label='Ge')\n", "plt.legend()\n", "plt.ylim(0, 200)\n", "plt.xlim(0, 3)\n", "plt.ylabel('Current (A/m$^2$)')\n", "plt.xlabel('Voltage (V)')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plt.show()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.4" } }, "nbformat": 4, "nbformat_minor": 4 }