Exemple #1
0
from solcore.structure import Layer, Junction, TunnelJunction
from solcore.absorption_calculator import calculate_rat_rcwa, calculate_absorption_profile_rcwa

import numpy as np
import types
from solcore.state import State

rcwa_options = State()
rcwa_options.size = [500, 500]
rcwa_options.orders = 4
rcwa_options.theta = 0
rcwa_options.phi = 0
rcwa_options.pol = 'u'


def solve_rcwa(solar_cell, options):
    """ Calculates the reflection, transmission and absorption of a solar cell object using the transfer matrix method

    :param solar_cell:
    :param options:
    :return:
    """
    wl = options.wavelength

    # We include the shadowing losses
    initial = (1 - solar_cell.shading) if hasattr(solar_cell, 'shading') else 1

    # Now we calculate the absorbed and transmitted light. We first get all the relevant parameters from the objects
    widths = []
    offset = 0
    all_layers = []
# And, finally, we put everything together, adding also the surface recombination velocities sn and sp.
# setting kind = 'DA' in the Junction definition tells the electrical solver later to use the depletion approximation
optical_struct = SolarCell(ARC + top_junction + middle_junction + DBRa + DBRb +
                           DBRc + bottom_junction,
                           shading=0.05)

wl = np.linspace(250, 1700, 400) * 1e-9

options = State()
options.wavelength = wl
options.optics_method = 'TMM'
options.no_back_reflection = False
options.pol = 'p'
options.BL_correction = True
options.coherency_list = 111 * ['c']
options.theta = 30
solar_cell_solver(optical_struct, 'qe', options)

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)
plt.plot(wl * 1e9, optical_struct[100].layer_absorption)
plt.plot(wl * 1e9, optical_struct.absorbed, '--')
plt.plot(wl * 1e9, optical_struct.transmitted, '--')
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')