Skip to content

Commit 21157e2

Browse files
committed
ENH: replace voltage_builtin with NsVbi and remove cells_in_series
* related to pvlib#516, the use of cells_in_series here is problematic * to calculate arrays of different cells or modules with different parameters we use np.where(is_recomb, ..., ...) 3d0deb2 but what should cells_in_series be if d2mutau is zero? doesn't make physical sense for it to be zero, but None doesn't work with numbers * remove cells_in_series arg from bishop88 * remove last warning about setting cells_in_series correctly, move it to Notes, but worded differently in the context of setting NsVbi * replace voltage_builtin with NsVbi, default to np.inf * fix docstring parameter descriptions
1 parent 8a1efcb commit 21157e2

File tree

2 files changed

+20
-27
lines changed

2 files changed

+20
-27
lines changed

pvlib/singlediode_methods.py

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

26-
VOLTAGE_BUILTIN = 0.9 # (V) intrinsic voltage for a:Si, CdTe, Mertens et al.
26+
# intrinsic voltage per cell junction for a:Si, CdTe, Mertens et al.
27+
VOLTAGE_BUILTIN = 0.9 # [V]
2728

2829

2930
def estimate_voc(photocurrent, saturation_current, nNsVth):
@@ -65,9 +66,8 @@ def estimate_voc(photocurrent, saturation_current, nNsVth):
6566

6667

6768
def bishop88(diode_voltage, photocurrent, saturation_current,
68-
resistance_series, resistance_shunt, nNsVth, cells_in_series=None,
69-
d2mutau=0, voltage_builtin=VOLTAGE_BUILTIN,
70-
gradients=False):
69+
resistance_series, resistance_shunt, nNsVth, d2mutau=0,
70+
NsVbi=np.Inf, gradients=False):
7171
"""
7272
Explicit calculation of points on the IV curve described by the single
7373
diode equation [1]_.
@@ -76,9 +76,6 @@ def bishop88(diode_voltage, photocurrent, saturation_current,
7676
* Do not use ``d2mutau`` with CEC coefficients.
7777
* Usage of ``d2mutau`` with PVSyst coefficients is required for cadmium-
7878
telluride (CdTe) and amorphous-silicon (a:Si) PV modules only.
79-
* For PVSyst CdTe and a:Si modules, the ``cells_in_series`` parameter
80-
must only account for a single parallel sub-string if the module has
81-
cells in parallel greater than 1.
8279
8380
Parameters
8481
----------
@@ -95,18 +92,14 @@ def bishop88(diode_voltage, photocurrent, saturation_current,
9592
nNsVth : numeric
9693
product of thermal voltage ``Vth`` [V], diode ideality factor ``n``,
9794
and number of series cells ``Ns``
98-
cells_in_series : None or int
99-
number of cells in series per parallel module sub-string, only required
100-
for PVSyst thin-film recombination loss, if unset default is ``None``
101-
which raises ``TypeError`` if ``d2mutau`` is set.
10295
d2mutau : numeric
10396
PVSyst thin-film recombination parameter that is the ratio of thickness
104-
of the intrinsic thin-film layer squared :math:`d^2` and the diffusion
105-
length of charge carriers :math:`\\mu \\tau`, in volts [V], defaults to
106-
0[V]
107-
voltage_builtin : numeric
108-
PVSyst thin-film recombination parameter that is the builtin voltage of
109-
the intrinsic thin-film layer, in volts [V], defaults to 0.9[V]
97+
of the intrinsic layer squared :math:`d^2` and the diffusion length of
98+
charge carriers :math:`\\mu \\tau`, in volts [V], defaults to 0[V]
99+
NsVbi : numeric
100+
PVSyst thin-film recombination parameter that is the product of the PV
101+
module number of series cells ``Ns`` and the builtin voltage ``Vbi`` of
102+
the intrinsic layer, in volts [V], defaults to ``np.inf``
110103
gradients : bool
111104
False returns only I, V, and P. True also returns gradients
112105
@@ -121,11 +114,13 @@ def bishop88(diode_voltage, photocurrent, saturation_current,
121114
Notes
122115
-----
123116
The PVSyst thin-film recombination losses parameters ``d2mutau`` and
124-
``voltage_builtin`` are only applied to cadmium-telluride (CdTe) and
125-
amorphous-silicon (a:Si) PV modules, [2]_, [3]_. The builtin voltage should
126-
account for all junctions. For example: tandem and triple junction cell
127-
would have builtin voltages of 1.8[V] and 2.7[V] respectively, based on the
128-
default of 0.9[V] for a single junction.
117+
``NsVbi`` are only applied to cadmium-telluride (CdTe) and amorphous-
118+
silicon (a:Si) PV modules, [2]_, [3]_. The builtin voltage :math:`V_{bi}`
119+
should account for all junctions. For example: tandem and triple junction
120+
cells would have builtin voltages of 1.8[V] and 2.7[V] respectively, based
121+
on the default of 0.9[V] for a single junction. The parameter ``NsVbi``
122+
should only account for the number of series cells in a single parallel
123+
sub-string if the module has cells in parallel greater than 1.
129124
130125
References
131126
----------
@@ -145,9 +140,7 @@ def bishop88(diode_voltage, photocurrent, saturation_current,
145140
"""
146141
# calculate recombination loss current where d2mutau > 0
147142
is_recomb = d2mutau > 0 # True where there is thin-film recombination loss
148-
v_recomb = np.where(is_recomb,
149-
voltage_builtin * cells_in_series - diode_voltage,
150-
np.inf)
143+
v_recomb = np.where(is_recomb, NsVbi - diode_voltage, np.inf)
151144
i_recomb = np.where(is_recomb, photocurrent * d2mutau / v_recomb, 0)
152145
# calculate temporary values to simplify calculations
153146
v_star = diode_voltage / nNsVth # non-dimensional diode voltage

pvlib/test/test_singlediode_methods.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import numpy as np
66
from pvlib import pvsystem
7-
from pvlib.singlediode_methods import bishop88, estimate_voc
7+
from pvlib.singlediode_methods import bishop88, estimate_voc, VOLTAGE_BUILTIN
88
import pytest
99
from conftest import requires_scipy
1010

@@ -189,7 +189,7 @@ def test_pvsyst_recombination_loss(pvsyst_fs_495, poa, temp_cell, expected,
189189
saturation_current=io_pvsyst, resistance_series=rs_pvsyst,
190190
resistance_shunt=rsh_pvsyst, nNsVth=nnsvt_pvsyst,
191191
d2mutau=pvsyst_fs_495['d2mutau'],
192-
cells_in_series=pvsyst_fs_495['cells_in_series']
192+
NsVbi=VOLTAGE_BUILTIN*pvsyst_fs_495['cells_in_series']
193193
)
194194
# test max power
195195
assert np.isclose(max(pvsyst[2]), expected['pmp'], *tol)

0 commit comments

Comments
 (0)