You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1) Passing important settings into the unload function in moorpy to generate a moordyn file with some custom output options.
2) Depending on the lenght of the line, the function will choose an appropriate number of segments for that line
Function to create FFarm-compatible MoorDyn input file:
4340
4340
4341
4341
Parameters
4342
4342
----------
4343
4343
filename : str
4344
4344
Name of the MoorDyn output file (.dat)
4345
-
unrotateTurbines: bool, optional
4346
-
A flag to unrotate turbine (body) objects when passing it to MoorPy unload function [FFarm takes fairlead points in the local-unrotated reference frame]
4347
-
renameBody: bool, optional
4348
-
A flag to rename `Body` objects in the output MD file into `Turbine` to be compatible with FFarm.
4349
-
removeBody: boo., optional
4350
-
A flag to remove 'Body' objects in the Bodies list in the output MD file to be compatible with FFarm.
4351
-
MDoptionsDict: dictionary, optional
4352
-
MoorDyn Options. If not given, default options are considered.
4353
-
'''
4354
-
frommoorpy.helpersimportsubsystem2Line
4345
+
MDoptionsDict: dict, optional
4346
+
MoorDyn Options. If not given, default options are considered.
4347
+
**kwargs : optional
4348
+
unrotateTurbines : bool
4349
+
A flag to unrotate turbine (body) objects when passing it to MoorPy unload function
4350
+
[FFarm takes fairlead points in the local-unrotated reference frame]
4351
+
renameBody : bool
4352
+
A flag to rename `Body` objects in the output MD file into `Turbine` to be compatible with FFarm.
4353
+
removeBody : bool
4354
+
A flag to remove 'Body' objects in the Bodies list in the output MD file to be compatible with FFarm.
4355
+
outputList : dict
4356
+
Output options for MoorDyn.
4357
+
bathymetryFile : str
4358
+
Path to bathymetry file.
4359
+
flag : str
4360
+
Extra flag to append to MD entries.
4361
+
'''
4362
+
4363
+
# --- Default values ---
4364
+
defaults= {
4365
+
"unrotateTurbines": True,
4366
+
"renameBody": True,
4367
+
"removeBody": True,
4368
+
"outputList": [],
4369
+
"bathymetryFile": None,
4370
+
"flag": "-"
4371
+
}
4372
+
4373
+
# Merge defaults with kwargs
4374
+
opts= {**defaults, **kwargs}
4375
+
4376
+
# Assign variables for convenience
4377
+
unrotateTurbines=opts["unrotateTurbines"]
4378
+
renameBody=opts["renameBody"]
4379
+
removeBody=opts["removeBody"]
4380
+
outputList=opts["outputList"]
4381
+
bathymetryFile=opts["bathymetryFile"]
4382
+
flag=opts["flag"]
4383
+
4384
+
ifMDoptionsDictisNone:
4385
+
MDoptionsDict= {}
4386
+
frommoorpy.helpersimportss2lines
4355
4387
4356
4388
# convert SS to lines
4357
-
ms_temp=deepcopy(self.ms) # copy to avoid affecting self.ms
0 commit comments