Calculates wind loads (wind force / breaking force) for overhead transmission lines in the network data dictionary and a given .nc file containing wind data. The overhead transmission lines are identified according to the chosen mode ((:sum or :single, see get_underground_tl) and divided into segments between towers. The results are returned in form of a dictionary (see calc_overhead_tl_segments).
Identifies overhead transmission lines in the network data dictionary according to the chosen mode (:sum or :single, see get_underground_tl) and divides them into segments between towers. The towers are assumed to be d_twrs (in m) apart and the resulting segments have a length (l_seg) close to d_twrs. The resulting segments are returned in form of a dictionary with entries explained in the code below.
=#
function calc_overhead_tl_segments(
network_data::Dict{String,<:Any},
d_twrs=161.0;
mode=:sum# :sum or :single
)
### Get (string) indices of underground transmission lines
"N_seg"=>N_seg,# number of segments between towers
"l_seg"=>l_seg,# actual length of segments (close to d_twrs)
"seg_lons"=>seg_lons,# longitudes of segment-half-way points
"seg_lats"=>seg_lats,# latitudes of segment-half-way points
"windloads"=>Dict{Int64,Array{Float64,1}}()# for wind loads
)
end
returnseg_data
end
#=
Function that divides a transmission line (tl) between a "from-bus" with coordinates (lon_f, lat_f) in degrees and a "to-bus" (lon_t, lat_t) into segments of wanted length d_twrs (average distance between transmission towers in meter) and returns the half-way points (longitude and latitude coordinates) of all segments together with length L of the transmission line (calculated using the haversine formula), the number of segments (N_twrs+1), and the actual length of segments l_seg.
=#
function _calc_tl_segments(
lon_f::Float64,lat_f::Float64,
lon_t::Float64,lat_t::Float64,
d_twrs=161.0
)
R=6371000# earth radius
λf,φf,λt,φt=deg2rad.([lon_f,lat_f,lon_t,lat_t])
### Calculate haversine distance between "from-" and "to-bus"
Assigns location indices to transmission line segments that help to identify local wind speeds for the calculation of wind loads. The location indices are added to the data dictionary seg_data.
=#
function _assign_loc_indices!(
seg_data::Dict{String,<:Any},
wind_lons::Array{Float64,1},# longitudes in wind field
wind_lats::Array{Float64,1}# latitudes in wind field
)
### Go through overhead transmission lines
fortl_dataincollect(values(seg_data))
N_seg=tl_data["N_seg"]
lon_indices=zeros(Int64,N_seg)
lat_indices=zeros(Int64,N_seg)
### Go through segments and identify their position in the wind field
Calculates wind loads for all overhead transmission line segments in the segment data dictionary containing location indices (see _assign_loc_indices!) and a given time step (frame) of the wind field. The results are added to seg_data.
=#
function _calc_seg_windloads!(
seg_data::Dict{String,<:Any},
wind_frame::SubArray,# slice of wind speed time series
f::Int64# wind frame number
)
### Go through overhead transmission lines
for(key,tl_data)inseg_data
windloads=zeros(tl_data["N_seg"])
### Go through unique segment location indices and calculate wind loads
forlocinunique(tl_data["loc_indices"])
ws=wind_frame[CartesianIndex(loc)]# local wind speed
wl=_calc_windload(ws,tl_data["l_seg"])# local wind load
### Add this wind load to all segments with these location indices
foriinfindall(l->l==loc,tl_data["loc_indices"])
windloads[i]=wl
end
end
tl_data["windloads"][f]=windloads# add result to dictionary
end
returnnothing
end
#=
Function that calculates the failure probabilities of transmission line segments according to the local wind speed and the length of the segments.
=#
function _calc_windload(v::Float64,l::Float64)
### Parameters in wind force design equation
Q,k_z,C_f,d,F_brk=[0.613,1.17,0.9,0.03,152130]
### Gust response factor for line segment
E_W=4.9*sqrt(0.005)*(33/70)^(1/7)
G_WRF=1+2.7*E_W/sqrt(1+0.8/67.056*l)
### Convert wind speeds to an effective height of h = 70ft = 21.336m
v*=1.16# conversion factor ln(21.336/0.1)/ln(100) ≈ 1.16 from 10m to h
### Calculate wind force according to ASCE design equation