Skip to content
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

Wind power model crashes when header data is incorrect #1990

Open
cpaulgilman opened this issue Jan 8, 2025 · 1 comment
Open

Wind power model crashes when header data is incorrect #1990

cpaulgilman opened this issue Jan 8, 2025 · 1 comment

Comments

@cpaulgilman
Copy link
Collaborator

Describe the bug

This 5-minute wind resource file is from the WIND Toolkit PR500 endpoint: https://developer.nrel.gov/docs/wind/wind-toolkit/wtk-pr100-5min-download/

wtk-pr100-5min-download.zip

First few lines of weather file:

SiteID,8380,Site Timezone,,Data Timezone,-4,Longitude,,Latitude,
Year,Month,Day,Hour,Minute,boundary layer height,2-m friction velocity (m/s),2-m Inverse Monin-Obukhov Length,surface air pressure (Pa),air pressure at 100m (Pa),air pressure at 200m (Pa),air pressure at 300m (Pa),relative humidity at 2m (%),Roughness length (m),skin temperature (C),surface heat flux,Sea surface temperature (C),air temperature at 100m (C),air temperature at 10m (C),air temperature at 120m (C),air temperature at 140m (C),air temperature at 160m (C),air temperature at 180m (C),air temperature at 200m (C),air temperature at 20m (C),air temperature at 220m (C),air temperature at 240m (C),air temperature at 260m (C),air temperature at 280m (C),air temperature at 2m (C),air temperature at 300m (C),air temperature at 400m (C),air temperature at 40m (C),air temperature at 500m (C),air temperature at 60m (C),air temperature at 80m (C),virtual potential air temperature at 100m (C),virtual potential air temperature at 10m (C),virtual potential air temperature at 120m (C),virtual potential air temperature at 140m (C),virtual potential air temperature at 160m (C),virtual potential air temperature at 180m (C),virtual potential air temperature at 200m (C),virtual potential air temperature at 20m (C),virtual potential air temperature at 220m (C),virtual potential air temperature at 240m (C),virtual potential air temperature at 260m (C),virtual potential air temperature at 280m (C),virtual potential air temperature at 2m (C),virtual potential air temperature at 300m (C),virtual potential air temperature at 400m (C),virtual potential air temperature at 40m (C),virtual potential air temperature at 500m (C),virtual potential air temperature at 60m (C),virtual potential air temperature at 80m (C),wind direction at 100m (deg),wind direction at 10m (deg),wind direction at 120m (deg),wind direction at 140m (deg),wind direction at 160m (deg),wind direction at 180m (deg),wind direction at 200m (deg),wind direction at 20m (deg),wind direction at 220m (m/s),wind direction at 240m (m/s),wind direction at 260m (m/s),wind direction at 280m (m/s),wind direction at 300m (m/s),wind direction at 400m (m/s),wind direction at 40m (deg),wind direction at 500m (m/s),wind direction at 60m (deg),wind direction at 80m (deg),wind speed at 100m (m/s),wind speed at 10m (m/s),wind speed at 120m (m/s),wind speed at 140m (m/s),wind speed at 160m (m/s),wind speed at 180m (m/s),wind speed at 200m (m/s),wind speed at 20m (m/s),wind speed at 220m (m/s),wind speed at 240m (m/s),wind speed at 260m (m/s),wind speed at 280m (m/s),wind speed at 300m (m/s),wind speed at 400m (m/s),wind speed at 40m (m/s),wind speed at 500m (m/s),wind speed at 60m (m/s),wind speed at 80m (m/s)
2020,1,1,0,30,61.6,0.0809,0.30054616928100586,100460,99320,98190,97070,98.45,0.5,18.67,-6.990386962890625,-273.15000000000003,23.67,22.01,23.57,23.45,23.3,23.14,22.97,22.8,22.8,22.62,22.44,22.26,20.8,22.080000000000002,21.14,23.42,20.32,23.64,23.73,27.17,24.5,27.26,27.32,27.36,27.400000000000002,27.41,25.44,27.43,27.44,27.44,27.45,23.42,27.46,27.47,26.310000000000002,27.55,26.75,27.03,64.08,348.73,66.3,68.11,69.64,71,72.02,24.02,72.97,73.7,74.41,75.02,75.63,78.26,47.88,79.7,56.160000000000004,61.480000000000004,5.38,2.73,5.59,5.74,5.86,5.96,6.01,2.82,6.05,6.07,6.08,6.09,6.09,6.0600000000000005,4.07,5.98,4.61,5.11
2020,1,1,1,30,73.4,0.1653,0.036041259765625,100410,99270,98140,97030,96.82000000000001,0.5,21.37,-5.458845615386963,-273.15000000000003,23.53,22.240000000000002,23.42,23.28,23.13,22.97,22.81,22.53,22.64,22.48,22.31,22.14,22.01,21.97,20.98,23.05,20.07,23.44,23.59,27.060000000000002,24.77,27.150000000000002,27.21,27.25,27.29,27.32,25.18,27.36,27.38,27.400000000000002,27.42,24.79,27.43,27.37,25.92,27.37,26.55,26.92,62.38,3.63,65.07000000000001,67.29,69.24,71.02,72.58,20.71,74.04,75.31,76.43,77.08,77.71000000000001,78.25,39.94,78.3,52.47,59.370000000000005,4.89,2.08,5.03,5.13,5.22,5.32,5.41,2.44,5.51,5.61,5.71,5.8100000000000005,5.91,6.12,3.5100000000000002,6.23,4.28,4.74

It contains 5-minute data and is mostly correctly formatted, but is missing latitude and longitude data from the header. This causes the Wind Power model to crash.

Expected behavior is to generate a simulation error instead of crashing.

To Reproduce

  1. Download the wind resource file above and extract it.
  2. Create a default Wind / No Financial case.
  3. On the Wind Resource page, check Use a wind resource file stored on your computer and select the file from Step 1.
  4. Click Simulate.

SAM crashes instead of generating a simulation error.

Operating System and Version

  • Windows 11
  • SAM 2024.12.12
@cpaulgilman cpaulgilman added the bug label Jan 8, 2025
@cpaulgilman cpaulgilman added this to the 2024 Release Patch 1 milestone Jan 8, 2025
@cpaulgilman
Copy link
Collaborator Author

See https://sam.nrel.gov/forum/forum-general/4171-how-to-download-edit-a-nrel-wind-toolkit.html#13793 for a list of WIND Toolkit API endpoints that generate files that work with SAM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant