Skip to content

Commit a4ab5f6

Browse files
committed
Updating addCreep functionality:
- it can import properties of the line from lineProps. - it checks for the properties of the line if it has a creep rate or not. if it does, we apply creep. - if the user did not define a specific creep_percent, it will apply creep based on the creep rate with an assumed design life of 28 years (EoL). - it also updates the line diameter as well depending on the stretch of the line (to keep nominal diameter the same).
1 parent 154a7f3 commit a4ab5f6

File tree

2 files changed

+31
-12
lines changed

2 files changed

+31
-12
lines changed

famodel/mooring/mooring.py

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,24 +1120,40 @@ def addCorrosion(self,corrosion_mm=10):
11201120
MBL_cor = sec['type']['MBL']
11211121
sec['type']['MBL'] = MBL_cor
11221122

1123-
def addCreep(self, creep_precent=0.02):
1123+
def addCreep(self, lineProps, creep_percent=None):
11241124
'''
11251125
Elongates the polyester lines (if exists) in the mooring by a certain creep percentage
11261126
11271127
Parameters
11281128
----------
1129-
creep_precent : float, optional
1130-
Percentage of creep elongation to add to polyester lines. The default is 0.02 (2%).
1131-
1129+
lineProps : dict
1130+
Dictionary of line properties from MoorProps yaml
1131+
creep_percent : float, optionals
1132+
Percentage of creep elongation to add to polyester lines. If not given, the creep rate from the lineProps dictionary will be used with a design life of 28.
11321133
'''
1134+
design_life = 28 # years - changeable later if needed
1135+
1136+
from moorpy.helpers import getLineProps
11331137
if self.ss:
11341138
for i, line in enumerate(self.ss.lineList):
1135-
if line.type['material']=='polyester':
1136-
L_creep = line.L * (1 + creep_precent)
1137-
self.setSectionLength(L_creep, i)
1139+
# check if the line type has a creep property in its MoorProps instead of checking for material name.
1140+
mat = line.type['material']
1141+
if mat not in lineProps:
1142+
raise ValueError(f'Line material {mat} not found in lineProps dictionary.')
1143+
else:
1144+
if lineProps[mat].get('creep_rate', False):
1145+
if not creep_percent:
1146+
creep_percent = lineProps[mat]['creep_rate'] * design_life # total creep over design life
1147+
L_creep = line.L * (1 + creep_percent)
1148+
self.setSectionLength(L_creep, i)
1149+
# Change the diameter size to account for creep thinning
1150+
1151+
d_nom_creep = line.type['d_nom'] / np.sqrt(1 + creep_percent)
1152+
lineType_creep = getLineProps(d_nom_creep, mat, lineProps)
1153+
line.type = lineType_creep # update line type with new diameter [not sure if that's what we need to do.]
11381154
else:
11391155
raise ValueError('Mooring subsystem must be created before adding creep.')
1140-
1156+
11411157
def getEnvelope(self,ang_spacing=45,SFs=True):
11421158
'''Computes the motion envelope of the Mooring based on the watch
11431159
circle(s) of what it's attached to. If those aren't already

famodel/project.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3534,22 +3534,25 @@ def getCorrosion(self,corr_th=10,lines='all'):
35343534
for ii,i in enumerate(idx):
35353535
self.mooringList[i].addCorrosion(corrosion_mm=corr_th)
35363536

3537-
def addCreep(self, creep_precent=0.02):
3537+
def addCreep(self, lineProps=None, creep_percent=None):
35383538
'''
35393539
Function to add creep to all mooring lines in the project
35403540
35413541
Parameters
35423542
----------
3543-
creep_precent : float, optional
3544-
Percentage of line length to add as creep. The default is 0.02 (2%).
3543+
creep_percent : float, optional
3544+
Percentage of line length to add as creep. If not given, the creep rate from the lineProps dictionary will be used with a design life of 28.
35453545
35463546
Returns
35473547
-------
35483548
None.
35493549
35503550
'''
3551+
if lineProps is None:
3552+
lineProps = self.ms.lineProps
35513553
for moor in self.mooringList.values():
3552-
moor.addCreep(creep_precent=creep_precent)
3554+
moor.addCreep(lineProps=lineProps, creep_percent=creep_percent)
3555+
35533556

35543557
def updateUniformArray(self,n_rows,pf_rows,spacingXY,grid_rotang=0,grid_skew_x=0,grid_skew_y=0,grid_trans_x=0,grid_trans_y=0,phis=[0,0],center=[0,0]):
35553558
'''

0 commit comments

Comments
 (0)