Skip to content

Commit c3af129

Browse files
Merge pull request #225 from FloatingArrayDesign/dev
v2.3.2
2 parents a9297c8 + c3886d3 commit c3af129

30 files changed

+891
-316
lines changed

.github/workflows/python-wheels-manylinux-arch.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
platforms: all
5454

5555
- name: Build wheels
56-
uses: pypa/cibuildwheel@v2.18.1
56+
uses: pypa/cibuildwheel@v2.19.1
5757
with:
5858
output-dir: dist
5959
env:

.github/workflows/python-wheels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
if: runner.os == 'Linux'
8282

8383
- name: Build wheels
84-
uses: pypa/cibuildwheel@v2.18.1
84+
uses: pypa/cibuildwheel@v2.19.1
8585
with:
8686
output-dir: dist
8787
env:

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
cmake_minimum_required(VERSION 3.10)
22
set(MOORDYN_MAJOR_VERSION 2)
33
set(MOORDYN_MINOR_VERSION 3)
4-
set(MOORDYN_PATCH_VERSION 1)
4+
set(MOORDYN_PATCH_VERSION 2)
55
set(MOORDYN_VERSION ${MOORDYN_MAJOR_VERSION}.${MOORDYN_MINOR_VERSION})
66
project(Moordyn VERSION ${MOORDYN_VERSION})
77

88
set(CMAKE_CXX_STANDARD 17)
99
set(CMAKE_CXX_STANDARD_REQUIRED True)
1010
add_compile_definitions("MOORDYN_MAJOR_VERSION=${MOORDYN_MAJOR_VERSION}")
1111
add_compile_definitions("MOORDYN_MINOR_VERSION=${MOORDYN_MINOR_VERSION}")
12+
add_compile_definitions("MOORDYN_PATCH_VERSION=${MOORDYN_PATCH_VERSION}")
1213
set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME Runtime)
1314

1415
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
MoorDyn v2
22
==========
33

4+
**This repository is for MoorDyn-C.**
5+
46
MoorDyn is a lumped-mass model for simulating the dynamics of mooring systems connected to floating offshore structures. As of 2022 it is available under the BSD 3-Clause
57
license.
68

79
Read the docs here: [moordyn.readthedocs.io](https://moordyn.readthedocs.io/en/latest/)
810

9-
It accounts for internal axial stiffness and damping forces, weight and buoyancy forces, hydrodynamic forces from Morison's equation (assuming calm water so far), and vertical spring-damper forces from contact with the seabed. MoorDyn's input file format is based on that of [MAP](https://www.nrel.gov/wind/nwtc/map-plus-plus.html). The model supports arbitrary line interconnections, clump weights and floats, different line properties, and six degree of freedom rods.
11+
It accounts for internal axial stiffness and damping forces, weight and buoyancy forces, hydrodynamic forces from Morison's equation (assuming calm water so far), and vertical spring-damper forces from contact with the seabed. MoorDyn's input file format is based on that of [MAP](https://www.nrel.gov/wind/nwtc/map-plus-plus.html). The model supports arbitrary line interconnections, clump weights and floats, different line properties, and six degree of freedom rods and bodies.
1012

11-
MoorDyn is implemented both in Fortran and in C++. The Fortran version of MoorDyn (MoorDyn-F) is a core module in [OpenFAST](https://github.com/OpenFAST/openfast) and can be used as part of an OpenFAST or FAST.Farm simulation, or used in a standalone form. The C++ version of MoorDyn (MoorDyn-C) is more adaptable to different use cases and couplings. It can be compiled as a dynamically-linked library or wrapped for use in Python (as a module), Fortran, or Matlab. It features simpler functions for easy coupling with models or scripts coded in C/C++, Fortran, Matlab/Simulink, etc., including a coupling with [WEC-Sim](https://wec-sim.github.io/WEC-Sim/master/index.html).
13+
MoorDyn is implemented both in Fortran and in C++. The Fortran version of MoorDyn (MoorDyn-F) is a core module in [OpenFAST](https://github.com/OpenFAST/openfast) and can be used as part of an OpenFAST or FAST.Farm simulation, or used in a standalone form. The C++ version of MoorDyn (MoorDyn-C) is more adaptable to different use cases and couplings. It can be compiled as a dynamically-linked library or wrapped for use in Python (as a module), Fortran, or Matlab. It features simpler functions for easy coupling with models or scripts coded in C/C++, Fortran, Matlab/Simulink, etc., including a coupling with [WEC-Sim](https://wec-sim.github.io/WEC-Sim/master/index.html). Users should take care to ensure their input file format matches the respective version of MoorDyn they are trying to use. Details on the input file differences can be found in the [documentation](https://moordyn.readthedocs.io/en/latest/inputs.html).
1214

1315
Both forms of MoorDyn feature the same underlying mooring model, use the same input and output conventions, and are being updated and improved in parallel. They follow the same version numbering, with a "C" or "F" suffix for differentiation.
1416

docs/compiling.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Windows
104104
^^^^^^^
105105

106106
This section will show how to install Eigen3 and MoorDyn in the default folders
107-
(C:\Program Files (x86)\Eigen3 and C:\Program Files (x86)\Moordyn) using CMake
107+
(``C:\Program Files (x86)\Eigen3`` and ``C:\Program Files (x86)\Moordyn``) using CMake
108108
This documentation assumes that you are building in an MSYS2 build environment.
109109

110110
Install the following necessary tools:
@@ -159,7 +159,7 @@ the Git window select "Clone Existing Repository".
159159

160160
The Git GUI to clone repositories
161161

162-
As a default, MoorDyn uses the Egien package that is internal in the source code.
162+
As a default, MoorDyn uses the Eigen package that is internal in the source code.
163163
If you would like to use an external copy of Eigen, please follow the instructions
164164
in the :ref:`installing with external eigen <external_eigen>` note at this point.
165165

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@
4343
# -- Project information -----------------------------------------------------
4444

4545
project = 'MoorDyn'
46-
copyright = '2023, National Renewable Energy Laboratory'
46+
copyright = '2024, National Renewable Energy Laboratory'
4747
author = 'Matt Hall'
4848

4949
# The full version, including alpha/beta/rc tags
50-
release = '2.2.2'
50+
release = '2.3.1' # TODO: can we automate this?
5151

5252

5353
# -- General configuration ---------------------------------------------------

docs/drivers.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -799,9 +799,9 @@ Originally, it was coupled to a modified form of FAST v7.
799799
WEC-Sim
800800
^^^^^^^
801801

802-
WEC-Sim is currently coupled with MoorDyn v1. Support for the current version of
803-
MoorDyn-C v2, is in the process of being developed. The WEC-Sim source code can be found
804-
`here <https://github.com/WEC-Sim/WEC-Sim>`_.
802+
WEC-Sim is coupled with MoorDyn-C v2 as of Spring 2024 with `WEC-Sim PR #1212 <https://github.com/WEC-Sim/WEC-Sim/pull/1212>`_.
803+
The original coupling was with MoorDyn v1 and the the publication can be found in the
804+
:ref:`theory section <theory>`. The WEC-Sim source code can be found `here <https://github.com/WEC-Sim/WEC-Sim>`_.
805805

806806
DualSPHysics
807807
^^^^^^^^^^^^

docs/index.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ The pages on this site provide information
3333
about :ref:`compiling <compiling>`, MoorDyn's :ref:`input files <inputs>`,
3434
how to :ref:`drive a simulation <drivers>`, how MoorDyn is :ref:`structured <structure>`,
3535
and its :ref:`theory <theory>`. MoorDyn is available in multiple forms,
36-
which are outlined below.
36+
which are outlined below. The *latest* version of the docs is kept up-to-date with the
37+
dev branches of both MoorDyn-C and MoorDyn-F. The *master* version of the docs is up to date with
38+
the `latest MoorDyn-C release <https://github.com/FloatingArrayDesign/MoorDyn/releases>`_.
3739

3840
Note: This documentation is meant for users, a
3941
`Doxygen documentation <./doxygen/html/index.html>`_ has been deployed for the

docs/inputs.rst

Lines changed: 79 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -230,14 +230,15 @@ changes from V1.
230230

231231
Most helpfully, this new format is identical between C++ and FORTRAN versions of
232232
MoorDyn, and it is designed to support future capability enhancements without
233-
requiring changes.
233+
requiring format changes.
234234

235235
This file is divided into sections, some of which are optional. Each section is
236236
identified (and detected) by a header line consisting of a key phrase (e.g. Line
237237
Types) surrounded by dashes. While a couple sections are optional, the order of
238238
the sections cannot be changed. The exact whitespace and alignment of the lines of the file is not
239239
important, as long as values are separated by at least one space. However, every column must have
240-
a value.
240+
a value. MoorDyn only reads the values of each column, not the column headers or units. The column
241+
identifiers and units can be changed by the user but should use similar names to retain readability.
241242

242243
To successfully run a simulation, MoorDyn requires at least one line. If you are aiming to simulate
243244
a system with no lines, the best approach is to create a short taut vertical line stretched between
@@ -397,7 +398,7 @@ outputs are wanted. Eight output properties are currently possible:
397398

398399
- p – node positions
399400
- v – node velocities
400-
- U – wave velocities at each node
401+
- U – wave/current velocities at each node
401402
- D – hydrodynamic drag force at each node
402403
- t – tension force at each segment
403404
- c – internal damping force at each segment
@@ -471,7 +472,7 @@ outputs are wanted. Eight output properties are currently possible:
471472

472473
- p – node positions
473474
- v – node velocities
474-
- U – wave velocities at each node
475+
- U – wave/current velocities at each node
475476
- D – hydrodynamic drag force at each node
476477
- t – tension force at each segment
477478
- c – internal damping force at each segment
@@ -492,7 +493,7 @@ multiple failures for a given point, but duplicate failure configurations will b
492493
If two lines attached to a point are listed to fail (failure 1 for example), then after the failure
493494
the lines will remain attached to each other by a free point. In this multi line case, if any line
494495
reaches the tension threshold then the failure will be triggered. The theory behind failures can be
495-
found :ref:`here <version2>`.
496+
found :ref:`here <theory>`.
496497

497498
.. code-block:: none
498499
@@ -506,8 +507,8 @@ found :ref:`here <version2>`.
506507
Control (MoorDyn-F only)
507508
^^^^^^^^^^^^^^^^^^^^^^^^
508509

509-
This section (optional) is only available for MoorDyn-F and describes the control channels of the
510-
system.
510+
This section (optional) is only available for MoorDyn-F and describes which lines are assigned to
511+
which control channel in the ServoDyn input file.
511512

512513
.. code-block:: none
513514
@@ -517,6 +518,11 @@ system.
517518
1 1,2,3,4
518519
2 5
519520
521+
In the example above channel 1 is used to control lines 1-4 and channel 2 is used to control line 5.
522+
These channel numbers must correspond to control channels in the ServoDyn input file. The ServoDyn
523+
summary file (enabled with ``SumPrint`` option) will contain a list of all cable control channels in
524+
use and what they are assigned to.
525+
520526
Options
521527
^^^^^^^
522528

@@ -525,17 +531,22 @@ This section (required) describes the simulation options
525531
.. code-block:: none
526532
527533
---------------------- OPTIONS -----------------------------------------
534+
1 writeLog Write log file
528535
0.002 dtM time step to use in mooring integration (s)
529536
3000000 kbot bottom stiffness (Pa/m)
530537
300000 cbot bottom damping (Pa-s/m)
531538
0.5 dtIC time interval for analyzing convergence during IC gen (s)
532539
10 TmaxIC max time for ic gen (s)
533540
0.001 threshIC threshold for IC convergence (-)
534541
535-
Any of these lines can be omitted, in which case default values will be used (shown in
536-
parentheses). Default value swith a C or an F indicates which version has that as the default.
537-
As such, they are all optional settings, although some of them (such as time step
538-
size) often needs to be set by the user for proper operation. The list of possible options is:
542+
The options list differs from the other sections in that it uses a value + key approach.
543+
MoorDyn reads in the value, and then assigns it to the corresponding key. This means the
544+
order of the options list does not matter, however any options listed above the ``writeLog``
545+
flag will not be included in the log file. Any of these option lines can be omitted, in which
546+
case default values will be used (shown in parentheses). Default values with a C or a F
547+
indicate which version has that as the default. As such, they are all optional settings, although
548+
some of them (such as time step size) often needs to be set by the user for proper operation.
549+
The list of possible options is:
539550

540551
- writeLog (0 C, -1 F): If >0 a log file is written recording information. The bigger the number
541552
the more verbose. Please, be mindful that big values would critically reduce the performance!
@@ -633,7 +644,6 @@ shown below) for MoorDyn to know when to stop reading inputs.
633644
ANCHTEN1
634645
ANCHTEN2
635646
ANCHTEN3
636-
END
637647
------------------------- need this line -------------------------------------
638648
639649
The avaible output flags are decribed in the table below:
@@ -686,6 +696,9 @@ Footnotes:
686696
- There are a couple additional outputs left over from OpenFAST conventions that don’t follow the
687697
same format: FairTen and AnchTen. FairTen[n] is the same as Line[n]TenB. For example, the
688698
fairlead tension of line 1 would be FAIRTEN1 or LINE1TENB.
699+
- The output list is not case sensistive, however all MoorDyn-F outputs will be printed to the output
700+
file in all caps. When searching OpenFAST output channels, users will need to search for MoorDyn
701+
channels in all caps. Example: the channel fairten1 would appear in the output file as FAIRTEN1.
689702

690703
1. Line node forces: Line node forces output the net force on the node, which includes the tension
691704
vectors of the adjacent segments plus the weight, buoyancy, seabed-contact, and hydrodynamic
@@ -867,12 +880,18 @@ data. Details on this format can be found in the :ref:`water kinematics section
867880
MoorDyn with FAST.Farm - Inputs
868881
-------------------------------
869882

870-
In FAST.Farm, a new ability to use MoorDyn at the array level to simulate shared mooring systems
871-
has been developed. Until the main branch of OpenFAST, the FAST.Farm capability, and the MoorDyn-C
872-
capability are merged, the shared moorings capability in FAST.Farm uses the MoorDyn v1 input file
873-
format, with a small adjustment to reference attachments to multiple turbines.
883+
MoorDyn is available at an array level in FAST.Farm using the MoorDyn-F v2 input file format.
884+
A nice description of FAST.Farm is found on the OpenFAST repository README:
885+
886+
"FAST.Farm extends the capabilities of OpenFAST to provide physics-based engineering simulation
887+
of multi-turbine land-based, fixed-bottom offshore, and floating offshore wind farms. With
888+
FAST.Farm, you can simulate each wind turbine in the farm with an OpenFAST model and capture
889+
the relevant physics for prediction of wind farm power performance and structural loads, including
890+
wind farm-wide ambient wind, super controller, and wake advection, meandering, and merging.
891+
FAST.Farm maintains computational efficiency through parallelization to enable loads analysis for
892+
predicting the ultimate and fatigue loads of each wind turbine in the farm."
874893

875-
https://github.com/mattEhall/openfast/tree/f/fast-farm
894+
FAST.Farm can be obtained from the `OpenFAST repository <https://github.com/OpenFAST/openfast/tree/main>`_.
876895

877896
General Organization
878897
^^^^^^^^^^^^^^^^^^^^
@@ -882,46 +901,72 @@ FAST.Farm. This ability can be used for any non-shared mooring lines in all case
882901
simulation of shared mooring lines, which are coupled with multiple turbines, an additional
883902
farm-level MoorDyn instance has been added. This MoorDyn instance is not associated with any
884903
turbine but instead is called at a higher level by FAST.Farm. Attachments to different turbines
885-
within this farm-level MoorDyn instance are handled by specifying "TurbineN" as the type for any
886-
points that are attached to a turbine, where "N" is the specific turbine number as listed in the
887-
FAST.Farm input file.
904+
within this farm-level MoorDyn instance are handled by specifying "TurbineN" as the attachment for any
905+
points/bodies/rods that are attached to a turbine, where "N" is the specific turbine number as listed in the
906+
FAST.Farm input file. Pinned bodies and rods are not yet supported in FAST.Farm.
888907

889908
MoorDyn Input File
890909
^^^^^^^^^^^^^^^^^^
891910

892911
The following input file excerpt shows how points can be specified as attached to specific turbines
893-
(turbines 3 and 4 in this example). When a point has "TurbineN" as its type, it acts similarly to a
894-
"Vessel" type, where the X/Y/Z inputs specify the relative location of the fairlead on the platform.
895-
In the farm-level MoorDyn input file, "Vessel" point types cannot be used because it is ambiguous
896-
which turbine they attach to.
912+
(turbines 3 and 4 in this example). When a point has "TurbineN" as its attachment, it acts similarly to a
913+
"BodyN" attachment, where the X/Y/Z inputs specify the relative location of the fairlead on the platform.
914+
ex. For a turbine located at (200, 0, 0), a vertical line attached to it's center would have
915+
a fixed point at end A at (200, 0, 0) and a turbineN point at (0, 0, 0). In the farm-level MoorDyn input
916+
file, "Coupled" point types cannot be used because it is ambiguous which turbine they attach to.
897917

898918
.. code-block:: none
899-
:emphasize-lines: 5,6,12
919+
:emphasize-lines: 5,6,11
900920
901921
----------------------- POINTS ----------------------------------------------
902-
Node Type X Y Z M V CdA CA
922+
Node Attachment X Y Z M V CdA CA
903923
(-) (-) (m) (m) (m) (kg) (m^3) (m^2) (-)
904924
1 Turbine3 10.0 0 -10.00 0 0 0 0
905925
3 Turbine4 -10.0 0 -10.00 0 0 0 0
906926
2 Fixed 267.0 80 -70.00 0 0 0 0
907927
-------------------------- LINE PROPERTIES ----------------------------------
908-
2 NLines - the number of lines
909-
Line LineType UnstrLen NumSegs NodeA NodeB Flags/Outputs
910-
(-) (-) (m) (-) (-) (-) (-)
911-
1 sharedchain 300.0 20 1 2 p
912-
2 anchorchain 300.0 20 1 3 p
928+
ID LineType AttachA AttachB UnstrLen NumSegs LineOutputs
929+
(-) (-) (-) (-) (m) (-) (-)
930+
1 sharedchain 1 2 300.0 20 p
931+
2 anchorchain 1 3 300.0 20 p
913932
914933
In this example, Line 1 is a shared mooring line and Line 2 is an anchored mooring line that has a
915934
fairlead point in common with the shared line. Individual mooring systems can be modeled in the
916935
farm-level MoorDyn instance as well.
917936

937+
The same approach is used for bodies and rods, where the attachment is defined as "TurbineN".
938+
The body and rod positions and rotations are defined relative to the turbines position and rotation.
939+
The following code snippet shows rods using the turbine convention.
940+
941+
.. code-block:: none
942+
:emphasize-lines: 12,13,17
943+
944+
---------------------- LINE TYPES --------------------------------------------------
945+
TypeName Diam Mass/m EA BA/-zeta EI Cd Ca CdAx CaAx
946+
(name) (m) (kg/m) (N) (N-s/-) (N-m^2) (-) (-) (-) (-)
947+
0 0.1410 35.78 2.030e+08 -1.000e+00 8.410e+03 1.200 1.000 0.20 0.00
948+
--------------------- ROD TYPES -----------------------------------------------------
949+
TypeName Diam Mass/m Cd Ca CdEnd CaEnd
950+
(name) (m) (kg/m) (-) (-) (-) (-)
951+
connector 0.2000 0.00 0.000 0.000 0.000 0.000
952+
---------------------- RODS ---------------------------------------------------------
953+
ID RodType Attachment Xa Ya Za Xb Yb Zb NumSegs RodOutputs
954+
(#) (name) (#/key) (m) (m) (m) (m) (m) (m) (-) (-)
955+
1 connector Turbine1 -0.62 0.00 -13.22 0.62 0.00 -14.78 0 -
956+
2 connector Free -947.81 0.00 -150.60 -945.82 0.00 -150.75 0 -
957+
---------------------- LINES --------------------------------------------------------
958+
ID LineType AttachA AttachB UnstrLen NumSegs LineOutputs
959+
(#) (name) (#) (#) (m) (-) (-)
960+
1 0 R1B R2A 299.429 10 pt
961+
962+
In this example 0-length rods are used as bend-stiffeners for a suspended cable attached to
963+
Turbine1.
918964

919965
FAST.Farm Input File
920966
^^^^^^^^^^^^^^^^^^^^
921967

922-
In the branch of FAST.Farm that supports shared mooring capabilities, several additional lines have
923-
been added to the FAST.Farm primary input file. These are highlighted in the example input file
924-
excerpt below:
968+
Several additional lines have been added to the FAST.Farm primary input file. These are highlighted
969+
in the example input file excerpt below:
925970

926971
.. code-block:: none
927972
:emphasize-lines: 9,10,13,14,15

0 commit comments

Comments
 (0)