Skip to content

Commit 4b0df1b

Browse files
committed
implementing pvsyst recombination loss current for CdTe and a:Si
* closes pvlib#163 * add constant VOLTAGE_BUILTIN = 0.9 (V) to singlediode_methods.py * add arguments d2mutau=0, voltage_builtin=VOLTAGE_BUILTIN, and cells_in_series to calculate i_recomb and v_recomb * add check for d2mutau to calc i_recomb, v_recomb, and gradients * add terms to current and gradients
1 parent 2498040 commit 4b0df1b

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

pvlib/singlediode_methods.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
# rename newton and set keyword arguments
2323
newton = partial(_array_newton, tol=1e-6, maxiter=100, fprime2=None)
2424

25+
VOLTAGE_BUILTIN = 0.9 # (V) intrinsic voltage for a:Si, CdTe, Mertens et al.
26+
2527

2628
def estimate_voc(photocurrent, saturation_current, nNsVth):
2729
"""
@@ -62,7 +64,9 @@ def estimate_voc(photocurrent, saturation_current, nNsVth):
6264

6365

6466
def bishop88(diode_voltage, photocurrent, saturation_current,
65-
resistance_series, resistance_shunt, nNsVth, gradients=False):
67+
resistance_series, resistance_shunt, nNsVth, d2mutau=0,
68+
cells_in_series=None, voltage_builtin=VOLTAGE_BUILTIN,
69+
gradients=False):
6670
"""
6771
Explicit calculation of points on the IV curve described by the single
6872
diode equation [1].
@@ -97,21 +101,28 @@ def bishop88(diode_voltage, photocurrent, saturation_current,
97101
:math:`\\frac{dI}{dV}`, :math:`\\frac{dP}{dV}`, and
98102
:math:`\\frac{d^2 P}{dV dV_d}`
99103
"""
104+
# check if need to calculate recombination loss current
105+
i_recomb = v_recomb = 0
106+
if d2mutau > 0:
107+
v_recomb = voltage_builtin - diode_voltage / cells_in_series
108+
i_recomb = photocurrent * d2mutau / v_recomb
100109
# calculate temporary values to simplify calculations
101110
v_star = diode_voltage / nNsVth # non-dimensional diode voltage
102111
g_sh = 1.0 / resistance_shunt # conductance
103112
i = (photocurrent - saturation_current * np.expm1(v_star)
104-
- diode_voltage * g_sh)
113+
- diode_voltage * g_sh - i_recomb)
105114
v = diode_voltage - i * resistance_series
106115
retval = (i, v, i*v)
107116
if gradients:
117+
if d2mutau > 0:
118+
grad_i_recomb = i_recomb/v_recomb
108119
g_diode = saturation_current * np.exp(v_star) / nNsVth # conductance
109-
grad_i = -g_diode - g_sh # di/dvd
120+
grad_i = -g_diode - g_sh - grad_i_recomb # di/dvd
110121
grad_v = 1.0 - grad_i * resistance_series # dv/dvd
111122
# dp/dv = d(iv)/dv = v * di/dv + i
112123
grad = grad_i / grad_v # di/dv
113124
grad_p = v * grad + i # dp/dv
114-
grad2i = -g_diode / nNsVth # d2i/dvd
125+
grad2i = -g_diode / nNsVth - 2*grad_i_recomb/v_recomb # d2i/dvd
115126
grad2v = -grad2i * resistance_series # d2v/dvd
116127
grad2p = (
117128
grad_v * grad + v * (grad2i/grad_v - grad_i*grad2v/grad_v**2)

0 commit comments

Comments
 (0)