Skip to content

Commit

Permalink
Subsystem update to support shared/symmetrical lines
Browse files Browse the repository at this point in the history
  • Loading branch information
mattEhall committed Aug 7, 2024
1 parent 4b68c74 commit b5b9305
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
3 changes: 2 additions & 1 deletion moorpy/Catenary.py
Original file line number Diff line number Diff line change
Expand Up @@ -1466,7 +1466,8 @@ def step_func_cat(X, args, Y, info, Ytarget, err, tols, iter, maxIter):

#(fAH1, fAV1, fBH1, fBV1, info1) = catenary(0.16525209064463553, 1000.1008645356192, 976.86359774357, 861890783.955385, -5.663702119364548, 0.0, -0.0, 0.0, 17325264.3383085, 5.000000000000001e-05, 101, 1, 1000)
#(fAH1, fAV1, fBH1, fBV1, info1) = catenary(0.0, 997.8909672113768, 1006.0699998926483, 361256000.00000006, 2.4952615384615333, 0, 0.0, 0, 0, 0.0001, 101, 100, 1, 1000)
(fAH1, fAV1, fBH1, fBV1, info1) = catenary(148.60942473375343, 1315.624259105325, 1279.7911844766932, 17497567581.802254, -81.8284437736437, CB=0.0, alpha=-0.0, HF0=795840.9590915733, VF0=6399974.444658389, Tol=0.0005, MaxIter=100, depth=1300.0, plots=1)
#(fAH1, fAV1, fBH1, fBV1, info1) = catenary(148.60942473375343, 1315.624259105325, 1279.7911844766932, 17497567581.802254, -81.8284437736437, CB=0.0, alpha=-0.0, HF0=795840.9590915733, VF0=6399974.444658389, Tol=0.0005, MaxIter=100, depth=1300.0, plots=1)
(fAH1, fAV1, fBH1, fBV1, info1) = catenary(2887.113193120885, -838.1577017360617, 2979.7592390255295, 41074520109.87981, 1104.878355564403, CB=0.0, alpha=81.41243787249468, HF0=0.0, VF0=3564574.0622291695, Tol=0.0005, MaxIter=100, depth=3000.0, plots=1)

#(fAH1, fAV1, fBH1, fBV1, info1) = catenary(274.9, 15.6, 328.5, 528887323., -121.,
# CB=-48., alpha=0, HF0=17939., VF0=20596., Tol=2e-05, MaxIter=100, plots=1)
Expand Down
2 changes: 2 additions & 0 deletions moorpy/line.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,8 @@ def staticSolve(self, reset=False, tol=0.0001, profiles=0):
w = np.linalg.norm(w_vec)
w_hat = w_vec/w

# >>> may need to adjust to handle case of buoyant vertical lines <<<

# get rotation matrix from gravity down to w_vec being down
if w_hat[0] == 0 and w_hat[1] == 0:
if w_hat[2] < 0:
Expand Down
22 changes: 21 additions & 1 deletion moorpy/subsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ def __init__(self, mooringSys=None, num=0, depth=0, rho=1025, g=9.81,
self.currentMod = 1
self.current = getFromDict(kwargs, 'current', shape=3)

self.shared = getFromDict(kwargs, 'shared', dtype=bool, default=False) # flag to indicate shared line
# flag to indicate shared line or suspended cable being modeled as symmetric
self.shared = getFromDict(kwargs, 'shared', dtype=bool, default=False)

self.span = getFromDict(kwargs, 'span', default=0) # horizontal end-end distance [m]
self.rad_fair = getFromDict(kwargs, 'rad_fair', default=0) # [m] fairlead radius [m]
self.z_fair = getFromDict(kwargs, 'z_fair' , default=0) # [m] fairlead z coord [m]
Expand Down Expand Up @@ -192,6 +194,7 @@ def makeGeneric(self, lengths, types, connectors=[], suspended=0):
# set end A location depending on whether configuration is suspended/symmetrical
if suspended==2: # symmetrical suspended case
rA = np.array([-0.5*self.span-self.rad_fair, 0, -1]) # shared line midpoint coordinates
self.shared = True # flag that it's being modeled as symmetric
elif suspended==1: # general suspended case
rA = np.array([-self.span-self.rad_fair, 0, self.z_fair]) # other suspended end
else: # normal anchored line case
Expand Down Expand Up @@ -323,11 +326,28 @@ def staticSolve(self, reset=False, tol=0, profiles=0):
Kt = -self.fB_L[0]/LH

# expand to get 3D stiffness matrices
'''
R = np.eye(3)
self.KA_L = from2Dto3Drotated(K[:2,:2], Kt, R.T) # reaction at A due to motion of A
self.KB_L = from2Dto3Drotated(K[2:,2:], Kt, R.T) # reaction at B due to motion of B
self.KBA_L = from2Dto3Drotated(K[2:,:2], -Kt, R.T) # reaction at B due to motion of A
'''
self.KA_L = np.array([[K[0,0], 0 , K[0,1]],
[ 0 , Kt, 0 ],
[K[1,0], 0 , K[1,1]]])

# If symmetrical model, ignore midpoint stiffness and force
if self.shared:
self.KB_L = np.array(self.KA_L) # same stiffness as A
self.fB_L = np.array([-self.fA_L[0], 0, self.fA_L[1]]) # mirror of fA
else:
self.KB_L = np.array([[K[2,2], 0 , K[2,3]],
[ 0 , Kt, 0 ],
[K[3,2], 0 , K[3,3]]])

self.KBA_L = -self.KB_L

# Save tension magnitudes
self.TA = np.linalg.norm(self.fA_L) # tensions [N]
self.TB = np.linalg.norm(self.fB_L)

Expand Down

0 comments on commit b5b9305

Please sign in to comment.