-
Notifications
You must be signed in to change notification settings - Fork 1.1k
stream_temperature_function #2104
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
stream_temperature_function #2104
Conversation
This function was not tested for very low mean daily ambient temperatures. Thus, if air temperatures lower than -6.6 degC are provided, the water temperature from this function will be negative. This can be true in some cases (e.g. if there is supercooling), but under normal conditions, it is not possible. So the question is: Should we limit the water surface temperature to 0 or return np.nan when low ambient air temperatures are used? I implemented the latter since I felt it was more in line with the paper. |
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.
I can't access the paper so this is a bit of a blind review, but here are some initial ideas.
As always, feel free to make (or not) the changes with your own style.
Thanks @echedey-ls and @AdamRJensen for all the help with the Is there a way to use |
Looks good so far @IoannisSifnaios |
Co-authored-by: Cliff Hansen <[email protected]>
Co-authored-by: Cliff Hansen <[email protected]>
Co-authored-by: Cliff Hansen <[email protected]>
Co-authored-by: Cliff Hansen <[email protected]>
Co-authored-by: Cliff Hansen <[email protected]>
Perhaps it is worth noting this in the function's docstring? |
Thinking about this again, it seems unlikely that floating PV will be built on the type of water body modeled here, so are we encouraging the possible misuse for other types of bodies of water? I would suspect that a more suitable model for lakes and larger bodies exists somewhere. |
Co-authored-by: Anton Driesse <[email protected]>
Co-authored-by: Adam R. Jensen <[email protected]>
Co-authored-by: RDaxini <[email protected]> Co-authored-by: Anton Driesse <[email protected]>
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.
I can't access the paper, but this proposal looks perfectly fine. Nice job!
Non-blocking comments down below.
@adriesse I also thought about this (and asked some oceanography researchers regarding models for sea temperature), but there are no simple models that can estimate the sea surface temperature, which I think is the reason why people used this model in the first place (although it might not be very appropriate). Thus, since we have mentioned the limitations of the model very explicitly, I still think it makes sense to add it in lack of a more appropriate model. Hopefully, in the future, some simple model might be developed, and then it could be directly compared to this one in order to estimate how "off" the results are... |
Co-authored-by: Echedey Luis <[email protected]>
I haven't read these papers, but it sounds pretty questionable to take a model out of one context and use it in another context without some kind of checks or validation. If we put that in pvlib it's like giving someone a hammer when you know they need a screwdriver. I suggest putting in an empty |
@adriesse @IoannisSifnaios it's been a while - can you recap where we are with this PR and its reviews? |
I have implemented all the suggested review comments. However, we haven't reached an agreement regarding whether this function should be included in pvlib. The main argument for not including it is that it calculates the temperature of moving water bodies (i.e., streams), which is an unlikely choice for installing a floating PV system. As Anton mentioned, some lake or sea temperature models would be more appropriate. The main argument for including it is that I could not find functions that estimate lake or sea temperature using ambient measurements and that this expression has been used in some publications (see description of the PR). So if we decide to include it in pvlib, it is with a warning about its usage and limitations. I think we should maybe put it to a vote and possibly close this PR if we agree not to include this function. |
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.
I think the function has place in the library with the appropriate caveats (a warning about application).
Since there's no concern about the technical soundness of the model itself and it is a model that is used by the PV modelling community, then as a library of models for the modelling community I think it makes sense to include it. As for concerns about its application, I think the function is clearly labelled for what it is so users are adequately informed of the relevant caveats concerning its application. |
@IoannisSifnaios I see a number of papers referring lake surface water temperature (LWST) models, or sea surface temperature (SST) models. Most models appear to be dynamic; basically, future temperature is a function of past temperature and exogenous variables. Are these models more complex that your application needs? This discussion (about water surface temperature models for non-flowing water bodies) probably needs its own issue. |
@cwhanse SST models are quite complicated and usually require solving turbulence equations etc. (I actually had a discussion with an oceanographer about this...). Regarding lakes, if you found a paper with a suitable model, please mention it in an issue (I will also take another look), and I can take it from there! ;-) |
I'm not yet convinced that this is a good idea. Whether we like it or not, inclusion in pvlib imparts a certain credibility and also increases visibility. This means that we have to be careful about what we include, whether we like it or not. Building PV over running water seems to be a niche application, so strictly speaking this model function would benefit few people. On the other hand there will be lots of people building PV over larger water bodies, and if this is the only model they find, they will likely use it despite it not having been validated for their application. I don't see that as a benefit to anyone. (The situation is similar with the wind speed height model that was recently merged.) From the abstract, it appears that the empirical model was derived from measurements on 11 streams in one geographic area only, and ambient temperatures were measured between 0 and 144 miles from those streams. If someone has used it for a lake in India (one of the references), does that bolster the case for inclusion? Or does it rather bolster the case against inclusion? One problem that is hinted at in the abstract is the thermal mass of the water body. From personal experience living near a large lake I can attest to the moderating effect on air temperature in early summer and early winter. I doubt that the size of the water body and the location of the temperature measurement in relation to it can be entirely ignored for modeling floating PV systems in general. Finally, there is no hurry. Even if we don't know of a suitable alternative right now, there is a steady stream(!) of papers on floating PV and surely more suitable models will show up. Or perhaps someone will validate this one more broadly and put my concerns to rest. |
I did a brief review and found the same as @cwhanse --- so far I have only seen models for the rate of change of LWST.
@IoannisSifnaios the For example, the air2water model in Equation 1 of this paper is an option and it has in fact been implemented in another package here. The calculation of net heat flux to the surface (at least in the paper, I haven't reviewed the github package in detail) is non-trivial. Again, these are for the rate of change of LSWT. I defer the determination of whether they are suitable or not to you; I am not an expert in floating PV by a long shot 😅 |
Co-authored-by: Cliff Hansen <[email protected]>
The discussion above certainly brings up a lot of good points, e.g., about the validation of the algorithm and whether its usage is justifiable. I'm leaning toward closing this PR and seeing how the modeling of floating PV develops. For floating PV on the sea, I think using reanalysis data for water temperature from ERA5 or similar could be a good option. |
I think I will close this for now. Thank you for the interesting discussions! |
docs/sphinx/source/reference
for API changes.docs/sphinx/source/whatsnew
for all changes. Includes link to the GitHub Issue with:issue:`num`
or this Pull Request with:pull:`num`
. Includes contributor name and/or GitHub username (link with:ghuser:`user`
).remote-data
) and Milestone are assigned to the Pull Request and linked Issue.Addition of the Stefan and Preud'homme equation for estimating the mean daily stream water temperature using the ambient air temperature as input. The paper can be found here.
Although this equation was created for estimating stream temperature, there are a number of publications that have used it for estimating the lakewater and seawater temperature (not sure if this is a good approach, though). From a quick search, some indicative publications that used it for estimating water temperature for floating PV are: 1, 2, 3, 4, 5.
Doc rendering