8000 Temperature model parameter translation code by adriesse · Pull Request #1463 · pvlib/pvlib-python · GitHub
[go: up one dir, main page]

Skip to content

Temperature model parameter translation code #1463

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 17 commits into from
Sep 13, 2022
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
Prev Previous commit
Next Next commit
Docstrings complete.
  • Loading branch information
adriesse committed Sep 1, 2022
commit 12009c5f52dfc706536053da04326e91a7ba767f
44 changes: 21 additions & 23 deletions pvlib/temperature.py
Original file line number Diff line number Diff line change
Expand Up @@ -1008,10 +1008,10 @@ def generic_linear(poa_global, temp_air, wind_speed, u_const, du_wind,
[(W/m^2)/C/(m/s)]

module_efficiency : float
The electrical efficiency of the module. [pu]
The electrical efficiency of the module. [-]

absorptance : float
The light absorptance of the module. [pu]
The light absorptance of the module. [-]

Returns
-------
Expand All @@ -1020,14 +1020,15 @@ def generic_linear(poa_global, temp_air, wind_speed, u_const, du_wind,
References
----------
.. [1] A. Driesse et al, "PV Module Operating Temperature
Model Equivalence and Parameter Translation". 2022 IEEE
Model Equivalence and Parameter Translation". 2022 IEEE
Photovoltaic Specialists Conference (PVSC), 2022.

See also
--------
pvlib.temperature.GenericLinearModel
"""
# Contributed by Anton Driesse (@adriesse), PV Performance Labs, Sept. 2022

heat_input = poa_global * (absorptance - module_efficiency)
total_loss_factor = u_const + du_wind * wind_speed
temp_difference = heat_input / total_loss_factor
Expand All @@ -1048,7 +1049,7 @@ class GenericLinearModel():
model functions in pvlib.temperature.

An instance of the class represents a specific module type, therefore,
the module properties efficiency and absorptance must be provided.
the module properties *efficiency* and *absorptance* must be provided.
Although some temperature models do not use these properties, they
nevertheless exist and affect operating temperature.

Expand All @@ -1059,25 +1060,30 @@ class GenericLinearModel():
occuring during those measurements.

When used for time series simulation, efficiency and absorptance may
vary, and each emperical model handles this differently.
vary, and each empirical model handles this differently.

Parameters
----------
module_efficiency : float
The electrical efficiency of the module. [pu]
The electrical efficiency of the module. [-]

absorptance : float
The light absorptance of the module. [pu]
The light absorptance of the module. [-]

Notes
-----
After creating a GenericLinearModel object using the module properties,
one of the use_* methods must be called to provide thermal model
parameters.

References
----------
.. [1] A. Driesse et al, "PV Module Operating Temperature
Model Equivalence and Parameter Translation". 2022 IEEE
Photovoltaic Specialists Conference (PVSC), 2022.

Examples
--------

glm = GenericLinearModel(module_efficiency=0.19, absorptance=0.88)

glm.use_faiman(16, 8)
Expand All @@ -1088,12 +1094,6 @@ class GenericLinearModel():

pvsyst_cell(800, 20, 1, **parmdict)

References
----------
.. [1] A. Driesse et al, "PV Module Operating Temperature
Model Equivalence and Parameter Translation". 2022 IEEE
Photovoltaic Specialists Conference (PVSC), 2022.

See also
--------
pvlib.temperature.generic_linear
Expand Down Expand Up @@ -1152,14 +1152,18 @@ def __call__(self, poa_global, temp_air, wind_speed,

return temp_air + temp_difference

def get_generic(self):
def use_generic_linear(self):
'''
Get the generic linea model parameters to use with the separate
Get the generic linear model parameters to use with the separate
generic linear module temperature calculation function.

Returns:
--------
dict containg generic linear model parameters
model_parameters : dict

See also
--------
pvlib.temperature.generic_linear
'''
return dict(u_const=self.u_const,
du_wind=self.du_wind,
Expand Down Expand Up @@ -1356,12 +1360,6 @@ def to_sapm(self, wind_fit_low=1.4, wind_fit_high=5.4):
model_parameters : dict
See :py:func:`pvlib.temperature.sapm_module` for
model parameter details.

Notes
-----
The SAPM model will equal the generic model at the two
given 10m wind speed values, and approximately equal at
other wind speeds.
'''
net_absorptance = self.alpha - self.eta
u_const = self.u_const / net_absorptance
Expand Down
2 changes: 1 addition & 1 deletion pvlib/tests/test_temperature.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ def test_glm_simulations():
out = glm(*weather, module_efficiency=0.1)
assert np.allclose(out, expected)

inp = glm.get_generic()
inp = glm.use_generic_linear()
out = temperature.generic_linear(*weather, **inp)
assert np.allclose(out, expected)

Expand Down
0