Skip to content

Commit

Permalink
Merge branch 'devel' into devel
Browse files Browse the repository at this point in the history
  • Loading branch information
dalonsoa authored Oct 11, 2019
2 parents 8a34681 + ee8c996 commit 3e403c7
Show file tree
Hide file tree
Showing 8 changed files with 714 additions and 18 deletions.
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
repos:
- repo: https://github.com/kynan/nbstripout
rev: master
hooks:
- id: nbstripout
files: ".ipynb"
2 changes: 1 addition & 1 deletion docs/source/Examples/example_3J_with_DA_solver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Example of a 2J solar cell calculated with the PDD solver
mat.electron_mobility = 3.4e-3
mat.hole_mobility = 3.4e-3
mat.electron_mobility = 5e-2
mat.permittivity = 9
mat.relative_permittivity = 9
# And, finally, we put everything together, adding also the surface recombination velocities. We also add some shading
# due to the metallisation of the cell = 8%, and indicate it has an area of 0.7x0.7 mm2 (converted to m2)
Expand Down
46 changes: 29 additions & 17 deletions examples/coherency_example_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ def this_dir_file(f): # this is just Python stuff, so it can find external file
top_cell_p_material = GaInP(In=0.51,Na=siUnits(1.5e17, "cm-3"), electron_diffusion_length=si("2um"))
top_cell_TJ_material = Al08Ga02As(Al=0.8)

#for mat in [top_cell_n_material, top_cell_p_material]:
#mat.band_gap = material('GaInP')(In=0.51).band_gap
#mat.eff_mass_hh_z = material('GaInP')(In=0.51).eff_mass_hh_z
#mat.eff_mass_electron = material('GaInP')(In=0.51).eff_mass_electron
#mat.permittivity = 11.75
for mat in [top_cell_n_material, top_cell_p_material]:
mat.band_gap = material('GaInP')(In=0.51).band_gap
mat.eff_mass_hh_z = material('GaInP')(In=0.51).eff_mass_hh_z
mat.eff_mass_electron = material('GaInP')(In=0.51).eff_mass_electron
mat.relative_permittivity = 11.75

all_materials.append(ARC1)
all_materials.append(ARC2)
Expand All @@ -59,11 +59,11 @@ def this_dir_file(f): # this is just Python stuff, so it can find external file
mid_BSF_material = GaInP(In=0.51)
mid_cell_TJ_material = Al08Ga02As(Al=0.8)

#for mat in [mid_cell_n_material, mid_cell_p_material]:
# mat.band_gap = material('GaAs')(In=0.01).band_gap
# mat.eff_mass_hh_z = material('GaAs')(In=0.01).eff_mass_hh_z
# mat.eff_mass_electron = material('GaAs')(In=0.01).eff_mass_electron
# mat.permittivity = 13.1
for mat in [mid_cell_n_material, mid_cell_p_material]:
mat.band_gap = material('GaAs')(In=0.01).band_gap
mat.eff_mass_hh_z = material('GaAs')(In=0.01).eff_mass_hh_z
mat.eff_mass_electron = material('GaAs')(In=0.01).eff_mass_electron
mat.relative_permittivity = 13.1

all_materials.append(mid_window_material)
all_materials.append(mid_cell_n_material)
Expand All @@ -84,11 +84,11 @@ def this_dir_file(f): # this is just Python stuff, so it can find external file
bot_cell_n_material = Ge(Nd=siUnits(2e18, "cm-3"), hole_diffusion_length=si("800nm"))
bot_cell_p_material = Ge(Na=siUnits(1e17, "cm-3"), electron_diffusion_length=si("50um"))

#for mat in [bot_cell_n_material, bot_cell_p_material]:
# mat.band_gap = material('Ge')().band_gap
# mat.eff_mass_hh_z = material('Ge')().eff_mass_hh_z
# mat.eff_mass_electron = material('Ge')().eff_mass_electron
# mat.permittivity = 16
for mat in [bot_cell_n_material, bot_cell_p_material]:
mat.band_gap = material('Ge')().band_gap
mat.eff_mass_hh_z = material('Ge')().eff_mass_hh_z
mat.eff_mass_electron = material('Ge')().eff_mass_electron
mat.relative_permittivity = 16

all_materials.append(bot_buffer_material)
all_materials.append(bot_nucleation_material)
Expand Down Expand Up @@ -144,9 +144,9 @@ def this_dir_file(f): # this is just Python stuff, so it can find external file
options.BL_correction = True
options.coherency_list = 111*['c']
options.theta = 30
solar_cell_solver(optical_struct, 'optics', options)
solar_cell_solver(optical_struct, 'qe', options)

plt.figure(3)
plt.figure()
plt.plot(wl*1e9, optical_struct[0].layer_absorption+optical_struct[1].layer_absorption)
plt.plot(wl*1e9, optical_struct[2].layer_absorption)
plt.plot(wl*1e9, optical_struct[3].layer_absorption)
Expand All @@ -156,6 +156,18 @@ def this_dir_file(f): # this is just Python stuff, so it can find external file
plt.plot(wl*1e9, optical_struct.reflected, '--')
plt.legend(['ARC', 'top', 'middle', 'bottom', 'A', 'T', 'R'])
plt.ylim(0,1)
plt.ylabel('Absorption/Transmission/Reflection')
plt.xlabel('Wavelength (nm)')
plt.show()

plt.figure()
plt.plot(wl*1e9, 100*optical_struct[2].eqe(wl))
plt.plot(wl*1e9, 100*optical_struct[3].eqe(wl))
plt.plot(wl*1e9, 100*optical_struct[100].eqe(wl))
plt.plot(wl*1e9, 100*optical_struct.absorbed, '--')
plt.legend(['top', 'middle', 'bottom', 'A'])
plt.ylim(0,100)
plt.ylabel('EQE (%)')
plt.xlabel('Wavelength (nm)')
plt.show()

Expand Down
190 changes: 190 additions & 0 deletions examples/notebooks/Absorption_profile_AlGaAs_GaAs_structure.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "Absorption_profile_AlGaAs_GaAs_structure.ipynb",
"provenance": []
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "-1Z1-d4C47YK",
"colab_type": "text"
},
"source": [
"# Absorption Profile AlGaAs GaAs Structure Example"
]
},
{
"cell_type": "code",
"metadata": {
"id": "9282DOR42thA",
"colab_type": "code",
"colab": {}
},
"source": [
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"from solcore.absorption_calculator import calculate_absorption_profile\n",
"from solcore import material, si\n",
"from solcore.structure import Structure, Layer"
],
"execution_count": 0,
"outputs": []
},
{
"cell_type": "markdown",
"metadata": {
"id": "U9-mFKNO22IZ",
"colab_type": "text"
},
"source": [
"First we defined a couple of materials, for example, GaAs and AlGAs"
]
},
{
"cell_type": "code",
"metadata": {
"id": "dHoZMpKB25ZY",
"colab_type": "code",
"colab": {}
},
"source": [
"GaAs = material('GaAs')(T=300)\n",
"AlGaAs = material('AlGaAs')(T=300, Al=0.3)"
],
"execution_count": 0,
"outputs": []
},
{
"cell_type": "markdown",
"metadata": {
"id": "qmA8l1ja272Y",
"colab_type": "text"
},
"source": [
"Now, let's build the structure"
]
},
{
"cell_type": "code",
"metadata": {
"id": "d5DpfgwH2-rp",
"colab_type": "code",
"colab": {}
},
"source": [
"my_structure = Structure([\n",
" Layer(si(30, 'nm'), material=AlGaAs),\n",
" Layer(si(3000, 'nm'), material=GaAs),\n",
" Layer(si(300, 'um'), material=GaAs),\n",
"])"
],
"execution_count": 0,
"outputs": []
},
{
"cell_type": "markdown",
"metadata": {
"id": "q-p7bGCM3BAJ",
"colab_type": "text"
},
"source": [
"We want to calculate the absorption profile of this structure as a function of the position and wavelength"
]
},
{
"cell_type": "code",
"metadata": {
"id": "ihObNLeu3C4p",
"colab_type": "code",
"colab": {}
},
"source": [
"wl = np.linspace(400, 1000, 200)\n",
"out = calculate_absorption_profile(my_structure, wl, steps_size=1, z_limit=3000)"
],
"execution_count": 0,
"outputs": []
},
{
"cell_type": "markdown",
"metadata": {
"id": "rq_rk3S13Enp",
"colab_type": "text"
},
"source": [
"Finally, we plot the absorption profile. Note that absorption at short wavelengths take place near the surface of the structure, in the AlGaAs layer and top of the GaAs layer, while longer wavelengths penetrate more. Wavelengths beyond the GaAs band edge are not absorbed."
]
},
{
"cell_type": "code",
"metadata": {
"id": "WAfmwPn_3dYh",
"colab_type": "code",
"colab": {}
},
"source": [
"plt.figure(1)\n",
"ax = plt.contourf(out['position'], wl, out['absorption'], 200)\n",
"plt.xlabel('Position (nm)')\n",
"plt.ylabel('Wavelength (nm)')\n",
"cbar = plt.colorbar()\n",
"cbar.set_label('Absorption (1/nm)')"
],
"execution_count": 0,
"outputs": []
},
{
"cell_type": "markdown",
"metadata": {
"id": "ta2lqN483fQI",
"colab_type": "text"
},
"source": [
"We can also check what is the overall light absorption in the AlGaAs and GaAs epilayers as that represents the total light absorption in our solar cell and therefore the maximum EQE (light absorbed in the thick substrate lost). The absorption is mostly limited by the reflexion in the front surface. Clearly, this solar cell needs an AR coating."
]
},
{
"cell_type": "code",
"metadata": {
"id": "MFBsE2UG2SLc",
"colab_type": "code",
"colab": {}
},
"source": [
"A = np.zeros_like(wl)\n",
"\n",
"for i, absorption in enumerate(out['absorption'][:]):\n",
" A[i] = np.trapz(absorption, out['position'])"
],
"execution_count": 0,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "zGdyOW4H3oig",
"colab_type": "code",
"colab": {}
},
"source": [
"plt.figure(2)\n",
"plt.plot(wl, A)\n",
"plt.xlabel('Wavelength (nm)')\n",
"plt.ylabel('Absorption')\n",
"\n",
"plt.show()"
],
"execution_count": 0,
"outputs": []
}
]
}
Loading

0 comments on commit 3e403c7

Please sign in to comment.