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
Function to create FFarm-compatible MoorDyn input file:
4811
4812
4812
4813
Parameters
4813
4814
----------
4814
4815
filename : str
4815
4816
Name of the MoorDyn output file (.dat)
4816
-
unrotateTurbines: bool, optional
4817
-
A flag to unrotate turbine (body) objects when passing it to MoorPy unload function [FFarm takes fairlead points in the local-unrotated reference frame]
4818
-
renameBody: bool, optional
4819
-
A flag to rename `Body` objects in the output MD file into `Turbine` to be compatible with FFarm.
4820
-
removeBody: boo., optional
4821
-
A flag to remove 'Body' objects in the Bodies list in the output MD file to be compatible with FFarm.
4822
-
MDoptionsDict: dictionary, optional
4823
-
MoorDyn Options. If not given, default options are considered.
4824
-
'''
4825
-
frommoorpy.helpersimportsubsystem2Line
4817
+
MDoptionsDict: dict, optional
4818
+
MoorDyn Options. If not given, default options are considered.
4819
+
**kwargs : optional
4820
+
unrotateTurbines : bool
4821
+
A flag to unrotate turbine (body) objects when passing it to MoorPy unload function
4822
+
[FFarm takes fairlead points in the local-unrotated reference frame]
4823
+
renameBody : bool
4824
+
A flag to rename `Body` objects in the output MD file into `Turbine` to be compatible with FFarm.
4825
+
removeBody : bool
4826
+
A flag to remove 'Body' objects in the Bodies list in the output MD file to be compatible with FFarm.
4827
+
outputList : dict
4828
+
Output options for MoorDyn.
4829
+
bathymetryFile : str
4830
+
Path to bathymetry file.
4831
+
flag : str
4832
+
Extra flag to append to MD entries.
4833
+
'''
4834
+
4835
+
# --- Default values ---
4836
+
defaults= {
4837
+
"unrotateTurbines": True,
4838
+
"renameBody": True,
4839
+
"removeBody": True,
4840
+
"outputList": [],
4841
+
"bathymetryFile": None,
4842
+
"flag": "-"
4843
+
}
4844
+
4845
+
# Merge defaults with kwargs
4846
+
opts= {**defaults, **kwargs}
4847
+
4848
+
# Assign variables for convenience
4849
+
unrotateTurbines=opts["unrotateTurbines"]
4850
+
renameBody=opts["renameBody"]
4851
+
removeBody=opts["removeBody"]
4852
+
outputList=opts["outputList"]
4853
+
bathymetryFile=opts["bathymetryFile"]
4854
+
flag=opts["flag"]
4855
+
4856
+
ifMDoptionsDictisNone:
4857
+
MDoptionsDict= {}
4858
+
frommoorpy.helpersimportss2lines
4826
4859
4827
4860
# convert SS to lines
4828
-
ms_temp=deepcopy(self.ms) # copy to avoid affecting self.ms
0 commit comments