Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion pvlib/pvsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,11 +628,24 @@ def fuentes_celltemp(self, poa_global, temp_air, wind_speed):
-------
temperature_cell : pandas Series
The modeled cell temperature [C]

Notes
-----
The Fuentes thermal model uses the module surface tilt for convection
modeling. The SAM implementation of PVWatts hardcodes the value at 30
degrees, ignoring whatever value is used for irradiance transposition.
This method defaults to using ``self.surface_tilt``, but if
you want to match the PVWatts behavior, you can override it by
including a ``surface_tilt`` value in ``temperature_model_parameters``.
"""
kwargs = _build_kwargs([
# default to using the PVSystem attribute, but allow user to
# override with a custom surface_tilt value
kwargs = {'surface_tilt': self.surface_tilt}
temp_model_kwargs = _build_kwargs([
'noct_installed', 'module_height', 'wind_height', 'emissivity',
'absorption', 'surface_tilt', 'module_width', 'module_length'],
Copy link
Member

Choose a reason for hiding this comment

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

I think 'surface_tilt' is a PVSystem attribute, not to be found in temperature_model_parameters

We might also consider getting 'module_width' and 'module_length' from module_parameters, although: the database doesn't supply these values and they aren't used anywhere else. 'module_height' is really an attribute of the PV System.

For now, I'm OK expecting the 'module_' values in temperature_model_parameters but they will move once another, non-temperature function needs this information - e.g., a bifacial irradiance function.

Copy link
Member Author

Choose a reason for hiding this comment

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

Valid points. I unthinkingly pulled all the extra parameters from temperature.fuentes and dumped them there.

I can imagine some people objecting to using Fuentes with the real surface_tilt value because they want the same behavior as the SSC implementation of PVWatts, which hardcodes the tilt at 30. Would it make sense to use the PVSystem attributes by default but allow the user to override them by providing alternate values in the temperature_model_parameters dictionary?

Copy link
Member

@cwhanse cwhanse Oct 1, 2020

Choose a reason for hiding this comment

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

I don't have a better idea at the moment, than using temperature_model_parameters['surface_tilt'] as the signal to override. But I think it risks confusing users, to have two 'surface_tilt' quantities with different meanings. Maybe a Note in the PVSystem.celltemp_fuentes docstring and move ahead.

Copy link
Member

Choose a reason for hiding this comment

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

Also something to consider when creating an Array class.

self.temperature_model_parameters)
kwargs.update(temp_model_kwargs)
return temperature.fuentes(poa_global, temp_air, wind_speed,
**kwargs)

Expand Down
28 changes: 27 additions & 1 deletion pvlib/tests/test_pvsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,10 +374,36 @@ def test_PVSystem_fuentes_celltemp(mocker):
assert_series_equal(spy.call_args[0][1], temps)
assert_series_equal(spy.call_args[0][2], winds)
assert spy.call_args[1]['noct_installed'] == noct_installed
assert_series_equal(out, pd.Series([51.85, 55.85, 55.85], index,
assert_series_equal(out, pd.Series([52.85, 55.85, 55.85], index,
name='tmod'))


def test_PVSystem_fuentes_celltemp_override(mocker):
# test that the surface_tilt value in the cell temp calculation can be
# overridden but defaults to the surface_tilt attribute of the PVSystem
spy = mocker.spy(temperature, 'fuentes')

noct_installed = 45
index = pd.date_range('2019-01-01 11:00', freq='h', periods=3)
temps = pd.Series(25, index)
irrads = pd.Series(1000, index)
winds = pd.Series(1, index)

# uses default value
temp_model_params = {'noct_installed': noct_installed}
system = pvsystem.PVSystem(temperature_model_parameters=temp_model_params,
surface_tilt=20)
system.fuentes_celltemp(irrads, temps, winds)
assert spy.call_args[1]['surface_tilt'] == 20

# can be overridden
temp_model_params = {'noct_installed': noct_installed, 'surface_tilt': 30}
system = pvsystem.PVSystem(temperature_model_parameters=temp_model_params,
surface_tilt=20)
system.fuentes_celltemp(irrads, temps, winds)
assert spy.call_args[1]['surface_tilt'] == 30


def test__infer_temperature_model_params():
system = pvsystem.PVSystem(module_parameters={},
racking_model='open_rack',
Expand Down