MoodyCoreManual-3 0
MoodyCoreManual-3 0
version 3.0
JOHANNES PALM
CLAES ESKILSSON
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
iii
CONTENTS
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
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.
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
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-2.0 Rigid body library introduced, enabling submerged buoys and clump-
weights according to [6]. Released 2019-09-20.
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.2 I NSTALLATION
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
Ex:
cd moodyAPI
tar -xzvf moody-Linux.tar.gz
source moodyCoreEnvironment
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.
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.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.
11
2. The input file
2.3 E NVIRONMENT
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
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.
type
Options are: regular, JONSWAP, custom. See further individual set-
tings.
depth [m]
The water depth used for wave modelling may be set independently. If not
specified, it is computed from waterLevel - ground.level.
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)
14
2.3. Environment
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.
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
Here, Ur is the reference speed, zr is the reference height and α is the power
exponent.
direction [deg]
Horizontal wind direction θ.
wind = {
direction = 90;
speed = 10;
zRef = 10;
rampTime = 20;
}
18
2.4. Vertices
2.4 V ERTICES
19
2. The input file
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.
20
2.5. Rigid bodies
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.
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.
24
2.6. Hydrobodies
2.6 H YDROBODIES
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.
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.
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).
26
2.6. Hydrobodies
27
2. The input file
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).
mode (fixed)
Specify BC mode for translational degrees of freedom.
rotationMode (pinned)
Specify BC mode for rotational degrees of freedom.
28
2.7. Boundary Conditions
mode=force
Model a constant force. Default models a free cable end.
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
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.
rotationMode=moment
Models a constant moment vector BC condition.
rotationMode=clamped
30
2.8. Cable types
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
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
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
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.
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.
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
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.
40
3
Running the code
3.1.1 Flags
-f (moodyInput.m)
Filename. Must be followed by the filename of the input file.
-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
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:
-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:
43
4. Pre processing
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:
environment
The following Nemoh input values are used in order of priority. (X) indi-
cates default value:
bem
The main input setting of the Moody prepropressor interface.
body
Body id (int) to include in analysis.
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.
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.
46
5
Post processing
5.1.1 Usage
-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
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.
-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.
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
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.
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.
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 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 )
51
6
API documentation
6.1 I NTRODUCTION
(iii) moodyClose - close the moody objects and clean the output files
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.
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 ( ) ;
/ * * 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.
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
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
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.
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:
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.
[9] A. Tjavaras. The Dynamics of Highly Extensible Cables. PhD thesis, Massachusetts
Institute of Technology, 1996.
59
A
Theory manual
A.1 BACKGROUND
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:
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
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.
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:
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,
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)
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.
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.
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
∂φ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
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
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
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
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.
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
described by R−1 = RT .
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
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
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
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)
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.
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.
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.
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.
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
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