danieljfarrell / pvtrace

Optical ray tracing for luminescent materials and spectral converter photovoltaic devices
Other
97 stars 94 forks source link

Mismatch between simulation and thermodynamic efficiency? #36

Closed jaydeshpande closed 3 years ago

jaydeshpande commented 3 years ago

Hi!

This is exactly the kind of software library I was looking for to solve some LSC problems.

I tried to run a validation study based off of your template code with:https://core.ac.uk/download/pdf/76989828.pdf (which I think may have come out of your previous research lab!)

x = np.arange(400, 801, dtype=np.float)
size = (l, w, d) = (4.8, 1.8, 0.260)  # cm-1
lsc = LSC(size, wavelength_range=x, n1=1.49)

lsc.add_luminophore(
    'Fluro Red',
    np.column_stack((x, fluro_red.absorption(x) * 11.387815)),  # cm-1
    np.column_stack((x, fluro_red.emission(x))),
    quantum_yield=0.95
)

lsc.add_absorber(
    'PMMA',
    0.02 # cm-1
)

def lamp_spectrum(x):
    """ Fit to an experimentally measured lamp spectrum with long wavelength filter.
    """
    def g(x, a, p, w):
        return a * np.exp(-(((p - x) / w)**2 ))
    a1 = 0.53025700136646192
    p1 = 512.91400020614333
    w1 = 93.491838802960473
    a2 = 0.63578999789955015
    p2 = 577.63100003089369
    w2 = 66.031706473985736
    return g(x, a1, p1, w1) + g(x, a2, p2, w2)

lamp_dist = Distribution(x, lamp_spectrum(x))
wavelength_callable = lambda : lamp_dist.sample(np.random.uniform())
position_callable = lambda : rectangular_mask(l/2, w/2)
lsc.add_light(
    "Oriel Lamp + Filter",
    (0.0, 0.0, 0.5 * d + 0.2),  # put close to top surface
    rotation=(np.radians(180), (1, 0, 0)),  # normal and into the top surface
    wavelength=wavelength_callable,  # wavelength delegate callable
    position=position_callable  # uniform surface illumination
)

lsc.add_solar_cell({'left', 'right', 'near', 'far'})
#lsc.show()
throw = 1500
lsc.simulate(throw, emit_method='full')
lsc.report()
lsc.counts()[['Solar Out', 'Luminescent Out']].sum(axis=1)/ lsc.counts()[['Solar Out', 'Luminescent Out']].sum().sum()
output:
left      0.061618
right     0.074981
near      0.068300
far       0.074239
top       0.155160
bottom    0.565702

The values are slightly different than reported in the thesis. 6% higher on bottom surface. Any pointers on what may have gone wrong? Is it the lamp spectrum?

jaydeshpande commented 3 years ago

I varied the photo counts - the output is not much different for higher number of rays.

jaydeshpande commented 3 years ago

Closing this. Found my mistake!

danieljfarrell commented 3 years ago

Hi!

I’m catching up on issues after a week away.

Glad you are finding the project useful and keen enough to look at this level of detail, thank you!

We did an internal comparison between different codes a few years ago. I have the results of that, but they were not published. They might be included in the thesis you referenced above.

What pages in the thesis contains the comparison you are using? Answered in issue #37

I will compare that against the results I have been using and see if it is the same.

To anyone reading this in the near future: this pvtrace code above only works with a development version of pvtrace which is currently unreleased.