FraunhoferIWES / foxes

Farm Optimization and eXtended yield Evaluation Software
MIT License
23 stars 7 forks source link

Timeseries inputs per turbine? #31

Closed Wissant closed 1 year ago

Wissant commented 1 year ago

Is your feature request related to a problem? Please describe. This is not a huge problem, rather an optimization. If I use fixed frame wake propagation (as opposed to streamline), the required wind field information is all available at each turbine location. As a result for this case, field data input option is a bit overkill because it works with data on a full grid. On the other side, the multi-height timeseries input option is nice but I believe it can only simulate uniform flow

Describe the solution you'd like Extend the multi-height timeseries state input to a multi-height and multi turbine timseries input state ... or extend the fielddata state input to have the option to feed a turbine indexed xarray instead of a (x, y) indexed

Describe alternatives you've considered I am considering an alternative to create very coarse field_data inputs in order to hit a compromise. I am interested to hear your point of view on this?

My background I mostly work on complex terrain onshore situations

SchmJo commented 1 year ago

Thanks for the idea. In general, foxes' States by definition calculate data at any given set of points, which does not neccessarily mean those are turbine related (for example when plotting a 2D flow field). Also, for all rotor models except CentreRotor each turbine evaluates actually more than one point, and the states have to be combinable with any choice of rotor model.

However, there is a possibility to setup state weights that depend on state and turbine indices, so one could in principle cook up a solution where for each turbine the states are different - so far this has not been put to use. The intention was to add at some point WRG format input (turbine dependent wind roses). Would that be helpful for your case? For timeseries it would mean to setup a different timeseries for each turbine, each again being uniform but with weights equal zero except for the turbine inquestion.

For now, I propose you simply overwrite the rotor effective results from the rotor model, by invoking the SetFarmVars turbine model:

data_ws = ... #numpy ndarray with shape (n_states, n_turbines)
data_wd = ... #numpy ndarray with shape (n_states, n_turbines)
data_ti = ... #numpy ndarray with shape (n_states, n_turbines)

mbook.turbine_models["set_rotor_data"] = foxes.models.turbine_models.SetFarmVars()
mbook.turbine_models["set_rotor_data"].add_var(FV.REWS, data_ws)
mbook.turbine_models["set_rotor_data"].add_var(FV.REWS2, data_ws)
mbook.turbine_models["set_rotor_data"].add_var(FV.REWS3, data_ws)
mbook.turbine_models["set_rotor_data"].add_var(FV.WD, data_wd)
mbook.turbine_models["set_rotor_data"].add_var(FV.YAW, data_wd)
mbook.turbine_models["set_rotor_data"].add_var(FV.TI, data_ti)

farm = foxes.WindFarm(
    ...,
    turbine_models=["set_rotor_data", "NREL5", ...]
)

This assumes that the air density FV.RHO can still be obtained from the states, otherwise also add it here (and any other relevant data).

Wissant commented 1 year ago

Thanks for the fast reply. I think what you mentionned that foxes "calculates data at any given set of points" is a great philosophy, I would not want to change that.

I will try what you propose here above, that should do the job perfectly well for what I need. Thanks for the tip!