Skip to content

Commit fc3eed2

Browse files
committed
FFarm MD output function now assumes the project.ms is already converted to lines outside the function. For dynamic stiffness, if the user needs to apply external forces, they have to apply that AFTER converting ss2lines.
1 parent 587c21f commit fc3eed2

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

famodel/project.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4942,7 +4942,7 @@ def extractFarmInfo(self, cmax=5, fmax=10/6, Cmeander=1.9):
49424942

49434943
def FFarmCompatibleMDOutput(self, filename, MDoptionsDict=None, **kwargs):
49444944
'''
4945-
Function to create FFarm-compatible MoorDyn input file:
4945+
Function to create FFarm-compatible MoorDyn input file (assumes project.ms is already created and if subsystem converted to lines):
49464946
49474947
Parameters
49484948
----------
@@ -4997,8 +4997,7 @@ def FFarmCompatibleMDOutput(self, filename, MDoptionsDict=None, **kwargs):
49974997
MDoptionsDict = {}
49984998
from moorpy.helpers import ss2lines
49994999

5000-
# convert SS to lines
5001-
ms_temp = ss2lines(self.ms)
5000+
ms = self.ms
50025001

50035002
# Unrotate turbines if needed
50045003
if unrotateTurbines:
@@ -5012,18 +5011,9 @@ def FFarmCompatibleMDOutput(self, filename, MDoptionsDict=None, **kwargs):
50125011
# Setup nNodes of lines manually based on the segment length desired.
50135012
from moorpy.helpers import lengthAwareSegmentation
50145013

5015-
lengthAwareSegmentation(ms_temp.lineList, factor=factor)
5014+
lengthAwareSegmentation(ms.lineList, factor=factor)
50165015

5017-
# Remove anchors from ms_temp
5018-
bodies_to_be_deleted = []
5019-
for body in ms_temp.bodyList:
5020-
if body.r6[2] < 0:
5021-
# this is an anchor, remove it
5022-
bodies_to_be_deleted.append(body)
5023-
for body in bodies_to_be_deleted:
5024-
ms_temp.bodyList.remove(body)
5025-
5026-
ms_temp.unload(fileName=filename, phi=phi, dynamicStiffness=dynamicStiffness, MDoptionsDict=MDoptionsDict, outputList=outputList, flag=flag)
5016+
ms.unload(fileName=filename, phi=phi, dynamicStiffness=dynamicStiffness, MDoptionsDict=MDoptionsDict, outputList=outputList, flag=flag)
50275017

50285018
# rename Body to Turbine if needed
50295019
if renameBody:

0 commit comments

Comments
 (0)