Skip to content

Commit

Permalink
More robust seabed slope support
Browse files Browse the repository at this point in the history
- Seabed slope for each Line is now calculated based
  on the depth beneath each endpoint (assuming a
  uniformly sloped seabed underneath the line) rather
  than looking at the panel slope under end A.
- This should be more robust by avoiding inconsistencies
  when lines cross panels, though could reduce accuracy
  for finer grids with Lines that only slightly touch.
  • Loading branch information
mattEhall committed Nov 20, 2024
1 parent 3867ccf commit 3b1b85b
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions moorpy/line.py
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,11 @@ def staticSolve(self, reset=False, tol=0.0001, profiles=0):
w_total = self.w


# horizontal and vertical dimensions of line profile (end A to B)
LH = np.linalg.norm(dr[:2])
LV = dr[2]


# apply a rotation about Z' to align the line profile with the X'-Z' plane
theta_z = -np.arctan2(dr[1], dr[0])
R_z = rotationMatrix(0, 0, theta_z)
Expand All @@ -802,8 +807,10 @@ def staticSolve(self, reset=False, tol=0.0001, profiles=0):
if self.rA[2] <= -depthA or self.rB[2] <= -depthB:
nvecA_prime = np.matmul(R, nvecA)

dz_dx = -nvecA_prime[0]*(1.0/nvecA_prime[2]) # seabed slope components
dz_dy = -nvecA_prime[1]*(1.0/nvecA_prime[2]) # seabed slope components
#dz_dx = -nvecA_prime[0]*(1.0/nvecA_prime[2]) # seabed slope components
#dz_dy = -nvecA_prime[1]*(1.0/nvecA_prime[2]) # seabed slope components
# Seabed slope along line direction (based on end A/B depth)
dz_dx = (-depthB + depthA)/LH
# we only care about dz_dx since the line is in the X-Z plane in this rotated situation
alpha = np.degrees(np.arctan(dz_dx))
cb = self.cb
Expand All @@ -815,10 +822,6 @@ def staticSolve(self, reset=False, tol=0.0001, profiles=0):
alpha = 0
cb = self.cb

# horizontal and vertical dimensions of line profile (end A to B)
LH = np.linalg.norm(dr[:2])
LV = dr[2]


# ----- call catenary function or alternative and save results -----

Expand Down

0 comments on commit 3b1b85b

Please sign in to comment.