@@ -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.
0 commit comments