Add per-turbine timeseries air density support#47
Add per-turbine timeseries air density support#47bjarketol wants to merge 9 commits intoEUFLOW:mainfrom
Conversation
6522e1b to
2a75ee1
Compare
|
@kilojoules can you review this one? |
|
@bjarketol I rebased this on #48 such that now also foxes passes a similar turbine-based timeseries test with air density |
5796c21 to
e9ad394
Compare
|
I am not a fan of numpy < 2, since it blocks future updates of numpy. Can we convince the wayve team to replace |
|
As far as I can tell, it's essentially the same function, just renamed? If that's the case I can refactor the code to handle that, yes. Would any other changes be needed? |
|
@koendev, you can use something like the code below to support both numpy 1 and 2: _trapezoid = np.trapezoid if hasattr(np, "trapezoid") else np.trapz
U3 = _trapezoid(np.interp(z, zs, us), z) / (15.0e3 - h)
V3 = _trapezoid(np.interp(z, zs, vs), z) / (15.0e3 - h) |
|
Adresses #31 |
pyproject.toml
Outdated
| "foxes @ git+https://github.com/FraunhoferIWES/foxes.git@eu_flow", | ||
| "windIO @ git+https://github.com/EUFlow/windIO.git", | ||
| "wayve @ git+https://gitlab.kuleuven.be/TFSO-software/wayve@dev_foxes", | ||
| "numpy<2.0", |
There was a problem hiding this comment.
I would like to support numpy > 2
There was a problem hiding this comment.
Yes, agree, once @koendev has a numpy 2 update ready for wayve ready we can change the pin
There was a problem hiding this comment.
Loosened the numpy pin to "numpy>=1.22,<3.0"
I thied this and I can't get it to work. Tests are still failing. |
It needs to be fixed upstream in wayve |
|
Hi all, wayve has been updated to use numpy >2. Please use the main branch, the couplings to foxes and PyWake are available there as well. |
Pass density from wind_resource as the Air_density simulation kwarg so PyWake's DensityScale model correctly scales power output. Previously density was embedded in the XRSite dataset where PyWake silently ignored it. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The wayve dependency uses np.trapz extensively, which was removed in NumPy 2.0. Pin numpy<2.0 until wayve is updated. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0de3ab2 to
74b9ebf
Compare
Summary
densityfromwind_resourceas theAir_densitysimulation kwarg to PyWake's wind farm model, enablingDensityScaleto correctly scale power outputdensityfrom the XRSite dataset where PyWake was silently ignoring itoperatingflag patternChanges
wifa/pywake_api.py: Drop density from site dataset, initializeair_density, extract density in timeseries branch, addAir_densityto sim_kwargstests/conftest.py: New shared test fixturemake_timeseries_per_turbine_system_dictwith per-turbine density datatests/test_pywake.py: Enhanced test comparing AEP with and without densitypyproject.toml: Addteststo pythonpath so conftest is importableTest plan
test_pywake_dict_timeseries_per_turbine_with_densitypasses and verifies density affects AEPtest_cs.pyfailures unrelated to this change)🤖 Generated with Claude Code