Skip to content

Commit

Permalink
Modified system.unload for visco-elastic stiffness
Browse files Browse the repository at this point in the history
-uses optional mean load input to the unload function
  • Loading branch information
erickaloz committed Nov 15, 2023
1 parent 2645ac8 commit fb4abec
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions moorpy/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@ def readBathymetryFile(self, filename):



def unload(self, fileName, MDversion=2, line_dL=0, rod_dL=0, flag='p', outputList=[]):
def unload(self, fileName, MDversion=2, line_dL=0, rod_dL=0, flag='p', outputList=[], Lm = 0):
'''Unloads a MoorPy system into a MoorDyn-style input file
Parameters
Expand All @@ -984,6 +984,8 @@ def unload(self, fileName, MDversion=2, line_dL=0, rod_dL=0, flag='p', outputLis
Optional specified for target segment length when discretizing Rods
outputList : list of strings, optional
Optional list of additional requested output channels
Lm : float
Mean load on mooring line as percentage of MBL, used for dynamic stiffness calculation. Only used if line type has a nonzero EAd
Returns
-------
Expand Down Expand Up @@ -1201,8 +1203,18 @@ def unload(self, fileName, MDversion=2, line_dL=0, rod_dL=0, flag='p', outputLis
for key, lineType in self.lineTypes.items():
di = lineTypeDefaults.copy() # start with a new dictionary of just the defaults
di.update(lineType) # then copy in the lineType's existing values
L.append("{:<12} {:7.4f} {:8.2f} {:7.3e} {:7.3e} {:7.3e} {:<7.3f} {:<7.3f} {:<7.2f} {:<7.2f}".format(
key, di['d_vol'], di['m'], di['EA'], di['BA'], di['EI'], di['Cd'], di['Ca'], di['CdAx'], di['CaAx']))
if di['EAd'] > 0:
if Lm > 0:
print('Calculating dynamic stiffness with Lm = ' + str(Lm)+'% of MBL')
L.append("{:<12} {:7.4f} {:8.2f} {:7.3e}|{:7.3e} 4E9|11e6 {:7.3e} {:<7.3f} {:<7.3f} {:<7.2f} {:<7.2f}".format(
key, di['d_vol'], di['m'], di['EA'], di['EAd'] + di['EAd_Lm']*Lm*di['MBL'], di['EI'], di['Cd'], di['Ca'], di['CdAx'], di['CaAx']))
else:
print('No mean load provided!!! using the static EA value ONLY')
L.append("{:<12} {:7.4f} {:8.2f} {:7.3e} {:7.3e} {:7.3e} {:<7.3f} {:<7.3f} {:<7.2f} {:<7.2f}".format(
key, di['d_vol'], di['m'], di['EA'], di['BA'], di['EI'], di['Cd'], di['Ca'], di['CdAx'], di['CaAx']))
else:
L.append("{:<12} {:7.4f} {:8.2f} {:7.3e} {:7.3e} {:7.3e} {:<7.3f} {:<7.3f} {:<7.2f} {:<7.2f}".format(
key, di['d_vol'], di['m'], di['EA'], di['BA'], di['EI'], di['Cd'], di['Ca'], di['CdAx'], di['CaAx']))


L.append("--------------------- ROD TYPES -----------------------------------------------------")
Expand Down

0 comments on commit fb4abec

Please sign in to comment.