Skip to content

Commit

Permalink
New sophisticated stiffness capabilities:
Browse files Browse the repository at this point in the history
- Proper description will be provided in a later commit that finishes these...
  • Loading branch information
mattEhall committed Sep 4, 2023
1 parent cb3ebf8 commit 1d36896
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 12 deletions.
25 changes: 17 additions & 8 deletions moorpy/MoorProps_default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,21 @@
# mass_d2 : # linear mass density per diameter^2 [kg/m^3]
# mass_d3 : # linear mass density per diameter^3 [kg/m^4]
#
# MBL_0 : # minimum breaking load offset [N]
# MBL_d : # minimum breaking load per diameter [N/m]
# MBL_d2 : # minimum breaking load per diameter^2 [N/m^2]
# MBL_d3 : # minimum breaking load per diameter^3 [N/m^3]
#
# EA_0 : # stiffness offset [N]
# EA_d : # stiffness per diameter [N/m]
# EA_d2 : # stiffness per diameter^2 [N/m^2]
# EA_d3 : # stiffness per diameter^3 [N/m^3]
# EA_MBL : # stiffness per MBL [N/N]
# EA_MBL or Kr # stiffness per MBL [N/N]
# EAs_MBL or Krs # quasi-static stiffness per MBL [N/N]
# EAd_MBL or Krd_alpha # dynamic stiffness per MBL [N/N]
# EAd_MBL_Lm or Krd_beta # dynamic stiffness per MBL per fraction of mean load (not %) [N/N]



NEW:
# Krs or EAs_MBL : # quasi-static stiffness per MBL [N/N]
Expand All @@ -21,11 +31,7 @@ NEW:
# (% mean load will be input later in the modeling code)


#
# MBL_0 : # minimum breaking load offset [N]
# MBL_d : # minimum breaking load per diameter [N/m]
# MBL_d2 : # minimum breaking load per diameter^2 [N/m^2]
# MBL_d3 : # minimum breaking load per diameter^3 [N/m^3]

#
# dvol_dnom : # volume-equivalent diameter per nominal diameter [-]
#
Expand Down Expand Up @@ -60,11 +66,14 @@ lineProps:

polyester : # polyester synthetic rope
mass_d2 : 797.8 # linear mass density per diameter^2 [kg/m^3]
EA_d2 : 1.09e9 # stiffness per diameter^2 [N/m^2]
#EA_d2 : 1.09e9 # stiffness per diameter^2 [N/m^2]
MBL_d2 : 170.5e6 # minimum breaking load per diameter^2 [N/m^2]
dvol_dnom : 0.86 # volume-equivalent diameter per nominal diameter [-]
cost_MBL : 1.65e-05 # cost per MBL [$/m/N]

EAs_MBL : 14 # quasi-static stiffness per MBL [N/N]
EAd_MBL : 14 # dynamic stiffness per MBL [N/N]
EAd_MBL_Lm : 0.34 # dynamic stiffness per MBL per fraction of mean load (not %) [N/N]

nylon : # nylon synthetic rope
mass_d2 : 647.6 # linear mass density per diameter^2 [kg/m^3]
EA_d2 : 1.18e8 # stiffness per diameter^2 [N/m^2]
Expand Down
12 changes: 11 additions & 1 deletion moorpy/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,11 @@ def getLineProps(dnommm, material, lineProps=None, source=None, name="", rho=102
+ mat['cost_mass']*mass + mat['cost_EA']*EA + mat['cost_MBL']*MBL)
w = (mass - np.pi/4*d_vol**2 *rho)*g

# >>> expected inputs for viscoelastic approach <<< need to add some kind of mode switch to handle this throughout MoorPy <<<<
EAs = mat['EAs_MBL']*MBL # quasi-static stiffness: Krs x MBL [N]
EAd = mat['EAd_MBL']*MBL # dynamic stiffness constant: Krd alpha term x MBL [N]
EAd_Lm = mat['EAd_MBL_Lm'] # dynamic stiffness Lm slope: Krd beta term (to be multiplied by mean load) [-]

# Set up a main identifier for the linetype unless one is provided
if name=="":
typestring = f"{type}{dnommm:.0f}"
Expand All @@ -697,7 +702,8 @@ def getLineProps(dnommm, material, lineProps=None, source=None, name="", rho=102
notes = f"made with getLineProps"

lineType = dict(name=typestring, d_vol=d_vol, m=mass, EA=EA, w=w,
MBL=MBL, cost=cost, notes=notes, input_type=type, input_d=d, material=material)
MBL=MBL, EAs=EAs, EAd=EAd, EAd_Lm=EAd_Lm, input_d=d,
cost=cost, notes=notes, input_type=type, material=material)

lineType.update(kwargs) # add any custom arguments provided in the call to the lineType's dictionary

Expand Down Expand Up @@ -755,6 +761,10 @@ def loadLineProps(source):
output[mat]['EA_d2' ] = getFromDict(props, 'EA_d2' , default=0.0)
output[mat]['EA_d3' ] = getFromDict(props, 'EA_d3' , default=0.0)
output[mat]['EA_MBL' ] = getFromDict(props, 'EA_MBL' , default=0.0)
output[mat]['EAs_MBL' ] = getFromDict(props, 'EAs_MBL' , default=0.0)
output[mat]['EAd_MBL' ] = getFromDict(props, 'EAd_MBL' , default=0.0)
output[mat]['EAd_MBL_Lm']= getFromDict(props, 'EAd_MBL_Lm',default=0.0)

output[mat]['MBL_0' ] = getFromDict(props, 'MBL_0' , default=0.0)
output[mat]['MBL_d' ] = getFromDict(props, 'MBL_d' , default=0.0)
output[mat]['MBL_d2' ] = getFromDict(props, 'MBL_d2' , default=0.0)
Expand Down
37 changes: 35 additions & 2 deletions moorpy/line.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@ def __init__(self, mooringSys, num, L, lineType, nSegs=100, cb=0, isRod=0, attac
self.number = num
self.isRod = isRod

self.L = L # line unstretched length
self.L = L # line unstretched length (may be modified if using nonlinear elasticity) [m]
self.L0 = L # line reference unstretched length [m]
self.type = lineType # dictionary of a System.lineTypes entry

self.EA = self.type['EA'] # use the default stiffness value for now (may be modified if using nonlinear elasticity) [N]

self.nNodes = int(nSegs) + 1
self.cb = float(cb) # friction coefficient (will automatically be set negative if line is fully suspended)
self.sbnorm = [] # Seabed Normal Vector (to be filled with a 3x1 normal vector describing seabed orientation)
Expand Down Expand Up @@ -799,7 +802,7 @@ def staticSolve(self, reset=False, tol=0.0001, profiles=0):
#If EA is found in the line properties we will run the original catenary function
if 'EA' in self.type:
try:
(fAH, fAV, fBH, fBV, info) = catenary(LH, LV, self.L, self.type['EA'], w,
(fAH, fAV, fBH, fBV, info) = catenary(LH, LV, self.L, self.EA, w,
CB=cb, alpha=alpha, HF0=self.HF, VF0=self.VF,
Tol=tol, nNodes=self.nNodes, plots=profiles)
except CatenaryError as error:
Expand Down Expand Up @@ -1039,11 +1042,41 @@ def getPosition(self, s):
Zs = self.rA[2] + z

return np.vstack([ Xs, Ys, Zs])


def attachLine(self, lineID, endB):
pass


def activateDynamicStiffness(self):
'''Switch mooring line model to dynamic line stiffness
value, including potential unstretched line length
adjustment. This only works when dynamic line properties
are used.'''

# switch to dynamic stiffness value
EA_old = self.type['EAs']
EA_new = self.type['EAd'] + self.type['EAd_Lm']*self.TA # this implements the sloped Krd = alpha + beta*Lm
self.EA = EA_new

# adjust line length to maintain current tension (approximate)
self.L = self.L0 * (1 + self.TB/EA_old)/(1+self.TB/EA_new)



def revertToStaticStiffness(self):
'''Switch mooring line model to dynamic line stiffness
values, including potential unstretched line length
adjustment. This only works when dynamic line properties
are used.'''

# switch to static/default stiffness value
self.EA = self.type['EA']

# revert to original line length
self.L = self.L0


def from2Dto3Drotated(K2D, F, L, R):
'''Initialize a line end's analytic stiffness matrix in the
plane of the catenary then rotate the matrix to be about the
Expand Down
25 changes: 24 additions & 1 deletion moorpy/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -2543,7 +2543,7 @@ def getCoupledStiffness(self, dx=0.1, dth=0.1, solveOption=1, lines_only=False,



def getCoupledStiffnessA(self, dx=0.1, dth=0.1, solveOption=1, lines_only=False, tensions=False, nTries=3, plots=0):
def getCoupledStiffnessA(self, lines_only=False, tensions=False, nTries=3, plots=0):
'''Calculates the stiffness matrix for coupled degrees of freedom of a mooring system
with free uncoupled degrees of freedom equilibrated - analytical appraoch.
Expand Down Expand Up @@ -2905,6 +2905,29 @@ def checkTensions(self, N = None):
return
return(ratios)


def activateDynamicStiffness(self):
'''Switch mooring system model to dynamic line stiffness
values, including potential unstretched line length
adjustment. This only works when dynamic line properties
are used.'''

for line in self.lineList:
line.activateDynamicStiffness()

#initialize?


def revertToStaticStiffness(self):
'''Switch mooring system model to dynamic line stiffness
values, including potential unstretched line length
adjustment. This only works when dynamic line properties
are used.'''

for line in self.lineList:
line.revertToStaticStiffness()

#initialize?

def getDepthFromBathymetry(self, x, y): #BathymetryGrid, BathGrid_Xs, BathGrid_Ys, LineX, LineY, depth, nvec)
''' interpolates local seabed depth and normal vector
Expand Down

0 comments on commit 1d36896

Please sign in to comment.