-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Adds faiman_rad and ross models to get_cell_temperature(). #2631
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
base: main
Are you sure you want to change the base?
Changes from all commits
4143e2a
70bb948
acc43b4
69c7f43
5998725
61e8163
22f94a7
aaa52e3
c6d8ab9
78eb4c3
402b53c
9461e01
9035066
6f5bc0d
a536cb2
bc62578
7612e56
534e2f6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -414,7 +414,7 @@ def get_iam(self, aoi, iam_model='physical'): | |
|
|
||
| @_unwrap_single_value | ||
| def get_cell_temperature(self, poa_global, temp_air, wind_speed, model, | ||
| effective_irradiance=None): | ||
| effective_irradiance=None, ir_down=None): | ||
| """ | ||
| Determine cell temperature using the method specified by ``model``. | ||
|
|
||
|
|
@@ -431,12 +431,17 @@ def get_cell_temperature(self, poa_global, temp_air, wind_speed, model, | |
|
|
||
| model : str | ||
| Supported models include ``'sapm'``, ``'pvsyst'``, | ||
| ``'faiman'``, ``'fuentes'``, and ``'noct_sam'`` | ||
| ``'faiman'``, ``'faiman_rad'``, ``'fuentes'``, ``'noct_sam'``, | ||
| and ``'ross'`` | ||
|
|
||
| effective_irradiance : numeric or tuple of numeric, optional | ||
| The irradiance that is converted to photocurrent in W/m^2. | ||
| Only used for some models. | ||
|
|
||
| ir_down: numeric, optional | ||
| Downwelling infrared radiation from the sky, measured on a | ||
| horizontal surface in W/m^2. Only used in ``'faiman_rad'`` model. | ||
|
|
||
| Returns | ||
| ------- | ||
| numeric or tuple of numeric | ||
|
|
@@ -459,14 +464,16 @@ def get_cell_temperature(self, poa_global, temp_air, wind_speed, model, | |
| # Not used for all models, but Array.get_cell_temperature handles it | ||
| effective_irradiance = self._validate_per_array(effective_irradiance, | ||
| system_wide=True) | ||
| ir_down = self._validate_per_array(ir_down, system_wide=True) | ||
|
|
||
| return tuple( | ||
| array.get_cell_temperature(poa_global, temp_air, wind_speed, | ||
| model, effective_irradiance) | ||
| for array, poa_global, temp_air, wind_speed, effective_irradiance | ||
| model, effective_irradiance, ir_down) | ||
| for array, poa_global, temp_air, wind_speed, effective_irradiance, | ||
| ir_down | ||
| in zip( | ||
| self.arrays, poa_global, temp_air, wind_speed, | ||
| effective_irradiance | ||
| effective_irradiance, ir_down | ||
| ) | ||
| ) | ||
|
|
||
|
|
@@ -1204,7 +1211,7 @@ def get_iam(self, aoi, iam_model='physical'): | |
| raise ValueError(model + ' is not a valid IAM model') | ||
|
|
||
| def get_cell_temperature(self, poa_global, temp_air, wind_speed, model, | ||
| effective_irradiance=None): | ||
| effective_irradiance=None, ir_down=None): | ||
| """ | ||
| Determine cell temperature using the method specified by ``model``. | ||
|
|
||
|
|
@@ -1217,16 +1224,21 @@ def get_cell_temperature(self, poa_global, temp_air, wind_speed, model, | |
| Ambient dry bulb temperature [C] | ||
|
|
||
| wind_speed : numeric | ||
| Wind speed [m/s] | ||
| Wind speed [m/s], although can be ``None`` for ``'ross'`` model | ||
|
|
||
| model : str | ||
| Supported models include ``'sapm'``, ``'pvsyst'``, | ||
| ``'faiman'``, ``'fuentes'``, and ``'noct_sam'`` | ||
| ``'faiman'``, ``'faiman_rad'``, ``'fuentes'``, ``'noct_sam'``, | ||
| and ``'ross'`` | ||
|
|
||
| effective_irradiance : numeric, optional | ||
| The irradiance that is converted to photocurrent in W/m^2. | ||
| Only used for some models. | ||
|
|
||
| ir_down: numeric, optional | ||
| Downwelling infrared radiation from the sky, measured on a | ||
| horizontal surface in W/m^2. Only used in ``'faiman_rad'`` model. | ||
|
|
||
| Returns | ||
| ------- | ||
| numeric | ||
|
|
@@ -1235,8 +1247,9 @@ def get_cell_temperature(self, poa_global, temp_air, wind_speed, model, | |
| See Also | ||
| -------- | ||
| pvlib.temperature.sapm_cell, pvlib.temperature.pvsyst_cell, | ||
| pvlib.temperature.faiman, pvlib.temperature.fuentes, | ||
| pvlib.temperature.noct_sam | ||
| pvlib.temperature.faiman, pvlib.temperature.faiman_rad, | ||
| pvlib.temperature.fuentes, pvlib.temperature.noct_sam, | ||
| pvlib.temperature.ross | ||
|
|
||
| Notes | ||
| ----- | ||
|
|
@@ -1267,6 +1280,13 @@ def get_cell_temperature(self, poa_global, temp_air, wind_speed, model, | |
| required = tuple() | ||
| optional = _build_kwargs(['u0', 'u1'], | ||
| self.temperature_model_parameters) | ||
| elif model == 'faiman_rad': | ||
| func = functools.partial(temperature.faiman_rad, | ||
| ir_down=ir_down) | ||
| required = () | ||
| optional = _build_kwargs(['ir_down', 'u0', 'u1', | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're totally right. Already handled this in my latest commits. Thanks! |
||
| 'sky_view', 'emissivity'], | ||
| self.temperature_model_parameters) | ||
| elif model == 'fuentes': | ||
| func = temperature.fuentes | ||
| required = _build_tcell_args(['noct_installed']) | ||
|
|
@@ -1283,11 +1303,21 @@ def get_cell_temperature(self, poa_global, temp_air, wind_speed, model, | |
| optional = _build_kwargs(['transmittance_absorptance', | ||
| 'array_height', 'mount_standoff'], | ||
| self.temperature_model_parameters) | ||
| elif model == 'ross': | ||
| func = temperature.ross | ||
| required = () | ||
| # either noct or k must be defined | ||
| optional = _build_kwargs(['noct', 'k'], | ||
| self.temperature_model_parameters) | ||
| else: | ||
| raise ValueError(f'{model} is not a valid cell temperature model') | ||
|
|
||
| temperature_cell = func(poa_global, temp_air, wind_speed, | ||
| *required, **optional) | ||
| if model == 'ross': | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Although wind speed was kept as an input requested by
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @cwhanse @echedey-ls this and the
|
||
| temperature_cell = func(poa_global, temp_air, | ||
| *required, **optional) | ||
| else: | ||
| temperature_cell = func(poa_global, temp_air, wind_speed, | ||
| *required, **optional) | ||
| return temperature_cell | ||
|
|
||
| def dc_ohms_from_percent(self): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add this to the corresponding
PVSystemdescription too?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you mean within the function below?
@_unwrap_single_valuedef get_cell_temperature(...)