Skip to content

Commit

Permalink
add additional constraint on max. ring length, fixes #201
Browse files Browse the repository at this point in the history
  • Loading branch information
nesnoj committed Jul 24, 2017
1 parent 8ad2abe commit 61f7021
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
3 changes: 3 additions & 0 deletions dingo/config/config_calc.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ load_area_threshold = 1
#load_area_count_per_ring: unit: -
load_area_count_per_ring = 20

#max_ring_length_factor: unit: -
max_ring_length_factor = 1.5

[mv_connect]

#load_area_sat_load_threshold: unit kW
Expand Down
25 changes: 18 additions & 7 deletions dingo/grid/mv_grid/models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,11 @@ def tech_constraints_satisfied(self):
checked using load factors from [1]_. Due to the high amount of steps the voltage rating cannot be checked
using load flow calculation. Therefore we use a simple method which determines the voltage change between
two consecutive nodes according to [2]_.
Furthermore it is checked if new route has got more nodes than allowed (typ. 2*10 according to [3]_).
Furthermore it is checked:
* if new route has got more nodes than allowed (typ. 2*10 according to [3]_)
* if the length of the full ring exceeds a threshold of 2 * max_ring_length_factor * v_level
(e.g. in a 20kV grid assuming max_ring_length_factor=1.5 the max ring length would be 60km).
max_ring_length_factor is used to achieve more variance in the grids.
References:
Expand All @@ -237,6 +241,9 @@ def tech_constraints_satisfied(self):
load_area_count_per_ring = float(cfg_dingo.get('mv_routing',
'load_area_count_per_ring'))

max_ring_length_factor = float(cfg_dingo.get('mv_routing',
'max_ring_length_factor'))

if self._problem._branch_kind == 'line':
load_factor_normal = float(cfg_dingo.get('assumptions',
'load_factor_mv_line_lc_normal'))
Expand All @@ -261,10 +268,14 @@ def tech_constraints_satisfied(self):
if len(self._nodes) > load_area_count_per_ring:
return False

# step 1: calc circuit breaker position
# step 1: check if the total length of the route exceeds max. allowed distance
if self.length() > self._problem._v_level * max_ring_length_factor * 2:
return False

# step 2: calc circuit breaker position
position = self.calc_circuit_breaker_position()

# step 2: calc required values for checking current & voltage
# step 3: calc required values for checking current & voltage
# get nodes of half-rings
nodes_hring1 = [self._problem._depot] + self._nodes[0:position]
nodes_hring2 = list(reversed(self._nodes[position:len(self._nodes)] + [self._problem._depot]))
Expand All @@ -277,7 +288,7 @@ def tech_constraints_satisfied(self):
r = self._problem._branch_type['R'] # unit for r: ohm/km
x = self._problem._branch_type['L'] * 2*pi * 50 / 1e3 # unit for x: ohm/km

# step 3a: check if current rating of default cable/line is violated
# step 4a: check if current rating of default cable/line is violated
# (for every of the 2 half-rings using load factor for normal operation)
demand_hring_1 = sum([node.demand() for node in self._nodes[0:position]])
demand_hring_2 = sum([node.demand() for node in self._nodes[position:len(self._nodes)]])
Expand All @@ -288,13 +299,13 @@ def tech_constraints_satisfied(self):
peak_current_sum_hring2 > (self._problem._branch_type['I_max_th'] * load_factor_normal)):
return False

# step 3b: check if current rating of default cable/line is violated
# step 4b: check if current rating of default cable/line is violated
# (for full ring using load factor for malfunction operation)
peak_current_sum_ring = self._demand / (3**0.5) / self._problem._v_level # units: kVA / kV = A
if peak_current_sum_ring > (self._problem._branch_type['I_max_th'] * load_factor_malfunc):
return False

# step 4a: check voltage stability at all nodes
# step 5a: check voltage stability at all nodes
# (for every of the 2 half-rings using max. voltage difference for normal operation)

# get operation voltage level from station
Expand Down Expand Up @@ -329,7 +340,7 @@ def tech_constraints_satisfied(self):
if (v_level_op - v_level_hring2) > (v_level_op * mv_max_v_level_lc_diff_normal):
return False

# step 4b: check voltage stability at all nodes
# step 5b: check voltage stability at all nodes
# (for full ring calculating both directions simultaneously using max. voltage diff. for malfunction operation)
for (n1, n2), (n3, n4) in zip(zip(nodes_ring1[0:len(nodes_ring1)-1], nodes_ring1[1:len(nodes_ring1)]),
zip(nodes_ring2[0:len(nodes_ring2)-1], nodes_ring2[1:len(nodes_ring2)])):
Expand Down

0 comments on commit 61f7021

Please sign in to comment.