8000 Add noct_sam cell temperature model to PVSystem, ModelChain by cwhanse · Pull Request #1195 · pvlib/pvlib-python · GitHub
[go: up one dir, main page]

Skip to content

Add noct_sam cell temperature model to PVSystem, ModelChain #1195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Mar 15, 2021
Merged
Prev Previous commit
Next Next commit
docstring reverts, raise if missing arg
  • Loading branch information
cwhanse committed Mar 14, 2021
commit 84a452c27302d44bf317af8b964393fa02992973
30 changes: 20 additions & 10 deletions pvlib/pvsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ def fuentes_celltemp(self, poa_global, temp_air, wind_speed):

Returns
-------
numeric or tuple of numeric
temperature_cell : Series or tuple of Series
The modeled cell temperature [C]

Notes
Expand Down Expand Up @@ -788,22 +788,22 @@ def noct_sam_celltemp(self, poa_global, temp_air, wind_speed,

Parameters
----------
poa_global : pandas Series or tuple of Series
Total incident irradiance [W/m^2]
poa_global : numeric or tuple of numeric
Total incident irradiance in W/m^2.

temp_air : pandas Series or tuple of Series
Ambient dry bulb temperature [C]
temp_air : numeric or tuple of numeric
Ambient dry bulb temperature in degrees C.

wind_speed : pandas Series or tuple of Series
Wind speed [m/s]
wind_speed : numeric or tuple of numeric
Wind speed in m/s at a height of 10 meters.

effective_irradiance : pandas Series, tuple of Series or None.
effective_irradiance : numeric, tuple of numeric or None.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
effective_irradiance : numeric, tuple of numeric or None.
effective_irradiance : numeric, tuple of numeric, or None.

The irradiance that is converted to photocurrent. If None,
assumed equal to ``poa_global``. [W/m^2]

Returns
-------
numeric or tuple of numeric
temperature_cell : numeric or tuple of numeric
The modeled cell temperature [C]

Notes
Expand All @@ -829,9 +829,19 @@ def noct_sam_celltemp(self, poa_global, temp_air, wind_speed,

def _build_kwargs_noct_sam(array):
temp_model_kwargs = _build_kwargs([
'noct', 'eta_m_ref', 'transmittance_absorptance',
'transmittance_absorptance',
'array_height', 'mount_standoff'],
array.temperature_model_parameters)
try:
temp_model_kwargs['noct'] = \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
temp_model_kwargs['noct'] = \
# noct_sam required args.
# bundled with kwargs for simplicity
temp_model_kwargs['noct'] = \

array.temperature_model_parameters['noct']
temp_model_kwargs['eta_m_ref'] = \
array.temperature_model_parameters['eta_m_ref']
except KeyError:
msg = ('Parameter noct and eta_m_ref are required.'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
msg = ('Parameter noct and eta_m_ref are required.'
msg = ('Parameters noct and eta_m_ref are required.'

' Found {} in temperature_model_parameters.'
.format(array.temperature_model_parameters))
raise KeyError(msg)
return temp_model_kwargs
return tuple(
temperature.noct_sam(
Expand Down
8 changes: 8 additions & 0 deletions pvlib/tests/test_pvsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,14 @@ def test_PVSystem_noct_celltemp(mocker):
assert_allclose(out, expected)


def test_PVSystem_noct_celltemp_error():
poa_global, temp_air, wind_speed, eta_m_ref = (1000., 25., 1., 0.2)
temp_model_params = {'eta_m_ref': eta_m_ref}
system = pvsystem.PVSystem(temperature_model_parameters=temp_model_params)
with pytest.raises(KeyError):
system.noct_sam_celltemp(poa_global, temp_air, wind_speed)


@pytest.mark.parametrize("celltemp",
[pvsystem.PVSystem.faiman_celltemp,
pvsystem.PVSystem.pvsyst_celltemp,
Expand Down
0