hydesign.weather.weather_wind_hybridization

Attributes

cosd

sind

Classes

ABL_WD

Atmospheric boundary layer WS and WD interpolation

Functions

interpolate_WD_linear(weather, hh)

Auxiliar functions for WD interpolation.

apply_interpolation_f(wrf_ds, weights_ds[, ...])

Function that applies interpolation to a wrf simulation.

Module Contents

class hydesign.weather.weather_wind_hybridization.ABL_WD(weather_fn, N_time)[source]

Bases: openmdao.api.ExplicitComponent

Atmospheric boundary layer WS and WD interpolation

Parameters:

hh (Turbine's hub height)

Returns:

wst

Return type:

wind speed time series at the hub height

weather_fn[source]
N_time[source]
setup()[source]

Declare inputs and outputs.

Available attributes:

name pathname comm options

compute(inputs, outputs)[source]

Compute outputs given inputs. The model is assumed to be in an unscaled state.

An inherited component may choose to either override this function or to define a compute_primal function.

Parameters:
  • inputs (Vector) – Unscaled, dimensional input variables read via inputs[key].

  • outputs (Vector) – Unscaled, dimensional output variables read via outputs[key].

  • discrete_inputs (dict-like or None) – If not None, dict-like object containing discrete input values.

  • discrete_outputs (dict-like or None) – If not None, dict-like object containing discrete output values.

hydesign.weather.weather_wind_hybridization.cosd[source]
hydesign.weather.weather_wind_hybridization.sind[source]
hydesign.weather.weather_wind_hybridization.interpolate_WD_linear(weather, hh)[source]

Auxiliar functions for WD interpolation.

Parameters:
  • weather (pd.DataFrame) – WD time-series table for a location at multiple heights. The columns must be named WS_hh (for example WD_10, WD_50, …).

  • hh (float) – Elevation (of a wind turbine) to interpolate WD

Returns:

ds_interpolated – Dataset that contains the interpolated time-series: WD and dWD_dz

Return type:

xr.Dataset

hydesign.weather.weather_wind_hybridization.apply_interpolation_f(wrf_ds, weights_ds, vars_xy_logz=['WSPD'], vars_xyz=['WDIR', 'RHO'], vars_xy=['UST', 'RMOL', 'TAIR', 'DIF_AVG', 'DNI_AVG'], vars_nearest_xy=[], vars_nearest_xyz=[], var_x_grid='west_east', var_y_grid='south_north', var_z_grid='height', varWD='WDIR')[source]

Function that applies interpolation to a wrf simulation.

Parameters:
  • wrf_ds (xarray.Dataset) – Weather timeseries

  • weights_ds (xarray.Dataset) –

    Weights for locs interpolation for several methods:

    <xarray.Dataset>
    Dimensions:        (ix: 4, iy: 4, iz: 5, loc: 14962)
    Coordinates:
    * loc            (loc) int64
    Dimensions without coordinates: ix, iy, iz
    Data variables:
        weights_x      (loc, ix) float64
        ind_x          (loc, ix) int64
        weights_y      (loc, iy) float64
        ind_y          (loc, iy) int64
        weights_z      (loc, iz) float64
        weights_log_z  (loc, iz) float64
        ind_z          (loc, iz) int64
        ind_x_1        (loc)     int64
        ind_y_1        (loc)     int64
        ind_z_1        (loc)     int64
    

  • vars_xy_logz (list) – List of variables to be interpolated in horizontal (x,y) using finite differences and power law piecewise interpolation in z.

  • vars_xyz (list) – List of variables to be interpolated in horizontal (x,y) using finite differences and linear piecewise interpolation in z.

  • vars_xy (list) – List of variables to be interpolated in horizontal (x,y) using finite differences

  • vars_nearest_xy (list) – List of variables to be approximated to the nearest horizontal point (x,y)

  • vars_nearest_xyz (list) – List of variables to be approximated to the nearest point (x,y,z)

  • var_x_grid (string, default:'west_east') – Name of the variable in the weather data used as x in the interpolation

  • var_y_grid (string, default: 'south_north') – Name of the variable in the weather data used as y in the interpolation

  • var_z_grid (string, default:'height') – Name of the variable in the weather data used as z in the interpolation

  • varWD (string, default:'wd') – Name of the wind direction variable for ensuring it is in [0,360]

Returns:

interp – Dataset including meso-variables timeseries, interpolated at each locs. The arrays have two dimensions: (‘Time’, ‘locs’).

Return type:

xarray.Dataset