Skip to content

Commit 2a8a873

Browse files
committed
Small update to addCablesConnections
-- allow turn off of cable heading adjustment considering mooring headings of other turbine if it's close enough
1 parent c00a722 commit 2a8a873

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

famodel/project.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,7 +1734,8 @@ def addCablesConnections(self,connDict,cableType_def='dynamic_cable_66',oss=Fals
17341734
substation_r=[None],ss_id=200,id_method='location',
17351735
keep_old_cables=False, connect_ss=True,
17361736
cableConfig=None, configType=0,heading_buffer=30,
1737-
route_anchors=True):
1737+
route_anchors=False, adj_dir=1,
1738+
consider_alternate_side=False):
17381739
'''Adds cables and connects them to existing platforms/substations based on info in connDict
17391740
Designed to work with cable optimization output designed by Michael Biglu
17401741
@@ -1764,6 +1765,14 @@ def addCablesConnections(self,connDict,cableType_def='dynamic_cable_66',oss=Fals
17641765
0 = default to dynamic-static-dynamic cables, 1 = default to suspended cable systems
17651766
heading_buffer : float, optional
17661767
Minimum buffer between moorings and cables (degrees). Default is 30
1768+
route_anchors: bool, optional
1769+
True=automatically route cables around anchors
1770+
adj_dir: int, optional
1771+
Control initial direction to adjust cable headings to avoid mooring anchors
1772+
1 for positive angle adjustment, -1 for negative angle adjustment
1773+
consider_alternate_side: bool, optional
1774+
True- take into account mooring headings of platform on other side
1775+
if it is within 2 mooring radii
17671776
17681777
Returns
17691778
-------
@@ -1890,7 +1899,7 @@ def addCablesConnections(self,connDict,cableType_def='dynamic_cable_66',oss=Fals
18901899
msp = list(moors.values())[0].span + attA.rFair + 200 # add a bit extra
18911900
# consider mooring headings from both ends if close enough
18921901
pfsp = np.linalg.norm(attA.r-attB.r)
1893-
if pfsp-2*attA.rFair < msp+dc0s:
1902+
if consider_alternate_side and pfsp-2*attA.rFair < msp+dc0s:
18941903
headingA = head_adjust([attA,attB],headingA,rad_buff=rad_buff)
18951904
headingB = head_adjust([attB,attA],headingB,rad_buff=rad_buff,endA_dir=-1)
18961905
else:

0 commit comments

Comments
 (0)