Time series simulation - XRSite parameters vs kwargs for wf_model() call
Hi Mads,
I am having some trouble getting time series simulation to work (also with chunking and parallelization) if I want to use time-varying air density and/or TI as well. I am not sure if the issue is related to how I am setting up my XRSite or whether it is an issue with incorrectly using the kwargs to specify these variables when calling wf_model.
My XRSite is set up using:
#Initialise xarray dataset representation of probability matrix
dataset = wts.prob_dist(
variables={
"wind_direction": np.arange(-0.5, 360.5, 1),
"wind_speed": np.arange(-0.25, 50.75, 0.5),
}
)
# Add constant TI to Dataset as required for pywake to run (even if the
# models don't actually use it)
dataset = dataset.assign({"TI": wts.mean_turbulence_intensity})
# Initialise XRSite with probabilities dataset
site = XRSite(
ds=dataset,
shear=PowerShear(
h_ref=wts.reference_height,
alpha=wts.omnidirectional_shear_power_exponent,
),
)
I initialise my wf_model using:
wf_model = NOJ(site, turbines, k=wdc, superpositionModel=SquaredSum())
And I am calling my wf_model using:
# Run simulation
sim_res = wf_model(
per_position_details["x_proj_crs"],
per_position_details["y_proj_crs"],
type=types,
time=wts.time_series["time_stamp"],
ws=wts.time_series["wind_speed"],
wd=wts.time_series["wind_direction"],
Air_density=wts.time_series["air_density"],
wd_chunks=wd_chunks,
n_cpu=n_cpu,
)
Firstly, it is not clear if I should need to pass a probability distribution dataset at all if I am using time series simulation, as I then separately pass the ws, wd and time kwargs to wf_model. Secondly (granted it is a separate issue), even though the NOJ model doesn't use it, I still need to pass a TI value in the XRSite. When I use this setup though, the simulation runs but does not seem to use the time varying air density. When I pass the air density as part of the XRSite instead, I get an assertion error "no description" when I hit line 774 in multiprocessing.pool.py.
The documentation indicates this is possible (ie. to pass time varying combinations of ws, wd, shear, TI, density, speedup etc) but it is not clear how to actually do this successfully. Could you provide an example so I can narrow down the cause, as I am also not sure if it is just an issue with combining this with multiprocessing?
Thanks,
Michael