NREL / flasc

A rich floris-driven suite for SCADA analysis
https://nrel.github.io/flasc/
BSD 3-Clause "New" or "Revised" License
30 stars 18 forks source link

Feature: Heterogeneity estimator class #157

Closed Bartdoekemeijer closed 7 months ago

Bartdoekemeijer commented 7 months ago

This PR is ready to be merged.

Feature or improvement description This PR adds a separate class for the heterogeneity estimation process, including automatic conversion to FLORIS' het_map variable and various visualizations.

Related issue, if one exists N/A

Impacted areas of the software Energy ratio class.

Additional supporting information This class is useful for quickly deriving the heterogeneous inflow profiles over all wind directions and formatting it to a FLORIS-compatible format. The class allows you to directly output the heterogeneity profiles to a FLORIS-compatible format so that it can be used in the het_map variable. Note that this function linearly extends the measured heterogeneous wind speeds along the wind direction:

image

Test results, if applicable The example 05_estimate_heterogeneity_from_energy_ratios.py now produces the figures: image

image

image

and this is how the variable df_fi_hetmap looks like in the example:

       wd                                                  x                                                  y                                           speed_up
0     0.0  [755.9380000000007, 755.9380000000007, 755.938...  [4183.320249119671, 4110.435880450586, 4037.55...  [0.9998389989397772, 0.9998389989397772, 0.999...
1    30.0  [3434.1101245598365, 3397.667940225294, 3361.2...  [3124.4258829077685, 3061.306168101551, 2998.1...  [1.0007038336839695, 1.0007038336839695, 1.000...
2    60.0  [4754.64788290777, 4691.528168101552, 4628.408...  [1803.8881245598357, 1767.4459402252935, 1731....  [0.9997069479189234, 0.9997069479189234, 0.999...
3    90.0  [5237.998249119671, 5165.113880450586, 5092.22...  [-4.4182516355242484e-13, -4.3289940267257786e...  [0.9667388379485943, 0.9667388379485943, 0.966...
4   120.0  [4754.64788290777, 4691.528168101552, 4628.408...  [-1803.8881245598348, -1767.4459402252926, -17...  [0.9980607757391102, 0.9980607757391102, 0.998...
5   150.0  [3434.1101245598343, 3397.667940225292, 3361.2...  [-3124.4258829077703, -3061.306168101553, -299...  [1.000333827309378, 1.000333827309378, 1.00033...
6   180.0  [1630.2219999999998, 1630.2219999999998, 1630....  [-3607.7762491196704, -3534.891880450586, -346...  [1.0004001118062382, 1.0004001118062382, 1.000...
7   210.0  [-173.66612455983568, -137.22394022529352, -10...  [-3124.4258829077694, -3061.306168101552, -299...  [0.9997574896290464, 0.9997574896290464, 0.999...
8   240.0  [-1494.2038829077699, -1431.0841681015525, -13...  [-1803.8881245598348, -1767.4459402252926, -17...  [1.000689792658521, 1.000689792658521, 1.00068...
9   270.0  [-2791.3872491196703, -2718.502880450586, -264...  [123.431, 123.431, 123.431, 123.431, 123.431, ...  [0.9993868881890051, 0.9993868881890051, 0.999...
10  300.0  [-3124.42588290777, -3061.3061681015524, -2998...  [2451.6671245598345, 2415.224940225293, 2378.7...  [1.000499654613084, 1.000499654613084, 1.00049...
11  330.0  [-1047.9501245598358, -1011.5079402252935, -97...  [3699.9698829077693, 3636.850168101552, 3573.7...  [1.0006043428343852, 1.0006043428343852, 1.000...
Bartdoekemeijer commented 7 months ago

Just requires some formatting to accommodate Ruff and then it's good to go, I think!

paulf81 commented 7 months ago

This looks really great @Bartdoekemeijer , we will try to spend some time on it soon, thank you!

paulf81 commented 7 months ago

hi @Bartdoekemeijer , this looks great and will be a very useful tool!

I pushed up a few small changes, then I think there are a few additional little issues:

In energy_ratio_heterogeneity_mapper

Bartdoekemeijer commented 7 months ago

Thanks Paul!

The arrow plot indeed shows the direction where the wind is blowing. Could optionally swap this. I like it like this, but happy to be convinced otherwise and happy to accommodate both options too. Let me know!