Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
21 views79 pages

MoodyCoreManual-3 0

The MoodyCore Manual version 3.0 provides comprehensive guidance on the installation, usage, and functionalities of the MoodyCore software. It includes detailed sections on input files, running code, preprocessing, post-processing, and API documentation. The manual is designed to assist users in effectively utilizing the software for simulations and data analysis.

Uploaded by

Rahul Kanotra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views79 pages

MoodyCoreManual-3 0

The MoodyCore Manual version 3.0 provides comprehensive guidance on the installation, usage, and functionalities of the MoodyCore software. It includes detailed sections on input files, running code, preprocessing, post-processing, and API documentation. The manual is designed to assist users in effectively utilizing the software for simulations and data analysis.

Uploaded by

Rahul Kanotra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 79

MoodyCore Manual

version 3.0

JOHANNES PALM
CLAES ESKILSSON

Göteborg, Sweden 2023

Contact information: [email protected]


CONTENTS

1 Introduction 1
1.1 General description . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1.1 Versions . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1.2 Acknowledgement of support . . . . . . . . . . . . . . . 3
1.2 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Basic usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.4 Debug tip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2 The input file 7


2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2 Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.2.1 Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.2.2 Print . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.2.3 API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.2.4 Numerical settings . . . . . . . . . . . . . . . . . . . . . 10
2.2.5 Statics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.3 Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.3.1 Ground . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.3.2 Waves . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.3.3 Current . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.3.4 Wind . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.4 Vertices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.5 Rigid bodies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.6 Hydrobodies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.7 Boundary Conditions . . . . . . . . . . . . . . . . . . . . . . . . 28
2.7.1 Translational modes . . . . . . . . . . . . . . . . . . . . 28
2.7.2 Rotational modes . . . . . . . . . . . . . . . . . . . . . . 30
2.8 Cable types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

iii
CONTENTS

2.9 Material models . . . . . . . . . . . . . . . . . . . . . . . . . . . 33


2.10 Cables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.11 Initial Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.12 Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
2.13 Using source inheritance . . . . . . . . . . . . . . . . . . . . . 40

3 Running the code 41


3.1 User input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.1.1 Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.1.2 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 42

4 Pre processing 43
4.1 Mesh manipulation . . . . . . . . . . . . . . . . . . . . . . . . . 43
4.2 Nemoh case preparation . . . . . . . . . . . . . . . . . . . . . . 44
4.2.1 Input file format . . . . . . . . . . . . . . . . . . . . . . 44
4.3 Wave elevation . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
4.3.1 Handling output time . . . . . . . . . . . . . . . . . . . . 46
4.3.2 Output format . . . . . . . . . . . . . . . . . . . . . . . . 46

5 Post processing 47
5.1 Moody post . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
5.1.1 Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
5.2 MATLAB routines . . . . . . . . . . . . . . . . . . . . . . . . . 48
5.3 Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
5.3.1 Dependencies . . . . . . . . . . . . . . . . . . . . . . . . 49
5.4 Output file structure . . . . . . . . . . . . . . . . . . . . . . . . . 49
5.4.1 Cable output . . . . . . . . . . . . . . . . . . . . . . . . 49
5.4.2 Rigid body output . . . . . . . . . . . . . . . . . . . . . 49
5.4.3 Hydrobody output . . . . . . . . . . . . . . . . . . . . . 49
5.4.4 Component output . . . . . . . . . . . . . . . . . . . . . 51

6 API documentation 53
6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
6.2 Interface functions . . . . . . . . . . . . . . . . . . . . . . . . . 53
6.2.1 Description . . . . . . . . . . . . . . . . . . . . . . . . . 54
6.3 Input file entries . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
6.4 Fortran, Matlab and Python interface functions . . . . . . . . . . 56
6.5 Testing the API . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

REFERENCES 59

A Theory manual 61
A.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
A.2 Cable dynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
A.2.1 External Forces . . . . . . . . . . . . . . . . . . . . . . . 62

iv
A.2.2 Shear Force Modelling . . . . . . . . . . . . . . . . . . . 63
A.2.3 Tension-Strain Relations . . . . . . . . . . . . . . . . . . 64
A.3 Finite Element Method . . . . . . . . . . . . . . . . . . . . . . . 64
A.3.1 Boundary Conditions . . . . . . . . . . . . . . . . . . . . 66
A.4 Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
A.4.1 Spring-dampers . . . . . . . . . . . . . . . . . . . . . . . 67
A.5 Rigid body dynamics . . . . . . . . . . . . . . . . . . . . . . . . 67
A.5.1 Coordinate systems . . . . . . . . . . . . . . . . . . . . . 67
A.5.2 Equations of motion . . . . . . . . . . . . . . . . . . . . 68
A.6 Wave kinematics and wave-body interaction . . . . . . . . . . . . 71
A.6.1 Wheeler stretching . . . . . . . . . . . . . . . . . . . . . 71
A.6.2 First order potential flow forces . . . . . . . . . . . . . . 71
A.7 Static solver and relaxation . . . . . . . . . . . . . . . . . . . . . 72
A.7.1 Solve . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
A.7.2 Relax . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
A.8 API boundary conditions . . . . . . . . . . . . . . . . . . . . . . 73

v
1
Introduction

1.1 G ENERAL DESCRIPTION

Moody was originally a module for computing cable dynamics in marine applica-
tions. It has been extended with functionality for floating bodies subject to linear
potential theory with the radiation-diffraction formulation of Cummins equation.
This manual explains the usage of – and theory behind – MoodyCore, as a stand-
alone solver, as a plug-in module to hydrodynamic codes via the MoodyAPI li-
brary, and as the backend simulation engine to MoodyMarine - the graphical user
interface of MoodyCore. MoodyCore is released as freeware on Mac, Linux and
Windows. More information on www.moodymarine.se.
When using the different functionalities in MoodyCore, please make sure to
reference publications accordingly. Below is a list of publications hosting the
main feature developments and validations of MoodyCore.

Fundamental theory and numerical implementation of cable dynamics:


J. Palm, C. Eskilsson, and L. Bergdahl. An hp-adaptive discontinuous Galerkin method for
modelling snap loads in mooring cables. Ocean Engineering, 144:266–276, 2017

Bending:
J. Palm and C. Eskilsson. Influence of bending stiffness on snap loads in marine cables: A
study using a high-order discontinuous Galerkin method. Journal for Marine Science and
Engineering, 8(10):795, 2020

Submerged bodies:
J. Palm and C. Eskilsson. Mooring systems with submerged buoys: influence of floater
geometry and model fidelity. Applied Ocean Research, 102:102302, 2020

Floating bodies:
J. Palm and C. Eskilsson. Verification and validation of MoodyMarine - A free simulation

1
1. Introduction

tool for modelling moored MRE devices. In J.M. Blanco Ilzarbe (ed.): Proceedings of the
15th European Wave and Tidal Energy Conference, Bilbao, 3-7 September 2023.

Coupling to OpenFOAM:
J. Palm, C. Eskilsson, G. Paredes, and L. Bergdahl. Coupled mooring analysis for floating
wave energy converters using CFD: Formulation and validation. Int. J. of Marine Energy,
16:83–99, 2016

MoodyCore is based on a discontinuous Galerkin finite element method with high-


order Legendre polynomial expansion bases. The formulation is stated in conser-
vative form, employing a local Lax-Friedrich type Riemann solver for the numer-
ical fluxes between the elements. For more information on the numerical schemes
and the equations of motion, the reader is referred to the theory in Appendix A.
The stand-alone solver of MoodyCore, moody.exe, is typically operated from
the terminal window or executed via MoodyMarine. To use MoodyCore as a
mooring module with an external hydrodynamic code package such as Open-
FOAM or Matlab, please see the API Chapter 6.

1.1.1 Versions
The current release (v3.0) features many improvements to the performance and
handling of the code. New features in the current version are described below.
MoodyCore has been released in the following previous versions (up until v2.0
under the name Moody):

Moody-1.0 Original release following the implementation in [8]. Released 2018-


05-21.

Moody-2.0 Rigid body library introduced, enabling submerged buoys and clump-
weights according to [6]. Released 2019-09-20.

MoodyCore-3.0 [Present release] Released 2023-10-06.

• Floating wave-body interaction supported as hydroBodies using lin-


ear potential radiation-diffraction theory according to Cummins equa-
tion [2]. Supports nonlinear Froude-Krylov forces and Nemoh v3
reader/writer.
• Major improvements to the static-equilibrium solver, including non-
linear statics of hydrobodies. Still under development, but system
statics are now tunable from the input file.
• A native mesh-manipulation included supporting read/write from/to
.stl, .gdf and .dat (nemoh) formats including panel splitting at the still
water level.

2
1.2. Installation

• A major renaming and reorganization of the input file has been im-
plemented, applying a more stringent format and supporting nested
objects. The format has been modified to support compatibility with
MoodyMarine.
• Introducing bending stiffness in the DG formulation according to [5].
• Linear translating mass included as a special type of rigid body, and
components introduced to model linear spring/dampers according to
[7] (command-line only).
• Post-processing module in Python provided (rudimentary).
• Many stability improvements and error messages introduced. Restruc-
turing of the code base into Core and API repositories. The coupling
to OpenFOAM is thus no longer shipped with the moodyCore.

1.1.2 Acknowledgement of support


The initial development of Moody was supported by the Western Region of Swe-
den through the Ocean Energy Centre at Chalmers University of Technology,
Sweden (2013-2014). The formulations and code up until the present release has
been funded by the Swedish Energy Agency under grants P40428-1, P42246-1,
P47264-1 and P50196-1. The development up until September 2020 was done
at Chalmers University of Technology, and has since been done at (and has been
co-funded by) Sigma Energy and Marine AB. The financial support received is
gratefully acknowledged.

1.2 I NSTALLATION

MoodyCore is included in the installation of MoodyMarine, for use through the


GUI. The following instructions pertain to installing MoodyCore separately.
MoodyCore is released as freeware, however the API coupling code is released
open source under the collective name MoodyAPI. As of v.2.0.1, the compressed
files include the bin, lib, include and API folders for each operating system
(Windows, OSX and Linux). The tutorials, the manual and the API are all cross-
platform and are accessed directly as sources when cloning the repository. Note
that the automated shell scripts are developed primarily for Linux and MacOSX
users. For windows, they are more guidelines than actual rules. Installation in-
structions:

1. Download the tar or zipped folder from www.moodymarine.se/downloads.

2. Select your installation directory and unpack the appropriate tar or zip bina-
ries in the same location. Technically, this is only relevant for all tutorials
and Matlab-processing paths to work as intended.

3
1. Introduction

3. In Linux or OSX environments, source the environment variables. For this,


use moodyCoreEnvironment. This will set, among others, the moody
home directory variable moodyDir which we use frequently in the follow-
ing manual.

Ex:

cd moodyAPI
tar -xzvf moody-Linux.tar.gz
source moodyCoreEnvironment

NOTE: There is no Windows PATH-setting script provided at this


time. Use the native environment variable editor to add MoodyCore
to your path.

1.3 BASIC USAGE

Apart from running the MoodyMarine interface, MoodyCore is most easily op-
erated through the terminal window. Alternatively, both MATLAB and Python
interfaces (system calls) are included. The simulation is controlled through an
input file and standard flag-value pairs e.g. -f <fileName>.
MoodyCore is also shipped with a suite of MATLAB® and Python scripts
mainly used for post-processing. These are optional to use and are simply pro-
vided as a way of loading and processing the output data from MoodyCore. They
are not fully documented and commented but are supplied to help users inter-
act with MoodyCore. The Matlab scripts also work in GNU Octave, except for
moodyMovie.m which is not compatible with Octave at present. The output data
format of Moody is presented in chapter 5. Please note that any text-file can be
used as input file, and the ”.m” in the examples is only for convenience if the
Matlab post-processing suite is used.
As of version 3.0, MoodyCore also supports .json input files, which is the
format of input files from MoodyMarine. A copy of the input file is written in
both .json and .txt format in each result directory from MoodyCore.

1.4 D EBUG TIP

If there are any problems running the software, a good starting point is to check
the output of the following commands (in a Linux environment):

4
1.4. Debug tip

echo $moodyPath
echo $moodyDir
which moody.exe
ldd libmoodyAPI.so
echo $LD_LIBRARY_PATH
echo $PATH

5
2
The input file

2.1 OVERVIEW

MoodyCore is based on an input file for setting up the mooring system and the
floating structures. The input file is based on a number of top level keywords:
simulation, environment, vertexLocations and bem. In addition, objects are added
as numeric id naming, e.g. bc1, cable1, cable2 etc. Here we use X to mark the id
of an object. There are five types of objects in MoodyCore: cables, components,
rigid bodies, hydro bodies, and boundary conditions. These are all inter-connected
at vertices. A boundary condition (bc) can connect to multiple cables and com-
ponents, but not to a rigid body. A rigid body and a hydro body can have several
slave vertices, but a vertex which is enslaved cannot be the main vertex of another
body. The input data is grouped in the following main categories.

Simulation
Controls time, output, API and numerical settings. Keyword: simulation

Environment
Hosts gravitation, fluid properties, ground model, waves, wind and current.
Keyword: environment

Vertices
Specifies the number and location of vertices (points) in the simulation.,
Keyword: vertexLocations.

Boundary conditions
Specify type and behaviour for all boundary conditions. Keyword: bcX

Cable types
Specify the cross-sectional and material parameters of a mooring cable.
Keyword: cableTypeX

7
2. The input file

Cables
Specify cable properties like end-points, cable type and length. Also speci-
fied initial condition type. Keyword: cableX

Components
Specify component properties like end-points, stiffness and damping. Key-
word: componentX

Rigid bodies
Dynamic rigid bodies are submerged Morison bodies, like buoys and clump-
weights. Keyword: rigidBodyX

Hydro bodies
Derived from the rigid body library, hydrobodies support linear potential
flow wave-forces through the radiation-diffraction formulation of the Cum-
mins equation [2]. Keyword: hydroBodyX

The input file can have any text-file format, with or without extension. It fol-
lows the format of a Matlab script, where assignment is made with =. Hence,
simulation.time.end = 5 will set the end time of the simulation to 5s. Mul-
tiply defined variables are allowed, but be aware that only the first instance of a
keyword will be used. Sub-structures and fields of information are assigned in
nested curly brackets {} or through the . sign. The following sections describe
each input category for a MoodyCore simulation.

8
2.2. Simulation

2.2 S IMULATION

2.2.1 Time
Keyword: time, handles simulation time.

start [s]
Start time of the simulation.

end [s]
End time of the simulation.

dt [s]
Time step size.

scheme (RK3)
Choose integration method. Choices are:

RK3
Third order explicit Strong Stability Preserving Runge-Kutta scheme.
This is the default.
RK45
Five stage fourth order explicit Runge-Kutta scheme.

cfl
Use adaptive time step size. Set as a fraction of the smallest CFL condition.
Typically cfl=0.9 works for most applications, but in cases dominated by
ground, high bending stiffness or large internal damping, a lower value may
be needed for stability. If field cfl is present, field dt is not used. It is also
possible that cfl=0.9 is too restrictive. Hence, best performance is probably
achieved by testing out a stable constant time.dt.
.

2.2.2 Print
Keyword: print controls the output folder content and format. (x) indicate de-
fault value.

dt (time.dt) [s]
The time between each output time in the result directory.

mode (1)
The mode=1 prints all cable values in both modal and nodal space. mode=0
prints only modal coefficients. Use moodyPost.exe to extract nodal output,
see chapter 5.

9
2. The input file

format (’bin’)
Moody prints in binary format by default. format=’ascii’ prints in ASCII
format. Binary format is significantly faster and more efficient for storage.
It is also required for MoodyMarine compatibility.

2.2.3 API
The API input structure is located under simulation. Please see Section 6 for
detailed information on how to set the API keyword.

2.2.4 Numerical settings


Numerical settings control the quadrature order of the simulations. The top-level
keyword is numLib.
qPointsAdded (2)
The number of quadrature points more than the polynomial order P, to use
in the simulation. Default is 2, meaning that Q = P + 2 points will be used
in each element. Moody uses Gauss-Legendre-Lobatto quadrature which is
exact with P+2 points for the Legendre polynomial of order P. However, in
cases of nonlinear external forces (such as stiff ground interaction) a higher
value might be needed to sample the force properly.

2.2.5 Statics

NOTE: The relax stage in the static solver is still experimental and has
its limitations.

The static solver (statics) option enables a number of Euler fwd time steps
before the time loop begins. The solve option works well to find system equilib-
rium, however it is deactivated by default. Input options are:
solve (0)
Switch to 1 to enable the dynamic solve of the initial condition.
maxIter (5000)
An int denoting the number of maximum iterations of the Euler step during
the solve stage.
timeStep (0.1)
The time step size used to step the bodies forward towards equilibrium.
Body velocity is truncated after each step. (s)
tol (0.001)
Tolerance of maximum body velocity (in any dof) of the system allowed
before breaking the solve-stage of the static solver. (m/s)

10
2.2. Simulation

relax (0)
Switch to 1 to enable the dynamic relaxation of the initial condition.

relaxFactor (0.1) Factor to scale the resulting cable velocity after each step.

relaxIter (5000) How many time steps to relax over.

relaxTimestep (0.001) Time step size of relaxing stage. (s)

11
2. The input file

2.3 E NVIRONMENT

Keyword: environment controls the environmental properties in the simulation.


The following are the top-level keywords available.
gravity (-9.81)
Gravitational acceleration specified as a scalar in m/s2 .

waterLevel (inf) [m]


Set still water z-coordinate. Default is fully submerged.

waterDensity (1000.0) [kg/m3 ]


The water density applies to all fluid below the water level.

airDensity (1.0) [kg/m3 ]


The air density applies to all fluid above the water level.

ground
Ground model. See 2.3.1.

wave
Wave model. See 2.3.2.

current
Current model. See 2.3.3.

wind
Wind model. See 2.3.4.

2.3.1 Ground

LIMITATION: The ground level is assumed to be constant.

Keyword: ground specifies the ground interaction properties of all cables in the
model. MoodyCore uses a combined linear spring and bilinear damper as ground
model, springDamp. The contact force acting on each quadrature point of the
cable from the ground is a function of the penetration depth and the vertical veloc-
ity. Dynamic friction (Coulomb damping) is also included. The input parameters
listed below refer to the equations stated in the theory manual of Appendix A.

level
This sets the level of the ground in the global coordinate system. The ground
is assumed to be horizontal and thus have its normal vector aligned with the
global z-axis. Goes into (A.12) as z0 .

type=springDamp
This is the only one available at present.

12
2.3. Environment

stiffness [Pa/m]
The stiffness (bulk modulus) of the ground. Goes into (A.12) as K.
damping (0)
The damping input sets vertical linear damping (Pa s/m). Goes into
(A.12) as ξ.
dampingCoeff (1)
The damping coefficient sets vertical linear damping as ratio of critical
damping. (-). Goes into (A.12) as ξ.
oneWayDamping (1)
Switch to apply vertical damping only during penetration (vz < 0). If
set to 0, then pure linear damping is applied.
frictionCoeff (0)
This is the friction coefficient between any cable and the ground. Goes
into (A.13) as µ.
frictionVelocity (0.01) [m/s]
The cut off speed for dynamic friction specifies the horizontal speed
at which the friction force reaches its full value. This is a numerical
relaxation of the friction force for the times when the cable is changing
direction. Goes into (A.13) as vµ .

ground = {
level = -1e3; % z-coordinate of ground [m]
type =’springDamp’; % type name
stiffness = 1e6; % vertical stiffness [Pa/m]
damping = 0; % vertical damping [Pas/m]
dampingCoeff = 1; % ratio of critical damping [-]
frictionCoeff = 0; % horizontal friction coeff. (-)
frictionVelocity = 0.01;% horizontal threshold [m/s]
}

13
2. The input file

2.3.2 Waves

LIMITATION: Waves and current can coexist, but their effects are super-
posed. No modification of the linear wave theory is made to consider the
effect of the current at present.

MoodyCore supports regular (Airy) waves, as regular waves, JONSWAP spec-


trum and custom wave trains. Keyword in environment: wave.

type
Options are: regular, JONSWAP, custom. See further individual set-
tings.

direction (0) [deg]


Wave direction angle. Zero degrees is a wave propagating in the positive
x-direction. θ in Eq. (2.1).

depth [m]
The water depth used for wave modelling may be set independently. If not
specified, it is computed from waterLevel - ground.level.

rampTime (0) [s]


The ramp time of the wave amplitude, using a cosine ramp function.

type=regular
Regular waves in deep and intermediate waters are simulated using the airy
wave theory. The free surface is computed as
 
ζ = a cos k x x + ky y − ωt + φ , (2.1)

from the amplitude a, directional wave numbers k x = k cos θ, and ky =


sin(θ), angular frequency ω and phase φ. θ is then the wave direction, de-
fined as an angle to the global x-axis. Input fields:

amplitude (0) [m]


Wave amplitude.
period (2π/ω) [s]
Wave period. Precedence over k, L and ω input.
omega (ω(k)) [rad/s]
Wave frequency period. Precedence over k and L input.
L (2π/k) [m]
Wave length, single input. Precedence over k input.
k (k(ω)) [rad/m]
Wave number, single input. used only if period, omega and L are
missing inputs.

14
2.3. Environment

phase (0) [deg]


Wave phase shift acc. to φ in Eq. (2.1). θ in (2.1).
useRadians (0)
If set to 1, it interprets phase and direction input as radians instead of
degrees.
type=custom
Use user specified wave component input. can be used to model any seast-
ate, and is required to use for multi-directional wave environment simula-
tions.
file
File name of the wave component file. If present, explicit input of
direction,amplitude,phase and frequency are unused. Expected file
format has four lines per wave direction. L1: waveDirection (angle
relalative to the X-axis), L2: amplitudes (list of N values, where N is
number of components), L3: frequencies (list of N values), and L4:
phases (list of N values).
direction S
ingle wave train wave direction. Unit subject to useRadians switch.
amplitude [m]
List of wave amplitudes.
frequency L
ist of wave frequencies. Unit subject to useRadians switch.
phase L
ist of wave phases. Unit subject to useRadians switch.
useRadians (0)
Switch to use radians in file reading or not. 0 means direction and
phases in degrees, frequencies in Hz. 1 means direction and phases in
radians, frequencies in rad/s.
type=JONSWAP
Long-crested irregular waves are modelled using synthesized waves from
the JONSWAP amplitude spectrum. Inputs are named after the JONSWAP
spectrum formula
ω −4 b
!
S (ω) = α2πg ω exp −1.25
2 −5
γ (2.2)
ωp
!2
−2 ω
b = −σ − 1 , with σ = σ1 if σ < ω p , σ = σ2 otherwise,
ωp
(2.3)
where w is in rad/s, w p is the peak frequency, γ is the peakedness factor, α =
0.0081 is a scale factor for significant wave height, and g is the gravitational
acceleration.

15
2. The input file

Hs [m]
Significant wave height.
components (
100) Number of wave components in the spectrum.
fp (0.1)
Peak frequency. Unit subject to useRadians.
f0 (0.01)
Lowest frequency. Unit subject to useRadians.
f1 (10)
Highest frequency. Unit subject to useRadians.
gamma (
1) Peakedness factor of the spectrum.
sigma1 (0.07)
Low frequency shape factor.
sigma2 (0.09)
High frequency shape factor
seed (-1)
Seed number. Use -1 for random seed generation, use positive int for
repeatability.

wave = {
type = ’regular’;
amplitude = 0.5;
period = 6;
phase = 90;
rampTime = 10;
direction = 180;
}

16
2.3. Environment

2.3.3 Current
Keyword in environment: current.

direction [deg] H
orizontal direction of current.

rampTime (0) [s]


Ramp time of current. A sine ramp is applied from simulation start to
rampTime. No acceleration forces generated (assumed small).

speed (0) [m/s]


Uniform speed of current. Used if depths is NOT found.

depths [m]
List of depths at which speeds list is defined. A lookup table of [depth,speed]
is used to interpolate current value. Depths are positive down using still wa-
ter level as origin.

speeds [m/s]
List of speeds corresponding to the depths in depths.

current = {
direction = 90;
speed = 0.5;
}

17
2. The input file

2.3.4 Wind
Keyword in environment: wind. The power law wind profile is computed at each
height z as

U(z) = Ur [cos θ sin θ]T (z/zr )α . (2.4)

Here, Ur is the reference speed, zr is the reference height and α is the power
exponent.

direction [deg]
Horizontal wind direction θ.

speed (0) [m/s]


Reference speed Ur of wind at z = zr .

zRef (10) [m]


Reference height zr at which speed applies.

rampTime (0) [s]


Ramp time of wind. A sine ramp is applied from simulation start to rampTime.
No acceleration forces generated (assumed small).

wind = {
direction = 90;
speed = 10;
zRef = 10;
rampTime = 20;
}

18
2.4. Vertices

2.4 V ERTICES

MoodyCore’s geometry is defined by vertexLocations, which specify a num-


bered list of points in three dimensional space. A vertex number is needed to
assign a physical location to any dynamic object in the simulation. All points are
given in 3D coordinates.
The following example creates vertex 1 and 2 at points [0 0 -50] and [50
0 0] respectively. Note that the [] brackets are optional.
vertexLocations = {
1 [0 0 -50];
2 [50 0 0]
};

19
2. The input file

2.5 R IGID BODIES

NOTE: The motion of submerged rigid bodies is assumed to be following


Morrison’s equation, and no check is made in MoodyCore that this is a
valid approximation. Therefore one should take care when simulating large
bodies in relation to the flow.

Mooring elements such as submerged floaters and sinkers can be modelled


using rigid body type objects, defined by keyword rbX for each number X. These
are divided into two categories. One is the simple point mass with an assigned
mass and volume but with neglected rotational motion. This is modelled using the
rigidPoint type object. The other rigid body type also takes the rotation of the
body into account and computes the motion from the force and moment exerted
by the attached cables and the surrounding fluid.
The force and position fluxes between rigid bodies and the attached mooring
cable(s) are such that the position of the body acts as a position boundary condi-
tion on the cable, while the cable acts as a force boundary condition to the rigid
body solver. Some fields are common to all rigid bodies while other are object
type specific.

vertex
The vertex number of the body. It is assumed to be the center of mass of the
body.

mass [kg]
The mass of the body. May not be 0.

slaves
List of slave vertices. Each slave is defined by 8 entries:

V , x , y , z , clampSwitch , tx , ty , tz ,

where V is a vertex no, (x, y, z) is the vertex location in the body local coor-
dinate system, clampSwitch is 0 for a pinned (moment-free) connection and
1 for a clamp at V directed in (tx, ty, tz) direction.

NOTE: Assigning a slave vertex overrides the information supplied


to the vertex position in vertexLocations. It is treated as a local
coordinate forced to follow the rigid body motion of the master body.

NOTE: Only connected cables with bending stiffness are affected


by the clampSwitch. Torsional moments are NOT transmitted from
cables.

20
2.5. Rigid bodies

volume (0) [m3 ]


The volume of the body.

constraints
Vector list of constrained (locked) degrees of freedom. Only translation
and rotation about the global coordinate system is supported. DoF 1-3 are
translations and DoF 4-6 are rotations. Example of heave only simulation:
[1,2,4,5,6].

type=rigidPoint
The rigid point is the object type used to simulate point masses and point
floatation forces in Moody. It computes the motion of the body in the three
translational degrees of freedom. The local coordinate system is therefore
always aligned with the inertial system. Any cables connected to clamped
slaves are affected by the directional clamp, but the reaction moments acting
on the body are not affecting the body motion. This body type has a buoy-
ancy model which (based on a sperical geometry) computes the submerged
volume at each timestep.

type
The type field must be set to ’rigidPoint’.
CDn and CM (0)
The hydrodynamic coefficients of drag and added mass, CDn and CM
respectively, are both specified as single input values and used accord-
ing to the Morison equation.
initialState (0)
A substructure with subfield like r, and v. The body can be given
a start velocity and a startposition. The input is a 3 by 1 vector in
[m/s] of the global coordinate system. The default is the position from
vertexLocations at rest.
area [m2 ]
Area of body, used in drag force computation. If not specified, it is
computed from volume assuming a sphere.

rb1={
type = ’rigidPoint’;
vertex = 2;
mass = 1; \% [kg]
\% Optional \%
volume = 0;
CDn = 1;
CM = 2.5;
initialState.v = [1 0 0]; % 1m/s x speed
}

21
2. The input file

type=rigidCylinder
A submerged, vertical cylinder is modelled, including both translation and
rotation. The rotation is modelled using quaternions and the variation of the
surrounding fluid is taken into account by integration of the forces on each
slice.

LIMITATION: A rigidCylinder object is not aware of the free


surface and thus assumed to be fully submerged always.

height [m]
The height of the cylinder must be specified. The input is in [m].
diameter [m]
The diameter of the cylinder.
momentOfInertia, I [kg m2 ]
This is the mass moment of inertia of the body, around the center of
gravity. If not specified, the default value is that of the solid cylinder.
The input should be in [kg m2 ] and formatted as a vector of three val-
ues: rigidBodyX.I = [Ixx Iyy Izz], where z is along the sym-
metry axis.
centreOfBuoyancy, cob (0) [m]
Use cob to offset the center of buoyancy (along the symmetry axis
only).
CM ( [0 0] )
A vector of two values rigidBodyX.CM=[CMn CMt], where CMn is
the normal direction coefficient. CMt is the cylinder lid coefficient.
CD ( [0 0 0] )
A vector of three values rigidBodyX.CD=[CDn CDt CDyaw], where
CDn is the normal direction coefficient. CDt is the cylinder lid coeffi-
cient, and CDyaw is the total yaw drag coefficient.
initialState (zeros(13,1))
All instances of initial state can be set here. Subfields are: r-positions,
v-velocity, ω-angular velocity and q-quaternion object.
decoupledDrag (0)
Set to 1 to use the drag force in decoupled mode, i.e. to compute rota-
tional drag moment based on ω of body alone, and compute the trans-
lational force based on the relative velocity of body and fluid. Default
is 0, i.e. the strip theory is used to compute the drag forces and mo-
ments at each time-step using 7-point numerical quadrature along the
symmetry axis. See [6] for more information on the differences be-
tween rotational drag methods.

22
2.5. Rigid bodies

rb1={
type=rigidCylinder
vertex = 2
mass =5
height = 0.5
diameter = 0.2
I = [10 5]
CDn = [1 1 0.1]
CM = [1.2 1]
}

type=translator
A special purpose type to model linearly translating bodies. Also includes
models of end-stop forces when a damping force and limited stroke-length
is desired.

type
The type field must be set to ’translator’.
V [m3 ]
The volume of the body used for buoyancy forces. Unused if rhoSeal
= 0.
midPoint [m]
Position of center of the stroke-length.
direction [m]
Direction of the linear motion. Input as a vector.
damping [Ns/m]
Linear damping is applied to the body motion.
friction(0) (N)
Dynamic friction force amplitude.
vFriction(0.01) (m/s)
Define linear transition region for friction. Friction force amplitude is
constant for |v| >= vFriction, with value friction.
strokeLength [m]
One-sided distance to end-stop springs. i.e, the amplitude of free mo-
tion around the midPoint.
endStopStiffness [N/m]
Stiffness of linear end stop spring. Activated as restoring spring when
distance from midPoint exceeds strokeLength.
endStopDamping [Ns/m]
Linear damping of the end stop.
endStopLength [m]
Length of end-stop spring.

23
2. The input file

endStopFullCompressionStiffness [N/m]
Activated as a second layer of stiffness when the endStopLength is
exceeded.
sealed
Switch to model a sealed container, where buoyancy is not affecting
the translating body.
rhoSeal [kg/m3 ]
Density of seal fluid. Defines buoyancy force when sealed.

See example in tutorial T4.

24
2.6. Hydrobodies

2.6 H YDROBODIES

LIMITATION: There is no body-to-body interaction implemented in


MoodyCore v-3.0.

Wave-body interaction of floating bodies in moodyCore is done through a


hydroBody. A hydroBody implements Cummin’s equation [2] with nonlinear
additives in the form of Morison drag, mesh-based nonlinear Froude-Krylov pres-
sure force (static and dynamic) and external forces. Presently [v-3.0], moodyCore
supports diffraction forces through numerical integration of the impulse-response
function.

vertex
The body vertex. The vertex position is the centre of gravity of the body.

slaves
List of slave vertices. The same as for a rigid body.

mass [kg]
Dry mass of body

I [kgm2 ]
Moment of inertia. Vector of length 9 or 3 corresponding to the full mass
moment of inertia tensor, or its diagonal terms. Should be computed about
the centre of gravity of the body.

constraints
Vector list of constrained (locked) degrees of freedom. Only translation
and rotation about the global coordinate system is supported. DoF 1-3 are
translations and DoF 4-6 are rotations. Example of heave only simulation:
[1,2,4,5,6]

meshName
Name of mesh to use for Froude-Krylov pressure calculations. Preferably
with full path (for full compatibility with moodyMarine). WAMIT (.gdf),
Nemoh (.dat) and stl (.stl) formats supported. All are read as triangular
meshes. See documentation on moodyPre.exe for mesh conversion us-
age. Used when nlfk switch is turned on, or when no stiffness matrix is
supplied.

cogInMesh [m] (0,0,0)


Location of centre of gravity in the mesh coordinate system. MoodyCore
will internally translate the mesh geometry to be centered around the CoG.

C [N/m,Nm/rad]
Linear stiffness matrix. Used if present and if nlfk is turned off. Input is

25
2. The input file

a list of values with some shorthand input syntax supported. Let L be the
length of the C input:

L=1
Input is interpreted as the heave stiffness, i.e. C=[c33]. All other
stiffnesses are 0.
L=3
Input is interpreted as the heave, roll and pitch stiffness,
i.e. C=[c33,c44,c55]. All other stiffnesses are 0.
L = 36
Full stiffness matrix.

volume [m3 ] (0)


Submerged volume at initial position. Used in cases where linear stiffness
matrix is found. If not present in such cases, a 0 displacement body is
simulated.

bemData
Location of folder with bemData results. Expects an output in Nemoh (v3)
format with nested folders mesh and

type
Presently, this has to be linearIRF.

IRF
Substructure governing the impulse response function (IRF) settings.

time [s]
Duration of IRF function integration.
dt [s]
Resolution of the IRF integration.

nlfk (0)
Switch to turn on (1) the nonlinear Froude-Krylov forces. Default is off (0).

NOTE: A triangulated non-symmetric body mesh will give rise to er-


roneous yaw moment if the nonlinear Froude-Krylov option is used.
Work-arounds include to import a quadrilateral (gdf) mesh to Moody-
Core, use mirrored (symmetric) triangular mesh, or simply restrain
the body in yaw mode.

CD [0 0 0 0 0 0] (Ns2 /m2 , Nms2 )


Effective drag force coefficient for quadratic drag. Note, that it is given as
a six dof vector where index 1-3 is computed as relative motion at the cog,
and rotations (index 4-6) are computed based on body rotation alone.

26
2.6. Hydrobodies

CDlinear [0 0 0 0 0 0] (Ns/m, Nms)


Effective drag force coefficient for linear drag. Note, that it is given as a six
dof vector where index 1-3 is computed as relative motion at the cog, and
rotations (index 4-6) are computed based on body rotation alone.

27
2. The input file

2.7 B OUNDARY C ONDITIONS

Boundary conditions are created through the input file using top-level syntax bc1,
bc2 etc.

vertex
Each boundary condition can only be applied to one vertex, specified by
vertex. The externalRigidBody mode can be used to also control slave
vertices (see API section).

startTime (time.start) [s]


Specify the start time of a time-variation of the bc.For t <bcX.startTime,
the boundary value is held fixed at that of bcX.startTime. The input is
either a single value or a 3 by 1 vector specifying the start time of each
coordinate direction independently.

endTime (time.end) [s]


Defines the time at which the boundary condition stops to be active. For
t >bcX.endTime, the boundary value is held fixed at that of bcX.endTime.
The input is either a single value or a 3 by 1 vector specifying the end time
of each coordinate direction independently.

rampTime (0) [s]


Dynamic boundary conditions are ramped up from static start time condi-
tions over a given time interval ∆τ=bcX.rampTime. The ramp factor Q is
defined as a function of τ = t−startTime as
  τ π 
Q = 0.5 sin π − +1 . (2.5)
∆τ 2

dampTime (0) [s]


Analogous to rampTime for smoothly stopping the motion of a boundary
condition over a period of time (dampTime) as the end time is approached.

mode (fixed)
Specify BC mode for translational degrees of freedom.

rotationMode (pinned)
Specify BC mode for rotational degrees of freedom.

2.7.1 Translational modes


mode=fixed
Model a fixed point.

value (vertexLocation) [m]


Specify coordinate to override default vertexLocation.

28
2.7. Boundary Conditions

mode=force
Model a constant force. Default models a free cable end.

value (0,0,0) [N]


Specify constant force amplitude in outward-pointing normal direc-
tion.

mode=sine and mode=sineForce T


hese modes are used to generate sinusoidally varying values at the bound-
ary. The offset, amplitude, frequency and phase of the sine motion can be
specified for each coordinate direction. Scalar valued input is allowed and
will be applied to all directions. The amplitude and the centerValue are
interpreted as [m] for mode=sine and as [N] for mode=sineForce.

amplitude ([0,0,0]) [m alt. N]


The amplitude of the sinusoidal excitation.
frequency ([0,0,0]) [Hz]
The frequency of oscillation.
phase ([0,0,0]) [deg.]
The phase of the excitation.
centerValue (vertexLocation alt. [0,0,0]) [m alt. N]
If defined it determines the offset around which the oscillation takes
place. Must be vector valued with length 3.

bc1={
type = 1; % position
vertex = 2;
mode = sine;
amplitude = [1;0;1];
frequency = [0.5,0,0.5];
phase = [90 0 0]
rampTime = 5
}

mode=externalPoint
This mode is used in MoodyAPI. It uses quadratic interpolation to generate
intermediate boundary conditions in between coupling times of the external
solver. When used for mooring through MoodyAPI, no additional inputs
are needed. For stand-alone MoodyCore, a no-input BC is equivalent to
mode=fixed, but a quadratic interpolation between a start and end point
can be set using the following fields, in combination with bc.startTime
and bc.endTime:

29
2. The input file

startValue (vertexLocation alt. [0,0,0]) [m alt. N]


The start value defines the value of the boundary at the beginning of
the simulation.
endValue (vertexLocation alt. [0,0,0]) [m alt. N]
The end value defines the value of the boundary at the endTime.
startVelocity ([0,0,0]) [m/s alt. N/s]
The initial rate of change of the boundary at startTime.

mode=externalRigidBody
This mode expects a 6 dof position state of a rigid body as input to the API.
The total mooring forces and moments on the rigid body frame are returned
to the external solver.

slaves
A list of vertices and locations that specifies slave vertices. Format is
the same as slaves for rigidBodies and hydroBodies. Slave positions
should be given in the body local coordinate system.

2.7.2 Rotational modes


rotationMode=pinned
Models a moment-free point connection.

rotationMode=moment
Models a constant moment vector BC condition.

rotValue (0,0,0) [Nm]


Specify moment vector amplitude.

rotationMode=clamped

rotValue (0,0,1) [-]


Direction vector for clamp. The axial direction of attached cables in
the global coordinate system. Does not have to be unit-normalized,
but needs non-zero norm.

30
2.8. Cable types

2.8 C ABLE TYPES

LIMITATION: MoodyCore neglect the torsional rigidity of the cable. If


torsion is important to you then MoodyCore is not the correct tool.

A cable type is used to define the material properties of a cable. Each cable
refers to a cable type. It is analogous to cutting a nylon rope into three pieces. The
nylon rope properties are contained in the cable type, and the three pieces become
three cables.
Cable types are grouped for each type under keywords cableTypeX. The re-
quired and optional fields of the cable type structure are described below.

diameter [m]
The diameter of the cable. If not specified, the default value is the equivalent
diameter, computed from gamma0 and rho, assuming a constant density in
a circular cross-section. After initial dependencies, diameter is only used as
drag diameter base and as contact to the ground.
gamma0 [kg/m]
The dry mass per meter of the cable. If not specified, the default value
is computed from diameter and rho, assuming a constant density in a
circular cross-section.
rho [kg/m3 ]
The density of the cable material. If not specified, the default value is com-
puted from diameter and rho, assuming a constant density in a circular
cross-section.
materialModel
The material model is a substructure of the cable type. It contains informa-
tion about the constitutive relations of the cable. See section 2.9 for choices
and detailed info.
CDn (0)
The drag force coefficient in the normal direction of the cable. Is applied to
the diameter.
CDt (0)
The drag force coefficient in the tangential direction of the cable. Is applied
to the diameter.
CM or CMn (0)
The added mass coefficient of the cable in the normal direction of the cable.
Is applied to the cross-sectional area.
CMt (0)
The added mass coefficient in the tangential direction of the cable.

31
2. The input file

cableType1={
diameter = 0.05;
gamma0 = 1.5; % (default: rho*area)
rho = 7800; % (default: gamma0/area)
materialModel = {
type = ’bilinear’;
EA = 1e4;
xi = 10;
}
CDn = 1; % (default: 0)
CDt = 0.1; % (default: 0)
CM = 2; % (default: 0)
}

32
2.9. Material models

2.9 M ATERIAL MODELS

The material model is a substructure of the cableType and contains the informa-
tion about the constitutive relation of the cable. Moody uses the cable elongation
(δL/L0 −1) as strain input to the force-strain relation. Several non-linear responses
are implemented for the axial force, but bending stiffness is always linear.
type
The type name. Several types exist. See individual keywords further down.
EA (E ∗ A) [N]
The mean axial stiffness of the cable. In nonlinear materials, this value is
used as an approximation when computing the initial condition of the cable
analytically. If not present, it is computed from E input and cable area.
xi (0) [Ns]
The linear internal damping coefficient of the material. The internal damp-
ing force is added to the tension force from the material type and is com-
puted as a linear strain-rate dependence as T ξ = ξ˙ .
EI (0) [kNm2 ]
The bending stiffness of the cable.
compressionScale (0)
Scale factor for the compression stiffness. Negative tension is computed as
compressionScale*EA*strain. Needs to be set explicitly to model beams
with high bending stiffness. Reduce value if buckling occurs.
type=bilinear
Computes the axial tension force of the cable according to Hooke’s Law,
but disallows compressive forces. Thus T = max (EA , 0).
type=exponential
This type uses an exponential strain-force relation as:
T = max (0, K (ea − 1)) , (2.6)
where K and a are defined in additional fields.
K [N]
Basic stiffness.
a
The growth-rate of the exponential function.
type=polynomial
Implements strain-force relation as a polynomial according to
 m 
 X
T = max 0, Ci  i  ,

(2.7)
i=1

33
2. The input file

where Ci is the polynomial coefficient of order i as defined by the C field


below. Additional fields of input are:

C [N]
A vector set of coefficients. First value is the linear coefficient, second
is the quadratic strain dependence and so on. The length of the vector
specifies the order of the polynomial strain-force curve. Ex:
materialModel.C = [1.0e3 2.0e3 3.0e3 4.0e3];

34
2.10. Cables

2.10 C ABLES

Cables are defined with naming convention following cable1, cable2, etc. They
are used to define the cable objects in the input file.

typeNumber
The cable type number.

vertex0
The start vertex number of the cable. This will be used as s = 0, where s is
the unstretched cable coordinate from 0 to L.

vertex1
The end vertex number of the cable. This will be used as s = L, where s is
the unstretched cable coordinate from 0 to L.

length [m]
The unstretched length (L) of the cable. For some types of initial condition,
e.g. PreStrain, the field is unused and is overwritten by the computed
value.

IC
The IC field is a substructure that defines the initial conditions of the ca-
ble. There are several options for the type of initial conditions and they are
described in section 2.11.

mesh.N
The number of elements in the cable.

mesh.P (4)
The polynomial order of the Legendre polynomial basis functions. In this
release of Moody, this option is not available. A constant P=4 is always
used.

cable1 = {
typeNumber = 1;
vertex0 = 1;
vertex1 = 2;
length = 100;
IC = {
type = ’PreStrain’;
eps0 = 0.05; % prestrain
}
mesh.N = 10; % no. of elements
}

35
2. The input file

2.11 I NITIAL C ONDITIONS

The initial conditions are specified individually for each cable object, as a sub-
structure of cable.

type
Choose the type. Each type has its own additional input fields, described
below.

type=preStrain
The cable is set to a straight line between the two end points. The length
of the cable is recomputed based on the distance between the points and the
specified initial pre-strain. Gravity is not taken into account..

eps0
The initial pre-strain of the cable. Input is dimensionless and can be
either a single value or a vector of values. If more than one value is
specified, the length of the vector must match the length of parts,
see below. Each part of the cable will then be given the matching
pre-strain.
parts (1.0)
The relative part of the cable subject to the strain specified in eps0.
The input is a vector of the same size as eps0 and the sum of all
the values must be 1. The values of parts relates to the unstretched
length fractions of the cable.

IC = {
type = ’PreStrain’
eps0 = [0.01; 0.02]; % different prestrains
parts = [0.5,0.5]; % corresponding sections
}

type=straightLine
Similar to prestrain, but uses cable length by default. This option should be
used to avoid re-definition of cable length during static analysis.

eps0
The pre-strain of the cable, overrides length input if present.

type=catenary
The cable is set to be an elastic catenary shape at rest. This option only
works when gravity is non-zero. Ground interaction is detected analytically,
so the cable is initially set to lie still exactly at the ground level. No further
input is required.

36
2.11. Initial Conditions

type=sine
Sine type is an extension of type preStrain. A sinusoidally varying dis-
placement is imposed on a pre-strained cable. The sinusoidal displacement
is in the vertical direction only.

amplitude (0) [m]


The amplitude of vertical displacement. When set to 0, the result is
the same as for type ’preStrain’.
periods (0.5)
The number of sinusoidal periods to use along the cable. Default is a
single bubble displacement, i.e. 0.5 periods.
eps0 (0.0)
The desired pre-strain in the cable before the sinusoidal displacement.
The input is a single value that is applied to the whole cable.

IC = {
type = ’Sine’;
amplitude = 1; % [m]
eps0 = 0.01;
periods = 0.5;
}

37
2. The input file

2.12 C OMPONENTS

As of Moody 2.1, axial springs and dampers can be defined. They are defined by
keyword component1, component2, etc.

vertex0
Start vertex.

vertex1
End vertex.

type=spring
Models a massless spring-damper between two points. Force is constant
along the spring and is reported in outward-pointing normal direction at
its ends. It expects a vector of input variables interpreted as polynomial
coefficients. See the theory manual for more information. A self-explaining
example is provided below.

stiffness [0] (N/mi )


Vector of stiffness. Each entry corresponds to a polynomial order. [a]
is in N/m, [a,b] is in [N/m, N/m2 ] etc.Fc = i=1
PN
Ci (L − L0 )i , with N
being length of stiffness input and L0 the restlength.
damping [0] (Nsi /mi )
Vector of damping. Each entry corresponds to a polynomial order. [a]
is in Ns/m, [a,b] is in [Ns/m, Ns2 /m2 ] etc. Fd = i=1
PN
Di vi , with N as
the length of damping input, and v as the axial velocity.
restLength (0) [m]
Restlength of the component, at which point it gives no stiffness force.
constantForce (0) [N]
Constant force offset applied by the component. Positive values are
tension forces, negative are compressive forces.
allowCompression (0) [-]
Switch to allow compressive forces or not in the component.

component1 = {
type = "spring"
vertex0 = 2; % start vertex
vertex1 = 4; % end vertex
stiffness = [1e4]; % Linear stiffness (N/m)
damping = [26.341]; % Linear damping (Ns/m)
restLength = 0; % Rest length (m)
allowCompression = 0; % Switch on compression
}

38
2.12. Components

type=tabulated
A two-dimensional lookup table controls the force as a function of length
(x) and extensional velocity (v). Linear two-factor interpolation is used to
compute F(x,v) for each length and velocity combination. Extrapolation
is discouraged. Please ensure that values are within the table limits. The
example below explains the input table format. It describes a constant 5N
spring with 0 force at 0 length, with a 10N constant damper at 10m/s exten-
sion, not activated in compression.

table
Expects an N+1 by M+1 matrix. First row contains M component
lenghts, first column contains N component extensional velocities (m/s),
and the remaining matrix contains the force values at the given length
and velocity coordinates. Force input is in [N].
file
Filename of table input, used instead of table for larger tables. No
comments are allowed in external file input style. Should be data only.

component2={
vertex0 = 1;
vertex1 = 5;
table = [ 0 0 10 15 20; % row1: x (m)
-10 0 5 5 5; % col1: v (m/s).
0 0 5 5 5; % rest is force (N)
10 10 15 15 15];
}

39
2. The input file

2.13 U SING source INHERITANCE

MoodyCore has a special keyword source which can be used in any input object
to link input data to a new object, or to a user-defined data label. This is used
frequently in the tutorials to copy data from one cable or body to another. All data
that is NOT specified in the object containing source will be added in the input
file parsing stage. See example from tutorial 5 below.

%--- Rigid bodies ---%


rigidBody1 = {
type = point
mass = 2000
V = 1
vertex = 2
}
rigidBody3={
source = rigidBody1
vertex = 4
}
%--- Cables ---%
cable1={
type = 1
vertex0 = 1
vertex1 = 2
IC = {
type = ’prestrain’
eps0 = 0.2
}
mesh.N = 3
}
cable2={
source = cable1
vertex0 = 2
vertex1 = 3
}
cable3={
source = cable1
vertex0 = 3
vertex1 = 4
}

40
3
Running the code

3.1 U SER INPUT

MoodyCore is operated though the terminal window. Generally, the -<flagName>


<value> syntax is used to provide run-time information to the computation. All
settings apart from the output file name prepends information in the input file.

3.1.1 Flags

-f (moodyInput.m)
Filename. Must be followed by the filename of the input file.

-o (input filename without extension)


Output filename. Must be followed by the name of the output folder.

-time.start
Specifies the start time of the simulation. Overrides information specified
in input file.

-time.end
Specifies the end time of the simulation. Overrides information specified in
input file.

-startState
This is the reboot flag of MoodyCore. If followed by a value, the value
should be an existing results folder name. If no value is specified, the de-
fault is to use the output folder if it exists. MoodyCore will start from the
mooring state at the start time of the simulation. If no results are found,
MoodyCore will start from static equilibrium, and print a warning message.

41
3. Running the code

-statics
This is a shorthand flag for solving only the static solution of the system. It
automatically sets the end time to the start time and enables the statics.solve
stage of the simulation.

-addInput
A way to specify additional changes to the input file as value pairs: -addInput
<name1> <value1> <name2> <value2>. All information prepends the
input file and thereby overrides the information in the input file.

3.1.2 Examples

moodyCore.exe -f caseFile.m
moodyCore.exe -f moodyInput.m -o outFolder -time.start 10 \
-time.end 20 -addInput simulation.time.dt 0.01

42
4
Pre processing

4.1 M ESH MANIPULATION

The moodyPre.exe utility has a direct link to the mesh manipulation functions in
MoodyCore. Using the -meshConvert flag enables reading/writing from/to mesh
formats of .stl, .gdf (WAMIT format) and .dat format (Nemoh format). Symmetric
mesh files are supported as input, however they are mirrored and printed without
symmetry flag in the output. Two additional flags are available:

-origin <x> <y> <z>


When present, expects three following input values specifying desired ori-
gin coordinate in the output mesh. Naturally, it has to be given in the input
mesh coordinate system. This option translates the mesh by -[x,y,z] m and
prints it with the new origin.

-wet <swl>
When specified, the -wet flag keeps only wet panels in the output mesh.
<swl> input is a single value specifying the position of the still water level.

NOTE: The <swl> is given relative to the origin of the output mesh.

Usage:

moodyPre.exe -meshConvert in.gdf out.stl -


moodyPre.exe -meshConvert in.stl outMesh.dat -origin 0 0 2 -wet 0

43
4. Pre processing

4.2 N EMOH CASE PREPARATION

MoodyMarine has an input form interface for building a Nemoh project case from
pure MoodyCore input. This is done by running moodyPre.exe with the -nemoh
flag. It is provided as a stage 0 execution, prior to the preProc.exe, solver.exe and
postProc.exe executions of Nemoh (v3).
The bem input is stored in two different places of the input file. The top key
bem contains the overall settings of the simulation (no of frequencies, directions
etc.), while each hydrodynamic body has its own input section for the boundary el-
ement method (BEM) stage, with keyword hydroBodyX.bemInput. In addition,
moodyPre.exe reads required environmental settings from the normal moody in-
put format. The input format is described below. Usage:

moodyPre.exe -nemoh -f moodyInput.m

4.2.1 Input file format


Nemoh case generation is integrated into the settings of the standard MoodyCore
input file.

environment
The following Nemoh input values are used in order of priority. (X) indi-
cates default value:

• density (1000) : waterDensity


• gravity (9.81) : -1*gravity
• depth (1000) : wave.depth, waterLevel-ground.level

bem
The main input setting of the Moody prepropressor interface.

body
Body id (int) to include in analysis.

LIMITATION: MoodyCore only supports single bodies IRF


simulations at present.

output
The output folder of the results. It is created if it does not exist. Only
last folder level is created.
w0 (0.01) [rad/s]
Start frequency.

44
4.3. Wave elevation

w1 (20) [rad/s]
End frequency.
nFreqs (30) [-]
Number of wave frequencies in analysis.
dir0 (0) [deg]
Starting wave direction.
dir1 (180) [deg]
End wave direction.
nDirs (5) [-]
Number of wave directions in analysis.
hydroBodyX.bemInput
Body specific data is nested in the substructure bemInput within each hy-
droBody. The chosen id is controlled by the bem.body input (required).
meshName
Name of mesh file to use in analysis. .stl, .gdf and .dat (Nemoh mesh)
formats are supported. moodyPre.exe is used to translate mesh accord-
ing to Nemoh coordinate requirements (z = 0 at the waterline).
keepMesh (0)
Switch that when 1 turns OFF any MoodyCore manipulation of the
mesh, assuming the meshName is a well-prepared Nemoh mesh file
for the analysis.
cogInMesh (0,0,0) [m]
Specify point of CoG in the raw input mesh coordinate system. Un-
used if keepMesh=1.
position (0,0,0) [m]
The position of the CoG in the global coordinate system. For best
results, this should be equivalent to the static equilibrium position of
the body (when all external loads are accounted for). This will appear
as (x,y,-z) in the Nemoh.cal file as the analysis point for all radiation
and diffraction problems.

4.3 WAVE ELEVATION

The wave elevation is not printed together with the results by default in Moody.
It can be reprocessed through the -waveElevation flag sent to moodyPre.exe.
Two input formats are supported:
-domain <X> <Y> <nx> <ny> An X*Y area surface grid with nx by ny panels
is generated. Wave elevation reported at all vertices of the surface. The do-
main setting is saved in waveDomain.dat. The domain is centered around
(0,0,0).

45
4. Pre processing

-xyFile <filename> File input format of wave probe locations. Expects file
format ascii with N lines of 2 columns, specifying the [x y] coordinates of
the probe. Wave elevation is computed at each probe.

-positions <x1> <y1> <x2> <y2> ... Output wave elevation at a given list
of probe locations. Wave elevation is computed at each probe.

-o <outputDirectory> The output is written to outputDirectory/ as


waveElevation.dat and (for -domain flag only) as waveDomain.dat.
Default is to output in the result directory of the input file, i.e. fileName
(without extension).

4.3.1 Handling output time


The wave elevation feature was developed to provide wave elevation animation
data to MoodyMarine. If time.dat is present in the same directory as the input
file location, then waveElevation.dat will provide elevation at each probe at
each timestamp of time.dat. If it is not present, output time is governed by
input file simulation.time and printed accordingly.

4.3.2 Output format


At present waveElevation.dat is printed in ascii format. One line per time
stamp, and each line has Nprobe+1 entries. First column is the time (s).

46
5
Post processing

5.1 M OODY POST

MoodyCore has a post-processing utility named moodyPost.exe. Although nodal


values are printed to the output directory, moodyPost.exe can be used to create
a smaller set of output data for post-processing. It can also be used to generate
VTK-files of the cable lines and component and their tension force magnitude for
visualisation in e.g. Kitware’s Paraview.

5.1.1 Usage

moodyPost.exe is a command line tool. The first parameter must be a moody


result directory. Default is to process all times in output/time.dat. To control
which times to process and output there are three flag options.

-times
A list of output times.
Ex. moodyPost.exe outName -vtk -times ’0,1,2,4.5’

-timeList
Use times from a file. File should be in a single column vector format with
no header.
Ex. moodyPost.exe outName -vtk -timeList timeFile.txt

-dt [s]
Use time step size dt to step through the output history.
Ex. moodyPost.exe outName -vtk -dt 0.5

Output options are:

47
5. Post processing

-vtk
Print VTK files in sub-directory VTK.
Ex. moodyPost.exe moodyResults -vtk -times ’0,1,2,4.5’

-p
Print nodal values in sub-directory processed. Optional flag -var is used
to control which parameters to output. Default is to use all.

-var Should be followed by a list of integer values in 1 to 7, where


1. tension
2. strain
3. strain rate
4. position
5. velocity
6. tangent
7. end point values.
Ex. moodyPost.exe moodyResults -p -var ’[1,4]’, prints ten-
sion and position.

-clean
The clean flag (or -c) is used to repair incomplete output. So, for cases that
have crashed or aborted, moodyPost.exe makes the output causal in time
and prints the sPlot.dat file required by the post-processing routines in
Matlab. It also truncates results to the last completed time stamp.

NOTE: It is strongly advised to backup the simulation results prior


to executing moodyPost.exe -clean, at least for time-consuming
simulations, as the command will modify the results in-place.

5.2 MATLAB ROUTINES

A set of Matlab routines and functions are provided in $moodyDir/API/matlab.


These can be used to load and visualise the results. Each cable result is analysed
separately. The most important routine is readCase.m which returns a cell array
of data structures containing the data of all cable objects and rigid bodies. Please
note that readCase assumes there exists a sPlot.dat file. If moody quit unex-
pectedly or for any other reason stopped, the sPlot.dat may be missing. In API
runs this also may mean that the time order is non-causal (due to multiple calls
of the same time-window). Prior to loading, MoodyCore output then needs to be
cleaned using: moodyPost.exe with the -clean option. See the help texts in
each function for usage instructions.

48
5.3. Python

5.3 P YTHON

Two Python scripts are included in API/python/post for those who want to view
moody results through Python. moodyPlt.py presents examples of plotting in-
formation, and is based on moodyReader.py which imports the data. These files
are released for convenience; they are not a fully documented API or post-suite.

5.3.1 Dependencies
• numpy

• matplotlib.pyplot

5.4 O UTPUT FILE STRUCTURE

The result time stamps are logged in time.dat (ascii). The first column in each
data file contains the same time data. Hence all data files have the same number
of rows. The file info.json shows the number of objects of each type in the
simulation, as well as the number of columns in each file.

5.4.1 Cable output


Nodal values are presented along the unstretched cable coordinate s for each n
output quadrature points [s1 , s2 , . . . , sn ] of the cable. Output is separated into vec-
tor valued output and scalar output. For scalars such as tension, strain and strain
rate, the output goes from the start to the end of the cable. For the vector valued
output, such as position and velocity, the data is stored consecutively for each co-
ordinate direction of the simulation, in the order x, y, z. The structure is described
in table 5.1.

5.4.2 Rigid body output


Rigid bodies are calculated directly in the physical domain. The state vector is
printed at the center of gravity acc. to Table 5.2.

5.4.3 Hydrobody output


The main output file of the body state has the same format as the rigid body output.
In the case of hydrobody linearIRF type however, the four quaternion columns
instead indicate the roll, pitch and yaw angle (radians) of the body. The fourth
column is a dummy output (0). Additionally a hydroBodyX forces.dat file
output is available. It lists the force components acting on the hydroBody. The
format is displayed in Table 5.3.

49
5. Post processing

Table 5.1: Output structure description for cable object data. Times are indexed
as t1 , t2 , . . . , tm , vector components as f = [ f x , fy , fz ] and the cable
unstretched coordinate s is indexed as s1 , s2 , . . . , sn . The moment file
only exists if bending stiffness is used.

File suffix Output structure


t1 x(t1 , s1 : sn ) y(t1 , s1 : sn ) z(t1 , s1 : sn )
.. .. .. ..
position.dat . . . .
tm x(tm , s1 : sn ) y(tm , s1 : sn ) z(tm , s1 : sn )
t1 v x (t1 , s1 : sn ) vy (t1 , s1 : sn ) vz (t1 , s1 : sn )
.. .. .. ..
velocity.dat . . . .
tm v x (tm , s1 : sn ) vy (tm , s1 : sn ) vz (tm , s1 : sn )
t1 T x (t1 , s1 : sn ) T y (t1 , s1 : sn ) T z (t1 , s1 : sn )
.. ..
tension.dat . .
tm T x (tm , s1 : sn ) T y (tm , s1 : sn ) T z (tm , s1 : sn )
t1 M x (t1 , s1 : sn ) My (t1 , s1 : sn ) Mz (t1 , s1 : sn )
.. ..
moment.dat . .
tm M x (tm , s1 : sn ) My (tm , s1 : sn ) Mz (tm , s1 : sn )
t1 (t1 , s1 : sn )
.. ..
strain.dat . .
tm (tm , s1 : sn )
sPlot.dat t1 s1 : sn

Table 5.2: Output structure of rigidBodyX.dat. The 14 data columns are time
(1), position (3), quaternion (4), velocity (3) and angular velocity (3).
The velocity and angular velocity are in the body local coordinate
system.

t1 ~p(t1 ) ~q(t1 ) ~v(t1 ) ~ (t1 )


w
.. .. .. .. ..
. . . . .
tm ~p(tm ) ~q(tm ) ~v(tm ) ~ (tm )
w

Table 5.3: Output structure of hydroBodyX forces.dat. The 37 data columns


are: time (1), excitation (or diffraction) force (6), radiation force (6),
added mass force (6), restoring force (6), quadratic drag force (6), and
linear drag force (6). The drag forces are in the body local coordinate
system.

t1 F~exc (t1 ) F~rad (t1 ) F~add (t1 ) F~res (t1 ) F~quad (t1 ) F~lin (t1 )
.. .. .. .. .. .. ..
. . . . . . .
tm ~
Fexc (tm ) ~
Frad (tm ) ~
Fadd (tm ) ~
Fres (tm ) ~
Fquad (tm ) ~
Flin (tm )

50
5.4. Output file structure

Table 5.4: Output structure of componentX.dat. The file is stored in ascii format.

t1 ~p0 (t1 ) ~p1 (t1 ) ~v0 (t1 ) ~v1 (t1 ) F~1 (t1 )
.. .. .. .. .. ..
. . . . . .
tm ~p0 (tm ) ~p1 (tm ) ~v0 (tm ) ~v1 (tm ) F~1 (tm )

5.4.4 Component output


The component output file (componentX.dat) is presently only implemented in
ascii format. It stores the positions, ~p and velocities ~v at the end points 0 and 1 re-
spectively. It also prints the force vector at vertex1 (outward-pointing tangential
direction of component. See Table 5.4.

51
6
API documentation

6.1 I NTRODUCTION

MoodyCore as a mooring module can be used as an add-on for external solvers of


the the fluid problem. We call this usage API-mode. When MoodyCore is started
up in API-mode, an external solver is guiding the time evolution of some of the
boundary conditions. In this way MoodyCore can be used as a mooring module
for hydrodynamic simulations of wave-body interaction. The interaction between
the codes follows the schematics of Figure 6.1.
When the time step size of the external solver is larger than the internal time
step of Moody, a sub-step is used internally in MoodyCore. MoodyCore then in-
terpolates in time between the old and the new boundary values received. Quadratic
interpolation with optional time staggering is used. See the theory sections A.8
for a description of the interpolation. A discussion on how different choices of
interpolation can affect the solution can be found in [4]. We recommend to use
staggeredTimeFraction =0.5, which gives good and stable results for most
applications, provided that a reasonably high sample rate is used.

6.2 I NTERFACE FUNCTIONS

The program interface is made up of global functions:

(i) moodyInit - initialisation routine

(ii) moodySolve - compute and return the mooring forces

(iii) moodyClose - close the moody objects and clean the output files

(iv) moodyGetNumberOfPoints - return the number of quad-points in the moor-


ing system.

53
6. API documentation

Figure 6.1: Schematic description of the information loop between Moody and
an external software, represented by an OpenFOAM CFD simula-
tion.

(v) moodyGetPositions - return the coordinates of all quad-points in the moor-


ing system.
(vi) moodySetFlow - sets the flow velocity, acceleration and density at each of
the quadpoints of Moody. Used for one-way coupling of high-fidelity fluid
simulations.

6.2.1 Description
The interface is contained in $moodyDir/include/moodyWrapper.h, together
with a description of all interface parameters required. The following is an excerpt
from moodyWrapper.h, showing the definition of the interface functions.
/ * * I n i t i a l i s a t i o n c a l l t o moody . R e q u i r e d t o s e t u p t h e API .
P a r a m e t e r fName : i n p u t f i l e name ( i n c l u d i n g p a t h and e x t e n s i o n )
Parameter nVals : number o f v a l u e s i n p a r a m e t e r i n i t i a l V a l u e s
Parameter i n i t i a l V a l u e s : a r r a y of i n i t i a l v a l u e s of the boundary c o n d i t i o n s (
g l o b a l frame )
Parameter startTime : time a t s t a r t of s i m u l a t i o n ( s )
*/
v o i d m o o d y I n i t ( c o n s t char * fName , i n t nVals , d o u b l e i n i t i a l V a l u e s [ ] , d o u b l e
startTime ) ;

/ * * S o l v e s t h e i n t e r n a l s y s t e m o f m o o r i n g d y n a m i c s b e t w e e n t i m e t 1 and t 2 .
P a r a m e t e r X: Boundary c o n d i t i o n v a l u e s a t t i m e t 2 .
Parameter F : Returned as t h e outward p o i n t i n g mooring f o r c e s f o r each
boundary c o n d i t i o n dof .
Parameter t1 : Time o f l a s t c a l l , s t a r t t i m e o f t i m e i n t e g r a t i o n .
Parameter t2 : End t i m e o f p r e s e n t t i m e s t e p s i m u l a t i o n .

Note : t 1 and t 2 a r e s t o r e d i n t e r n a l l y , w i t h c o r r e s p o n d i n g s t a t e s o f t h e
m o o r i n g d y n a m i c s . I f t 1 h a s i n c r e a s e d s i n c e t h e l a s t c a l l , moody w i l l
move f o r w a r d i n t i m e and s t o r e t h e s t a t e a t t 1 a s t h e new s t a r t i n g s t a t e
o f t h e m o o r i n g d y n a m i c s . S e v e r a l i t e r a t i o n s c a n be made w i t h v a r y i n g t 2
b u t t h e same t 1 w i t h o u t l o o s i n g t h e b a c k u p s t a r t i n g s t a t e . C o m p a t i b l e
with p r e d i c t o r / c o r r e c t o r t y p e time s t e p p i n g schemes .

54
6.3. Input file entries

*/
v o i d moodySolve ( c o n s t d o u b l e X [ ] , d o u b l e F [ ] , d o u b l e t 1 , d o u b l e t 2 ) ;

/ * * C l o s e s t h e moody s i m u l a t i o n and s t o r e s d a t a f o r p o s t p r o c e s s i n g * /
v o i d moodyClose ( ) ;

/ * * I n t e r f a c e f u n c t i o n t o c o l l e c t m o o r i n g p o i n t s from moody . R e t u r n s t h e number


o f p o i n t s . XYZ i s 3 * n P o i n t s . * /
i n t moodyGetNumberOfPoints ( ) ;

/ * * C o l l e c t m o o r i n g q u a d r a t u r e p o i n t s i n xyz l i s t . xyz n e e d s t o be a c o n t a i n e r o f
a t l e a s t n P o i n t s I n *3 d o u b l e s . * /
v o i d m o o d y G e t P o s i t i o n s ( i n t n P o i n t s I n , d o u b l e xyz [ ] ) ;

/ * * S e t f l o w v e l o c i t y ( vF ) a c c e l e r a t i o n ( aF ) and d e n s i t y ( r h o F ) a t t i m e t i n a l l
n P o i n t s o f t h e m o o r i n g s y s t e m . n P o i n t s s h o u l d be o u t p u t from
moodyGetNumberOfPoints ( ) and c o n t a i n e r s vF , and aF must be a t l e a s t n P o i n t s * 3
i n s i z e . r h o F must be a t l e a s t n P o i n t s . * /
v o i d moodySetFlow ( c o n s t d o u b l e t , i n t n P o i n t s , c o n s t d o u b l e vF [ ] , c o n s t d o u b l e aF
[ ] , const double rhoF [ ] ) ;

The input file for an API simulation requires some additions for the code cou-
pling to work.

6.3 I NPUT FILE ENTRIES

Two modes of boundary condition are supported for control via the API keywords:
externalPoint and externalRigidBody. See section 2.7 for information on
their individual setup. Other input file entries for the API are grouped under the
simulation.API keyword. The following fields are available to control the sim-
ulation behaviour, where some are simply input-file versions of the command-line
flags described in chapter 3:

bcNames
This is the only required field of the simulation.API input structure. It lists
the boundary conditions that are to be externally controlled. The order of
the input tells MoodyCore how to interpret the input in the initialValues
parameter of moodyInit and in the X parameter in moodySolve. By ex-
tension it also controls the order of the forces returned in parameter F in
moodySolve.
Ex: API.bcNames = {’bc4’; ’bc5’; ’bc1’};

staggerTimeFraction (0.0)
Used to control the API time staggering for a smoother mooring behaviour.
Value α should be a scalar α ∈ [0, 1], specifying a fraction of the latest time
step at which to stop the mooring simulation and return the mooring force.
Default is α = 0.0, but recommended value is α = 0.5. End time of each
coupling step is then computed from tend = (1 − α)t2 + αt1 .
Ex: API.staggerTimeFraction = 0.5

55
6. API documentation

output (input file name)


The name of the MoodyCore output directory of the simulation. Equivalent
to the -o flag, but read from input file in API mode.
Ex: API.output = ’moodyResults’

reboot (yes)
This flag controls the startup behaviour of MoodyCore in API mode. De-
fault value is ’yes’ and tells MoodyCore to attempt a reboot from a dy-
namic state at startTime of moodyInit call in the output directory. New
output is then appended to the previous results. To disable use of old re-
sults use API.reboot=’no’. If API.reboot takes any other string value,
this should be a result directory that can be used as a source state for the
simulation. The source directory is then unchanged by the simulation.
Ex: API.reboot = ’no’

syncOutput (1)
Integer value 0 or 1 allowed. If 1, MoodyCore results are printed at each
coupling time (in addition to at each saveInterval). If 0, output is only
printed based on Moodys’ internal print.dt.
Ex: API.syncOutput = 1

6.4 F ORTRAN , M ATLAB AND P YTHON INTERFACE FUNCTIONS

There is a Fortran module with interface functions to Moody, to facilitate coupling


to Fortran codes. There is also a Matlab API which allows for easy prototyping
of coupled simulations from Matlab. An API to python, which is mostly for post
processing at the present time. All interfaces are located in the API/<language>
location.

6.5 T ESTING THE API

Finally, there is a testAPI.x program for testing a MoodyCore API setup. The
following example simulates the mooringSystem.m run via the time series spec-
ified in the positions.txt file. The time series should be in simple text-file
format with no header line. The first column specifies the time, and the remaining
columns specify the values of each api input dof respectively. See the Matlab API
tutorial for an example of positions.txt. The utility supports an optional flag
-startTime expecting a value in seconds at which to start the new simulation.
Please note that if API.reboot=’yes’ is set in the input file, MoodyCore will
attempt to reload and dynamically start from the previous results (as named by

56
6.5. Testing the API

API.output in the input file) at the specified -startTime. Default is to start at the
first time of positions.txt.

testAPI.exe mooringSystem.m positions.txt -startTime 5

As of version 3.0, testAPI.exe also works with input from a moody result
folder (if from an API run). The API values.dat file is of the same format as
expected by testAPI.exe. A coupled simulation can therefore be re-simulated
in uncoupled mode using new MoodyCore inputs by the following syntax:

testAPI.exe mooringSystem.m oldAPIResults/API values.dat

57
REFERENCES

[1] B. Cockburn and C.W. Shu. The local discontinuous Galerkin method for time-
dependent convection-dominated systems. SIAM J. Numer. Anal., 35(6):2440–2463,
1998.

[2] W.E. Cummins. The impulse response function and ship motions. Schiffstechnik,
9:101–109, 1962.

[3] J.R. Morison, M.P. O’Brien, J.W. Johnson, and S.A. Schaaf. The force exerted by sur-
face waves on piles. Petroleum Transactions, Amer. Inst. Mining Engineers, 186:149–
154, 1950.

[4] J. Palm. Mooring Dynamics for Wave Energy Applications. PhD thesis, Chalmers
University of Technology, 2017.

[5] J. Palm and C. Eskilsson. Influence of bending stiffness on snap loads in marine ca-
bles: A study using a high-order discontinuous Galerkin method. Journal for Marine
Science and Engineering, 8(10):795, 2020.

[6] J. Palm and C. Eskilsson. Mooring systems with submerged buoys: influence of
floater geometry and model fidelity. Applied Ocean Research, 102:102302, 2020.

[7] J. Palm and C. Eskilsson. On endstope. In EWTEC, September 2021.

[8] J. Palm, C. Eskilsson, and L. Bergdahl. An hp-adaptive discontinuous Galerkin


method for modelling snap loads in mooring cables. Ocean Engineering, 144:266–
276, 2017.

[9] A. Tjavaras. The Dynamics of Highly Extensible Cables. PhD thesis, Massachusetts
Institute of Technology, 1996.

59
A
Theory manual

A.1 BACKGROUND

Moody is built around an hp-adaptive cable solver based on the discontinuous


Galerkin method, with an approximate Riemann solver of local Lax-Friedrich
type, see.This manual outlines the governing equations and highlights the mod-
elling approach used in the implementation. The section on cable dynamics is
mostly compiled from Palm and Eskilsson [5] where bending stiffness was intro-
duced in the modelling, while the rigid body section originates from Palm and
Eskilsson [6] where submerged buoy dynamics was presented. In addition, the
section on API boundary condition interpolation is collected from the PhD thesis
of Palm [4].

A.2 C ABLE DYNAMICS

The cable equation of motion is the balance between inertial, internal and external
forces on the cable:

d~ν dT~ ~
= + fe , (A.1)
dt ds
in which ~ν = γ0~v is the cable momentum per meter (mass per meter γ0 times
velocity ~v), T~ is the internal tension force and f~e represents the external forces.
We denote the axial cable strain (elongation) by  with elongation factor l =
1 + . The cable tension force can be divided into axial and transversal forces as:

T~ = T (, ˙ ) ı̂ + T~s , (A.2)

where T is the axial force magnitude and T~s is the shear force vector. The axial
tangent vector ı̂ and the strain  can be written in terms of the cable position vector

61
A. Theory manual

~r as:
d~r
~q = , (A.3)
ds
q
= ~q · ~q − 1 , (A.4)
~q
ı̂ = . (A.5)
l
We use ~ν and ~q as independent variables in the inertial frame and use the time
derivative of Equation (A.3) to arrive at an expression for ~q˙ ,

d ~ν
!
d~q d~v
= = . (A.6)
dt ds ds γ0

Equations (A.1) and (A.6) can be written in conservative form as:

d  ~q  d  ~ν/γ0   ~0 


     
 =  + , (A.7)
dt  ~ν  ds  T~   f~ex 

which transforms to:

d~u dF~ ~u

= +G ~ ~u , (A.8)
dt ds
~ and a source term
h i
in terms of a single state vector ~uT = ~q ~ν ; a flux vector F;
~
G.

A.2.1 External Forces


The f~ex in Equation (A.1) represents the total body force on the cable segment.
The force can be divided into:

f~ex = f~a + f~b + f~c + f~d , (A.9)

where f~a is the force from the added mass and the Froude–Krylov effect, f~b is the
buoyancy force, f~c represents contact forces and f~d stands for the drag force.
Added mass f~a : In the Morison equation [3], the added mass force on a slender
body is assumed to be proportional to the relative acceleration between the body
and the flow. Hence, the added mass acting on the cable cross-section is:

f~a = ρf A ~aw⊥ + Cmı~a∗ı + Cm⊥~a∗⊥ ,



(A.10)

where A is the cross-section area of the cable, ρf is the fluid density, ~a∗ = ~aw − ~v˙ is
the relative acceleration of the fluid with respect to the cable, and subscripts ı and
⊥ denote the tangential and perpendicular components of a vector quantity. Cmı

62
A.2. Cable dynamics

and Cm⊥ represent the added mass coefficients in the tangential and perpendicular
direction of the cable, respectively. Please note that there is no dependency of
cable strain as we assume a volume-preserving material, in which the cable elon-
gation factor l is cancelled by the same decreasing factor on the cross-section
area.
Buoyancy, f~b : The buoyancy term is the sum of the cable weight and the
buoyant Archimedes force,

f~b = Ag (ρf − ρc ) ẑ , (A.11)

where g = 9.81m/s2 is the gravitational constant. Elongation does not affect buoy-
ancy, due to the assumption of a volume preservation.
Contact forces, f~c : Contact forces refer to the contact between the cable and
the ground. This is modelled as a vertical bilinear spring-damper system with
dynamic friction in the horizontal direction. The vertical force is computed from
the cable penetration depth δ = zg − rẑ and the vertical cable velocity vẑ as:
p  q 
~
fc = l Kg dδ − ξ2 Kg dγ0 vẑ ,
(z)
(A.12)

where Kg is the bulk modulus of the ground, zg is the vertical coordinate of


the ground and ξ is the damping coefficient (ξ = 1 indicates critical damping).
The horizontal friction force is proportional to the horizontal velocity of the ca-
ble, ~v xyˆ = ~v − vẑ ẑ, up to a threshold speed vµ beyond which the magnitude is
constant. The dynamic friction force is computed from:

|~v xyˆ | ~v xyˆ


!
~ min f~b(z) , 0 ,
p  
fc = l µ tanh π
(xy)
(A.13)
vµ |~v xyˆ |

where µ is the fully developed dynamic friction coefficient.


Drag forces, f~d : The cable drag is also modelled as in the Morison equa-
tion [3]. Based on the relative velocity between the fluid and the cable, ~v∗ = ~vf −~v,
we compute it as:

f~d = 0.5dρf l Cdı ~v∗ı ~v∗ı + Cd⊥ ~v∗⊥ ~v∗⊥ ,


p  
(A.14)

with d being the nominal diameter of the cable and Cdı and Cd⊥ being the drag
coefficients in the tangential
√ and perpendicular directions. The nominal diameter
decreases by a factor l with increasing , while the cable length √ factor is by
definition l . In combination, the drag force therefore scales with l as the cable
stretches.

A.2.2 Shear Force Modelling


We model the cable by adapting the local Lagrangian frame formulation described
in [9] to the inertial frame of reference. The main assumptions are: (i) that there

63
A. Theory manual

are no distributed moments acting on the cable; (ii) that the cable cross-section is
axisymmetric; and (iii) that the inertial effects of rotating the cross-section can be
neglected. The balance of moments equation for a linearly visco-elastic material
with bending stiffness EI, bending damping ξb , and torsional stiffness GI p thus
reads:
∂  M~
 
0=  2  + l ı̂ × T~s , (A.15)
∂s l
~ = GIp Ω1 ı̂ + ı̂ × (EIκ + ξb κ̇) ,
M (A.16)
˙
∂ı̂ ∂  ~q − ~q˙ 

in which we define the curvature ~κ = and its time derivative κ̇ = .
∂s ∂s

l
The bending moment vector is thus acting in the binormal direction. Taking the
cross-product from the left on Equation (A.15) allows us to solve for the shear
force as:
∂ ~  1 ∂M~∗
 
1  M
T~s = ı̂ ×  2  = ı̂ × , (A.17)
l ∂s l l ∂s
M~
~∗ =
where M represents the moment in the stretched domain used for boundary
l2
conditions. Finally, we note that the torsional stiffness is the only ı̂ component in
Equation (A.15), which leads to a simplistic model for the torsional curvature Ω1 :
∂  
GIp Ω1 = 0 . (A.18)
∂s
This is a consequence of all three assumptions (i)–(iii) stated above (see [9]
for further information); however, the most important factor is the assumption of
a circular cross-section. The torsional moment is constant along the cable, and Ω1
can be globally computed from the boundary conditions of the cable system at
each time step. Torsion is not supported in the present version of Moody.

A.2.3 Tension-Strain Relations


To complete the set of equations, we need to define the scalar function T (, ˙ )
relating cable strain and its rate of change to the axial tension force. See the user
manual for the definition of the different choices of material model available.

A.3 F INITE E LEMENT M ETHOD

We use a Discontinuous Galerkin (DG) finite element formulation of Equation (A.8).


The computational domain Ω is partitioned into N elements Ωe ∈ [seL , seR ] with size
he . A function x(s, t) is approximated to an arbitrary order P within Ωe as:
k=P
X
x(s, t) ≈ x (s, t) =
e
φk (s) x̃ke (t) ,
k=0

64
A.3. Finite Element Method

where φk (s) is the kth order trial function with expansion coefficient x̃ke . Legendre
polynomials are used as test and trial functions in this study. Defining the inner
product operator ()Ωe as:
Z
(a(s, t), b(s, t))Ωe = a(s, t)b(s, t)ds ,
Ωe

the DG formulation expressed in strong form within Ωe reads:


∂φ  seR
! 
F̃ + F~ − F~ +
m
(φl , φm )Ωe u̇˜ = φl ,
e e
+ (φl , G)Ωe . (A.19)
b
∂ξ Ωe seL

The DG method uses a numerical flux (denoted withb· in Equation (A.19)) to


express the value of a quantity on an element boundary. In this paper, we use:
1  ~+ ~−
F~ = F + F + λ n−~u+ + n+~u− ,

(A.20)
b
2s
1 ∂T
λ= , (A.21)
γ0 ∂
where n is the outward pointing unit normal, λ is the speed of sound in the cable
and F~ is represented by the Lax–Friedrichs flux of F. ~ Superscripts + and − indicate
b
if values are taken from the interior domain (i.e., from Ωe in this case) or from the
neighbouring element of the boundary (i.e., Ωe+1 or Ωe−1 , respectively). See [8]
for details.
Bending stiffness is introduced via the shear force using a local DG (LDG) [1]
approach to compute the derivatives in Equations (A.16) and (A.17). Three aux-
iliary variables are used in the LDG formulation for the modal shear force T̃ s : (i)
κ, the cable curvature, (ii) κ̇, the curvature rate of change, and (iii) τ, the spa-
tial derivative of the moment vector. The modal coefficients, ˜·, of these auxiliary
variables are for each element found from:
∂φm
! i se
ı̂˜e + bı̂ − ı̂+ Re ,
h
(φl , φm )Ωe κ̃ = φl ,
e
(A.22)
∂ξ Ωe sL

∂φm  se
! 
(φl , φm )Ωe κ̇ = φl ,
˜ e ˜
ı̂ + ı̂ − ı̂
˙ e ḃ ˙ + R
, (A.23)
∂ξ Ωe seL

∂φm  seR
! 
(φl , φm )Ωe τ̃ = φl ,
e
M̃ + M
e ~∗ − M
b ~∗+
, (A.24)
∂ξ Ωe ∗ seL

remembering that M ~ ∗ is the stretched domain moment from Equation (A.17). T~s
1
is then recovered from T~s = ı̂ × ~τ. The numerical fluxes are chosen as:
l

bı̂ = 1 ı̂+ + ı̂−  + β ı̂+ n− + ı̂− n+  , (A.25)


2
~∗ = 1 M ~ ∗+ + M~ ∗− − β M ~ ∗+ n− + M ~ ∗− n+ ,
   
M (A.26)
c
2

65
A. Theory manual

Table A.1: Table of fluxes required for different typical connections used in a
mooring system. Index BC indicates a prescribed value at the bound-
ary, and ”+” indicates a value taken from the internal domain. ~v(RB P)
is the velocity of the connection point P of the rigid body.

Description ~v
b ~
T
b b̂ı ḃı̂ ~∗
M
c

Prescribed motion, pinned ~vBC T~ + ı̂+ ı̂˙+ ~0


Pinned joint ~0 T~ + ı̂+ ı̂˙+ ~ ∗+
M
Free cable end ~v+ ~0 ı̂+ ı̂˙+ ~0
Clamped fixed end ~0 T~ + ı̂BC ~0 M~ ∗+
Point force and moment ~v+ T~BC ı̂+ ı̂˙+ ~ ∗BC
M
Rigid body connection at point P ~v(P) T~ + ı̂+ ı̂˙+ ~0
RB

where the β ∈ [−0.5, 0.5] parameter governs the amount of flux taken from the left
and right side respectively for each equation. Moody is released with a centred
~ ∗ in the results.
scheme (β = 0) to avoid one-sided bias on the auxiliary variable M

A.3.1 Boundary Conditions

The boundary conditions are introduced via numerical flux values at the edges
of the finite element domain. The original Lax–Friedrichs formulation without
bending stiffness [8] required the numerical fluxes of velocity b ~v or the tension
force vector T~ to be given as the boundary condition on the domain boundaries.
b
The implementation of the nested LDG method for bending stiffness additionally
requires that fluxes for the cable tangential vector bı̂ or for the total moment vector
M
c~ ∗ be defined. Finally, if bending damping is included, also the time derivative of
the cable direction ḃı̂ is required. Boundary conditions for the auxiliary variables ı̂
or M~ ∗ associated with the bending stiffness may be specified independently of the
conditions set for the cable velocity and tension force at each end point. Variables
for which no boundary condition is specified are reactions and are simulated by
collecting the flux from the interior domain. Table A.1 describe the combinations
of boundary conditions required to model some typical end point properties for
marine cables. We use the term pinned to describe a point where no moments are
transferred. When moments are transferred, we label the condition as a clamped
one.

A.4 C OMPONENTS

Currently, only spring-dampers are the only component implemented in Moody.

66
A.5. Rigid body dynamics

A.4.1 Spring-dampers
Spring-dampers are mass-less components that compute axial tension force based
on relative displacement and velocity between its two attachment points ~r1 and ~r2 .
The rest-length L0 , and the current length L = ~r2 − ~r1 , gives the elongation as
x = L − L0 (m). The inline relative velocity is computed as v = ~r˙2 − ~r˙1 · tˆ, where
tˆ = (~r2 − ~r1 )/L is the unit tangential vector. The tension force is computed as a
polynomial (power series), according to (A.27).

 PC PD

 X X
T = max 0, C i xi + Di vi  ,

(A.27)
i=1 i=1

where Ci and Di are the polynomial coefficient of order i. PC and PD denote the
polynomial orders of the respective polynomials.

A.5 R IGID BODY DYNAMICS

A.5.1 Coordinate systems


Let X = { x̂, ŷ, ẑ} be the inertial frame, and I = {ı̂, ̂, k̂} denote the body fixed
coordinate system with origin in the centre of mass, see Fig. A.1. Here O ~ X is the
centre of gravity of the buoy (in the inertial frame), coinciding with the origin
of I. The buoyancy centre (OB) ~ and the attachment points of the mooring lines
~
(OM i ) are both expressed in the local frame of reference. The unit quaternion

Figure A.1: Schematic view of the relation between the body-fixed coordinate
system I and the inertial frame X.

~b = [b0 b1 b2 b3 ] relates the orientation of the body frame to the inertial frame.

67
A. Theory manual

Further, the rotation matrix R(~b) transforms vector components from X → I is


written
 σb + B11 B12 + B03 B13 − B02 
 

R =  B21 − B03 σb + B22 B23 + B01  ,


 
(A.28)
B31 + B02 B32 − B01 σb + B33
 

in which Bi j = 2 ~b ⊗ ~b , and σb = b20 − b21 − b22 − b23 . The inverse transform is


 

described by R−1 = RT .

A.5.2 Equations of motion


A body connected to N cables is expressed as
N
d  b  ~b ~b ~b X ~
M ~u = Fa + Fb + Fd + Fi , (A.29)
dt i=1
h iT
where Mb is the 6 × 6 mass matrix, ~ub = ~vb ω ~ b is the 6 × 1 state vector of
velocity representing linear, ~vb , and rotational, ω
~ b , velocities of the body. The
body is affected by added mass, F~ab , buoyancy forces, F~bb , and drag forces, F~db , as
PN ~
well as the restraining action of the mooring lines i=1 Fi .
~ ~
The time derivatives of OX and b can be updated from the velocity ~vb and the
angular velocity ω~ b as
~X
∂O
= RT~vb , (A.30)
∂t
 
 b0 −b1 −b2 −b3 
∂~b 1  b1
   
b0 −b3 b2   0 
=   . (A.31)
∂t
 
2  b2
 b3 b0 −b1 
 ω
 ~ b 

b3 −b2 b1 b0

Here O~ X is a position vector in the inertial frame X while all other state vectors
have components in the Lagrangian frame (I). Expressing Eq. (A.29) in I and
separating the rotational and translational degrees of freedom gives
 b ∂~vb 
 
N
~
 ω ~
 
 m b
× m b b 
v
∂tb  = −   + F~ b + F~ b + F~ b + F~i ,
 X
 ∂~ (A.32)
ω 
 a b d
~
ω ω
 b b 
I × I~ i=1
∂t
  b 
ρ
b f

m − V R~ g
F~bb =   ,

 
(A.33)
−OB ~ × V b ρ f R~g 
~i
 
R T
F~i =   ,
 
(A.34)
OM ~ i × RT~i 

68
A.5. Rigid body dynamics

where mb is the body mass, I is the 3 × 3 inertia matrix of the body and V b is the
volume of the body. The fluid density is denoted by ρ f and ~g is the acceleration
of gravity.
The expressions for added mass and drag damping are a bit more complicated.
The following applies for a small cylindrical buoy (relative to changes in the flow
field) with I located in the geometrical center, and k̂ along the symmetry axis.
The fluid velocity and acceleration are treated as constant over the body domain
and are evaluated at the origin of I, i.e. ~v f = ~vOf and ∂~v f /∂t = ~aOf . Then, using
∂~vb /∂t = ~ab , and ∂~ ~ b , the added mass force and moment vector F~ab (6 × 1)
ωb /∂t = α
is written as

 ~aO⊥ (1 + CM1 ) − CM1~ab⊥ + (1 + CM2 ) a f − CM2 ab k̂


 f 

F~ab = V b ρ f 
Ok̂ k̂
 . (A.35)
 b 2

(h )
 − ~ b⊥ + 0k̂
CM1 α
12

The index ⊥ denotes vector projection onto the ı̂, ̂ plane and hb is the cylinder
height. CM1 and CM2 are the coefficients of added mass perpendicular and parallel
to the symmetry axis respectively. The factor h2 /12 comes from integrating the
moment equation along the cylinder.
For drag forces, the quadratic term makes the resulting integral expressions
exceedingly expensive to evaluate, and we therefore leave the expression in inte-
gral form as

~ π(Db )
   
ρ f b 
D C Q (1)
+ C + C h b
v∗k̂ v∗k̂ k̂
F~db =
 D1
 D2 4 D3

 , (A.36)
2  ~ (2) − CD3 hb (Db )3 ωk̂ ωk̂ k̂

CD1 Q

8
Z hb /2 q
~ (1)
Q ~v∗ =

~v∗⊥ · ~v∗⊥~v∗⊥ dz , (A.37)
−hb /2
Z hb /2 q
~ (2)
 
Q ~v =
∗
z ~v∗⊥ · ~v∗⊥ k̂ × ~v∗⊥ dz , (A.38)
−hb /2

where CD1 , and CD2 are the in-plane and out of plane drag coefficients of a circle
respectively, and CD3 is the sectional shear coefficient of tangential drag and Db is
the cylinder diameter. Q ~ (1) and Q
~ (2) denote the integrals over the cylinder height
as a function of the local section velocity ~v∗ = ~vOf − ~vb − ω
~ b × zk̂.
We rewrite Eqs. (A.29)–(A.31) in terms of a state vector with 13 degrees of
freedom

~ X , ~b, ~ub .
iT
~b = O
h
U (A.39)

For submerged bodies, the effective mass matrix Mbe describing inertial effects of
the body and the surrounding fluid is constant in the body-fixed coordinate system.
Further, if the centre of mass coincides with the centre of buoyancy Mbe reduces

69
A. Theory manual

to a diagonal matrix written as

 m + V b ρ f CM1
 b 

 
 mb + V b ρ f CM1 
   mb + 2V ρ CM2
 b f

 
diag Mbe =   ,

hb (A.40)
Iı̂ + αhCM1
 
 
I ̂ + αhCM1
 
 
 
Ik̂

with αh = (hb )2 /12, derived from Eq. (A.35). The constant inverse of Mbe is then
trivially computed.
Forces and moments from each mooring cable are computed in I based on the
attachment point location OM~ i , see Eq. (A.34). The position and velocity of point
M~ i in X are then

~ (X) = O
M ~ X + RT OM
~ i, (A.41)
i
~ (X)
∂M
~ i ,
 
i
= RT ~vb + ω
~ b × OM (A.42)
∂t
which are used as boundary conditions for any cable connected to attachment
~ i.
point OM

70
A.6. Wave kinematics and wave-body interaction

A.6 WAVE KINEMATICS AND WAVE - BODY INTERACTION

MoodyCore uses the first order velocity potential to describe the incident wave
field from one or several wave components. The choice of zero phase differs be-
tween different boundary element solvers for the radiation-diffraction problem,
and the formulation for the incident wave potential is therefore slightly different.
To simplify notation, the following relates to a single regular wave component.
The formulation used in MoodyCore is based on an intuitive regular wave com-
ponent elevation η as
 
η = a cos(k x x + ky y − ωt + φ) = < aekx x+ky y−ωt+φ , (A.43)

with a - amplitude, k x and ky the wave number components in x and y respectively,


ω as the angular frequency, φ as the wave phase and t as the time. To the first order
linearisation of the free surface condition, the elevation relates to the velocity
potential as
∂Φ(z = 0)
+ gη = 0 , (A.44)
∂t
We therefore follow the Nemoh notation and define the complex incident wave
potential ΦI as
ag
ΦI = −i Z(ζ)ekx x+ky y−ωt+φ , (A.45)
ω
cosh k(h + ζ)
Z(ζ) = , (A.46)
cosh kh
where ζ is the Wheeler stretched vertical coordinate acc. to Eq. (A.47) and Z(ζ)
is the depth variation factor, which is evaluated as ekζ below the deep water limit
defined in moody core as: kζ ≤ π. By following the same definition as Nemoh and
Capytaine, the resulting excitation forces from these codes can be used directly in
MoodyCore.

A.6.1 Wheeler stretching


The Wheeler stretching method is applied to the vertical depth variation function
Z(ζ) to approximate wave pressure and kinematics up to the instantaneous wave
elevation η(t). The vertical coordinate of the inertial frame z is transformed to ζ
as
h+z
!
ζ(z, η) = h −1 . (A.47)
h+η

A.6.2 First order potential flow forces


MoodyCore uses the following definitions of the first order potential flow forces
on a floating body:

71
A. Theory manual

Frad Radiation force from the radiation potential Φrad , realised through the ra-
diation Kernel (also known as the impulse response function) convolution
integral with body velocity. Linearised at the initial body position.

Fd f Diffraction force from the diffraction potential Φd f (sometimes referred to as


the scattered potential).

F (d)
f k Dynamic Froude-Krylov force from the integral of dynamic pressure in the
incident wave potential ΦI over the wetted body surface.

F (s)
f k Static Froude-Krylov force, being the hydrostatic pressure integrated over
the wetted body surface.

F f k Total Froude-Krylov force, the sum of static and dynamic Froude-Krylov


fk + Ffk .
forces F f k = F (s) (d)

Fex Complex-valued excitation force, Fex = F (d)


f k + Fd f

In the fully linear simulation of the Cummins equation, Fex is used to as ex-
ternal wave forcing for any wave amplitude, and the linearised hydrostatic force
F (s)
f k is transformed into a constant restoring stiffness matrix C times the body dis-
placement ~x. When the nonlinear Froude-Krylov formulation is activated, Fd f is
instead used as linearised external wave force, and the restoring force is evaluated
as the total Froude Krylov force F f k = F (s)
f k + F f k . The total FK force is reported
(d)

in the restoring force output of the body, and the excitation force output covers
only the linearised diffraction force.

A.7 S TATIC SOLVER AND RELAXATION

The static equilibrium of the total system of floating bodies, submerged buoys,
cables and components is in MoodyCore approximated through a two-step se-
quence: stage 1 - solve, stage 2 - relax.

A.7.1 Solve
The initial conditions of cables are defined as different choices of analytical quasi-
static mooring solvers with given end-points for each cable individually. That is,
for each set of vertex positions, an analytical estimate of the cable forces can be
quickly obtained. Each body (floating or submerged) is solved for at t = t0 by a
sequence of i Euler steps of step size ∆i . The velocity of each body is removed
after each step so that consistent quasi-static velocities are obtained for the tension
force of the cables.
The algorithm takes wind and ocean current steady forces on bodies into account

72
A.8. API boundary conditions

unless they have a ramp-time specified. Hydrodynamic forces on cables are how-
ever neglected in the equilibrium due to the analytical nature of the elastic cate-
nary or straight line initial conditions specified. A closer estimate of the complete
equilibrium of the system is instead obtained by the relax stage of the static
solver.

A.7.2 Relax
The relax stage is simply a fixed point iteration of the dynamic equations, with a
relaxation factor applied to the velocity states of all cables after each step. The
algorithm is experimental and prone to instabilities for high-celerity cables. Man-
ual tuning of parameters relaxIter, relaxFactor, and relaxTimestep may
be required. The relax stage is typically needed mostly for cases where no initial
transients are acceptable. In most practical applications however, an initial ramp-
ing stage is used to build up the wave field, in which case the initial transients in
the simulation can be allowed in the startup of the dynamic evaluation instead.

A.8 API BOUNDARY CONDITIONS

When coupled to an external solver (i.e. in API mode), the timestep requirement
on the cable dynamics is potentially orders of magnitude smaller than that required
by the external solver. To save computational effort, the boundary conditions that
are sent to Moody at each coupling time are interpolated to achieve intermediate
boundary conditions. The position of the attachment point is interpolated based
on constant acceleration over the time step, and a staggered process is used to
maintain smoothness.
To explain, we let tk and tk+1 be two consecutive coupling times, with corre-
sponding mooring point positions rk and rk+1 . We introduce the staggered-time
fraction φ ∈ [0, 1] and identify a corresponding mooring time tk+1
m
∈ [tk , tk+1 ] as
m
tk+1 = φtk + (1 − φ) tk+1 . (A.48)
The mooring boundary conditions
h i rD (t) and vD (t) are interpolated over the moor-
ing time step interval t ∈ tk , tk+1 as
m m

rD tkm + τ = rkm + vm k τ + 0.5ak τ ,


2

(A.49)
vD tk + τ = vk + ak τ ,
m m

(A.50)
h i    
where τ ∈ 0, tk+1
m
− tkm , while rkm = rD tkm and vm k = vD tk are taken from the
m

previous coupling interval. To close the system, we only need to define ak . Here,
we choose ak as the constant acceleration needed to satisfy rD (tk+1 ) = rk+1 , i.e.
k ∆k
rk+1 − rkm − vm
ak = , (A.51)
0.5∆2k
with ∆k = tk+1 − tkm .

73

You might also like