Skip to content

Commit

Permalink
Viscoelastic unload fixes
Browse files Browse the repository at this point in the history
- changed Lm so that it is fraction of mean load
- looks for 'EAd' key first so that it won't fail if key doesn't exist
  • Loading branch information
erickaloz committed Nov 20, 2023
1 parent a783b97 commit 2e0cd01
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions moorpy/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,7 @@ def unload(self, fileName, MDversion=2, line_dL=0, rod_dL=0, flag='p', outputLis
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
Mean load on mooring line as FRACTION of MBL, used for dynamic stiffness calculation. Only used if line type has a nonzero EAd
Returns
-------
Expand Down Expand Up @@ -1203,9 +1203,9 @@ 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
if di['EAd'] > 0:
if 'EAd' in di.keys() and di['EAd'] > 0:
if Lm > 0:
print('Calculating dynamic stiffness with Lm = ' + str(Lm)+'% of MBL')
print('Calculating dynamic stiffness with Lm = ' + str(Lm)+'* 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:
Expand Down

0 comments on commit 2e0cd01

Please sign in to comment.