Skip to content

Commit d5bfef2

Browse files
committed
Outlined an Anchor.calcAnchorLoads function
- It's commented out and a work in progress - Also made a tiny updated to the comments in famodel_base
1 parent b0f70e9 commit d5bfef2

File tree

2 files changed

+94
-5
lines changed

2 files changed

+94
-5
lines changed

famodel/anchors/anchor.py

Lines changed: 89 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,95 @@ def makeMoorPyAnchor(self, ms):
304304
self.mpAnchor.entity = pointType
305305

306306
return ms
307-
307+
308+
"""
309+
def calcAnchorLoads(self, level=0):
310+
'''Compute anchor load envelope based on available information.
311+
The 'level' input sets the type of analysis. Currently supported:
312+
level 0 : quasi-static analysis based on mean offsets and surge
313+
motion amplitudes.
314+
'''
315+
316+
# Identify attached moorings and platforms
317+
moorings = []
318+
platforms = []
319+
for att in self.attachments.values():
320+
if isinstance(att['obj'], Mooring):
321+
moorings.append(att)
322+
323+
# get the platform on the other end of the mooring
324+
platform = att.attached_to[1-att[['end']]
325+
326+
# if it's a normal platform, just save it
327+
if ...
328+
platforms.append(platform)
329+
# if it's something else (like a buoy), get the platforms attached to it!
330+
else:
331+
for att2 in platform.attachments.values():
332+
if isinstance(att2['obj'], Mooring) and not att2==att: # look through each other mooring
333+
...
334+
335+
moorings = [att for att in self.attachments.values() if isinstance(att['obj'], Mooring)]
336+
337+
# Calculate the loading envelope on the anchor
338+
if level==0: # quasi-static analysis
339+
loads = []
340+
341+
# Look at a worst-case loads along each mooring direction
342+
for mooring in moorings:
343+
# get direction of mooring from anchor
344+
heading = mooring. ...
345+
346+
347+
# --- worst horizontal load ---
348+
349+
# Apply maximum steady load in that direction on each platform
350+
for platform in platforms:
351+
platform.body.f6ext = platform.maxLoad...
352+
353+
# Compute array MoorPy system mean offset positions due to applied loads
354+
# ms.solveEquilibrium(DOFtype='both')
355+
356+
# Add motion amplitude in loading direction to the mean offsets of each platform
357+
for platform in platforms:
358+
# platform.x_amp is if we somehow stored max surge amplitude info in each platform <<<
359+
x = platform.x_amp*np.cos(heading) # displacement amplitude in x
360+
y = platform.x_amp*np.sin(heading) # displacement amplitude in y
361+
platform.body.r6 += np.array([ x, y, 0,0,0,0])
362+
363+
# Compute mooring tensions based on these positions, the sum up anchor tensions
364+
# ms.solveEquilibrium(...
365+
loads.append(self.mpAnchor.getForces())
366+
367+
368+
# --- worst vertical load (assumes one upwind platform is failed/unloaded) ---
369+
370+
# figure out which platform is most upwind and remove it's external load
371+
idle_platform = ...
372+
idle_platform.body.f6ext = np.zeros(3)
373+
374+
# Compute array MoorPy system mean offset positions due to applied loads
375+
# ms.solveEquilibrium(DOFtype='both')
376+
377+
# Add motion amplitude in spreading-out direction to the mean offsets of each platform
378+
for platform in platforms:
379+
x_amp = platform.x_amp
380+
heading_to_platform = ...
381+
x = x_amp*np.cos(heading_to_platform) # displacement amplitude in x
382+
y = x_amp*np.sin(heading_to_platform) # displacement amplitude in y
383+
platform.body.r6 += np.array([ x, y, 0,0,0,0])
384+
385+
# Compute mooring tensions based on these positions, the sum up anchor tensions
386+
# ms.solveEquilibrium(...
387+
loads.append(self.mpAnchor.getForces())
388+
389+
390+
# maybe process the loads to make an envelope of the worst horizontal-vertical loads
391+
392+
else:
393+
raise Exception('Only level 0 is supported so far')
394+
"""
395+
308396
def getLineProperties(self):
309397
'''
310398
Retrieve line_type, diameter and unit weight from attached mooring.

famodel/famodel_base.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,11 @@ class Node():
7777
7878
Its attachments dictionary has the following format for each entry:
7979
80-
id : { 'ref' : , #
81-
'r_rel' : , #
82-
'type' : # Node or Edge
83-
80+
id : { 'obj' : the reference to the object itself
81+
id : { 'id' : the object's id
82+
'r_rel' : the relative position of the object to the Node
83+
'type' : node or edge
84+
'end' : for Edge objects only, whether end A (0) or B (1) is attached
8485
8586
For grouped/multilevel edges, connections are stored at the highest level,
8687
so 'ref' would be to the highest level edge object.

0 commit comments

Comments
 (0)