Skip to content

Commit 1877739

Browse files
committed
Minor Catenary edits related to slope, no change in results
1 parent 5b4316b commit 1877739

File tree

1 file changed

+40
-15
lines changed

1 file changed

+40
-15
lines changed

moorpy/Catenary.py

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,11 @@ def catenary(XF, ZF, L, EA, W, CB=0, alpha=0, HF0=0, VF0=0, Tol=0.000001,
156156
# double-back on itself; the line forms an "L" between the anchor and fairlead. Then it
157157
# models it as bunched up on the seabed (instead of throwing an error)
158158
# ProfileType=5: Similar to above but both ends are off seabed, so it's U shaped and fully slack
159+
# (seabed can be sloped)
159160
# ProfileType=6: Completely vertical line without seabed contact (on the seabed is handled by 4 and 5)
160161
# ProfileType = 7: Portion of the line is resting on the seabed, and the seabed has a slope
161162
# ProfileType = 8: line resting on the seabed, and the seabed has a slope
163+
# ProfileType = U: Both ends off the seabed, seabed contact, not slack (adding support for slope...)
162164

163165
EA_W = EA/W
164166

@@ -174,6 +176,11 @@ def catenary(XF, ZF, L, EA, W, CB=0, alpha=0, HF0=0, VF0=0, Tol=0.000001,
174176
LHanging1 = np.sqrt(2.0*hA*EA_W + EA_W*EA_W) - EA_W # unstretched hanging length at end A
175177
LHanging2 = np.sqrt(2.0*hB*EA_W + EA_W*EA_W) - EA_W # unstretched hanging length at end B
176178
LHanging = LHanging1 + LHanging2
179+
180+
# Some shortcuts for dealing with slope
181+
cos_alpha = np.cos(np.radians(alpha))
182+
sin_alpha = np.sin(np.radians(alpha))
183+
tan_alpha = sin_alpha/cos_alpha
177184

178185
# calculate a vertical stiffness estimate for an end lifting off the seabed
179186
def dV_dZ_s(z0, H): # height off seabed to evaluate at (infinite if 0), horizontal tension
@@ -248,10 +255,6 @@ def dV_dZ_s(z0, H): # height off seabed to evaluate at (infinite if 0), horizo
248255

249256
ProfileType = 8
250257

251-
cos_alpha = np.cos(np.radians(alpha))
252-
tan_alpha = np.tan(np.radians(alpha))
253-
sin_alpha = np.sin(np.radians(alpha))
254-
255258
LAB = XF/cos_alpha # calling this the lenght along the seabed for this case
256259
if LAB < 0:
257260
breakpoint()
@@ -323,10 +326,6 @@ def dV_dZ_s(z0, H): # height off seabed to evaluate at (infinite if 0), horizo
323326

324327

325328
if plots > 0:
326-
327-
cos_alpha = np.cos(np.radians(alpha))
328-
tan_alpha = np.tan(np.radians(alpha))
329-
330329
for I in range(nNodes):
331330
if s[I] > L-LHanging: # this node is on the suspended/hanging portion of the line
332331

@@ -341,7 +340,7 @@ def dV_dZ_s(z0, H): # height off seabed to evaluate at (infinite if 0), horizo
341340
Te[I] = 0.0
342341

343342

344-
else: # U shaped
343+
else: # U shaped (and slack)
345344
ProfileType = 5
346345

347346
# This case originally was for flat seabeds but now also gives a
@@ -374,7 +373,7 @@ def dV_dZ_s(z0, H): # height off seabed to evaluate at (infinite if 0), horizo
374373

375374
elif s[I] <= L-LHanging2: # the middle portion of the line, slack along the seabed
376375
Xs[I] = (s[I]-LHanging1)*XF/(L-LHanging1-LHanging2)
377-
Zs[I] = -hA
376+
Zs[I] = -hA + Xs[I]*tan_alpha
378377
Te[I] = 0.0
379378

380379
else: # the 2nd suspended/hanging portion of the line
@@ -981,10 +980,6 @@ def step_func_U(X, args, Y, info, Ytarget, err, tols, iter, maxIter):
981980
# Line is paritally in contact with a sloped seabed
982981
elif ProfileType==7:
983982

984-
cos_alpha = np.cos(np.radians(alpha))
985-
sin_alpha = np.sin(np.radians(alpha))
986-
tan_alpha = sin_alpha/cos_alpha
987-
988983
LBot = L - (VF - HF * tan_alpha)/W # Length of line on the seafloor
989984

990985
VTD = VF - W*(L-LBot) #Vertical Force at the touchdownpoint (last point in contact with (sloped) seabed
@@ -1002,6 +997,7 @@ def step_func_U(X, args, Y, info, Ytarget, err, tols, iter, maxIter):
1002997
xB = 0.0
1003998

1004999
xBlim = max(xB, 0.0)
1000+
10051001

10061002
if s[I] <= xB and CB > 0: # (aka Lbot - s > HF/(CB*W) ) if this node rests on the seabed and the tension is zero
10071003

@@ -1568,9 +1564,38 @@ def step_func_cat(X, args, Y, info, Ytarget, err, tols, iter, maxIter):
15681564

15691565
#(fAH1, fAV1, fBH1, fBV1, info1) = catenary(36.8677299586167, -20.0, 41.943170938142885, 720564398.5432665, 4.790651494763263, CB=-20.0, alpha=0, HF0=0, VF0=0, Tol=0.00025, MaxIter=100, depth=0, plots=1)
15701566

1571-
(fAH1, fAV1, fBH1, fBV1, info1) = catenary(99.81049247033445, -0.05676018885873191, 497.7, 2053446578.5601218, 4093.0908951352612, CB=0, alpha=-0.032582936271583374, HF0=0.0, VF0=703890.9922736725, Tol=0.0001, MaxIter=100, depth=169.68538734009778, plots=1)
1567+
#(fAH1, fAV1, fBH1, fBV1, info1) = catenary(99.81049247033445, -0.05676018885873191, 497.7, 2053446578.5601218, 4093.0908951352612, CB=0, alpha=-0.032582936271583374, HF0=0.0, VF0=703890.9922736725, Tol=0.0001, MaxIter=100, depth=169.68538734009778, plots=1)
1568+
#(fAH1, fAV1, fBH1, fBV1, info1) = catenary(99.81049247033445, -0.6328306628997211, 497.7, 2053446578.5601218, 4093.0908951352612, CB=-0.17674800624504883, alpha=-0.26181044510614215, HF0=0.0, VF0=703890.9922736725, Tol=0.0001, MaxIter=100, depth=169.95903300525373, plots=1)
15721569

1570+
(fAH1, fAV1, fBH1, fBV1, info1) = catenary(475.4204524881751, 75.46949876239697, 497.7, 2053741190.7845445, 4093.6781602294, alpha=0, HF0=2105731.5430434863, VF0=1376367.9718298465, Tol=5e-06, MaxIter=100, plots=1)
15731571

1572+
'''
1573+
# slope issue investigation
1574+
(fAH1, fAV1, fBH1, fBV1, info1) = catenary(174, 159, 260, 121062548, 48, CB=0.0, alpha=0.0, depth=300, Tol=0.000001, plots=1)
1575+
(fAH2, fAV2, fBH2, fBV2, info2) = catenary(174, 159, 260, 121062548, 48, CB=0.0, alpha=0.00001, depth=300, Tol=0.000001, plots=1)
1576+
1577+
from moorpy.helpers import printMat
1578+
1579+
def compare(label):
1580+
print(label)
1581+
print(f'{info1[label]:10.3f}')
1582+
print(f'{info2[label]:10.3f}')
1583+
print('-------------------------------')
1584+
1585+
def compareMats(label):
1586+
print(label)
1587+
printMat(info1[label])
1588+
printMat(info2[label])
1589+
print('-------------------------------')
1590+
1591+
compare('HA')
1592+
compare('HF')
1593+
compare('VA')
1594+
compare('VF')
1595+
compareMats('stiffnessA')
1596+
compareMats('stiffnessB')
1597+
compareMats('stiffnessBA')
1598+
'''
15741599
# First attempt's iterations are as follows:
15751600
# Iteration 0: HF= 5.0000e-05, VF= 2.8450e+04, EX= 0.00e+00, EZ= 0.00e+00
15761601
# Second attempt's iterations are as follows:

0 commit comments

Comments
 (0)