Skip to content

Commit

Permalink
docs: updates and typo fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanDavies19 committed Oct 14, 2024
1 parent 80583eb commit 57697af
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 145 deletions.
6 changes: 3 additions & 3 deletions docs/drivers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ control:
for i in range(3):
# 4 = first fairlead id
point = moordyn.GetPoint(system, i + 4)
x = x + moordyn.GetPointPos(point)
x = x + list(moordyn.GetPointPos(point))
# Setup the initial condition
moordyn.Init(system, x, xd)
Expand All @@ -123,8 +123,8 @@ control:
print("Line {}".format(line_id))
print("=======")
line = moordyn.GetLine(system, line_id)
n_nodes = moordyn.GetLineNumberNodes(line)
for node_id in range(n_nodes):
n_segs = moordyn.GetLineN(line)
for node_id in range(n_segs+1):
print(" node {}:".format(node_id))
pos = moordyn.GetLineNodePos(line, node_id)
printf(" pos = {}".format(pos))
Expand Down
124 changes: 0 additions & 124 deletions docs/features.rst

This file was deleted.

25 changes: 14 additions & 11 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,6 @@ MoorDyn - Lumped-Mass Mooring Dynamics
======================================
.. _index:

.. toctree::
:maxdepth: 2

compiling
drivers
inputs
structure
api_c
waterkinematics
theory

Welcome to MoorDyn's online documentation. MoorDyn is a simple, efficient,
and versatile mooring system dynamics model designed to work in concert
with other simulation tools. It is based on a
Expand Down Expand Up @@ -102,3 +91,17 @@ and DualSPHysics). For Coupling with other codes or more manual driving of
MoorDyn from your own script, several APIs, wrappers, and example driver
scripts are available :ref:`here <drivers>`.

Table of Contents:
------------------

.. toctree::
:maxdepth: 1

compiling
drivers
inputs
structure
api_c
waterkinematics
theory

43 changes: 39 additions & 4 deletions docs/inputs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,9 @@ Control (MoorDyn-F only)
^^^^^^^^^^^^^^^^^^^^^^^^

This section (optional) is only available for MoorDyn-F and describes which lines are assigned to
which control channel in the ServoDyn input file.
which control channel in the ServoDyn input file. Setting up active tension controls involves
modifying the MoorDyn and ServoDyn input file and passing deltaL and deltaLdot control command values
into the appropriate channel of the OpenFAST S function (``FAST_SFunc``).

.. code-block:: none
Expand All @@ -529,11 +531,44 @@ which control channel in the ServoDyn input file.
1 1,2,3,4
2 5
In the example above channel 1 is used to control lines 1-4 and channel 2 is used to control line 5.
In the example above, channel 1 is used to control lines 1-4 and channel 2 is used to control line 5.
These channel numbers must correspond to control channels in the ServoDyn input file. The ServoDyn
summary file (enabled with ``SumPrint`` option) will contain a list of all cable control channels in
summary file (enabled with ``SumPrint`` option) will contain a list of all line control channels in
use and what they are assigned to.

An example set up using controls in Simulink would look like this:

For MoorDyn, add the control section below and specify which lines should be actuated using the tension
control. In the below snippet, 5 lines are being independently controlled.

.. code-block:: none
---------------------- CONTROL ----------------------
ChannelID Line(s)
() (,)
1 1
2 2
3 3
4 4
5 5
There are a total of 20 available channels for line deltaL command in the S function, and 20 available for
the line deltaLdot command in the S function. So when passing in an array of values, pass in 0 for any unused
channels. With all the other inputs (see example file described below for other controllers), the S function
will take in a total of 51 channels.

In ServoDyn, change the cable control channel to 4 for Simulink control.

.. code-block:: none
---------------------- CABLE CONTROL -------------------------------------------
4 CCmode - Cable control mode {0: none, 4: user-defined from Simulink/Labview, 5: user-defined from Bladed-style DLL} (switch)
To run the active tension control using Simulink, an example .mdl Simulink file and a .m matlab script
to run the .mdl file are available in the OpenFAST GitHub repo under `glue-codes/simulink/examples <https://github.com/OpenFAST/openfast/tree/main/glue-codes/simulink/examples>`_
to show how to pass in values. A .dll OpenFAST shared library file and .mex OpenFAST S function file need to be in
the same directory the controller is being run from.

Options
^^^^^^^

Expand Down Expand Up @@ -599,7 +634,7 @@ The list of possible options is:
- FrictionCoefficient (0.0): The seabed friction coefficient
- FricDamp (200.0): The seabed friction damping, to scale from no friction at null velocity to
full friction when the velocity is large
- StatDynFricScale (1.0): Rate between Static and Dynamic friction coefficients
- StatDynFricScale (1.0): Ratio between Static and Dynamic friction coefficients
- dtOut (0.0): Time step size to be written to output files. A value of zero will use dtM as a
step size (s)
- SeafloorFile: A path to the :ref:`bathymetry file <seafloor_in>`
Expand Down
4 changes: 3 additions & 1 deletion docs/structure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,9 @@ describe its direction vector. This case is meant for making cantilever points o
bending stiffness. A fixed zero-length rod can be used to make a cantilever point of a power cable
to the ground, a body, or a coupling point. A free zero-length rod can be used to join two
different types of power cable segments, and it will pass moments between the cable segments
without adding any mass or other characteristics.
without adding any mass or other characteristics. In this case, the two cables being joined need
to be attached to end A and end B respectively (with the rod unit vector pointing from the first to
the second cable).

Rod objects have the following variables:

Expand Down
4 changes: 2 additions & 2 deletions docs/theory.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Theoretical aspects
Theory
===================
.. _theory_global:

Expand All @@ -8,4 +8,4 @@ Theoretical aspects
troubleshooting
initialization
tschemes
features
references
2 changes: 2 additions & 0 deletions source/MoorDyn2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1097,8 +1097,10 @@ moordyn::MoorDyn::ReadInFile()
// make default water depth at least the depth of the lowest
// node (so water depth input is optional)
// TODO - this probably doesn't care about 3d seafloor?
// Note - this is not in MD-F
if (r0[2] < -env->WtrDpth)
env->WtrDpth = -r0[2];
LOGWRN << "\t Water depth set to point " << PointList.size() << " z position because point was specified below the seabed" << endl;

LOGDBG << "\t'" << number << "'"
<< " - of type " << Point::TypeName(type) << " with id "
Expand Down

0 comments on commit 57697af

Please sign in to comment.