1 Open hydrodynamic simulations

This study presents new developments of Vessel.js, an open-source library introducing methods for simulation of vessels and marine operations with a web-based approach [1]. In conjunction with other tools and libraries, Vessel.js allows the creation of simulations composed of individual entities such as ships, mooring lines, and hawsers. The library models the motions of such objects and their interactions to create simulations of multibody operations. In the process, the user can choose among the hydrodynamic models which meet the simulation purpose and requirements adequately.

As Vessel.js is open-source and web-based, the applications developed with it are easily accessible on the web, and its source code can be reused to create new simulations. The simulations make use of different analysis models: motion responses can be evaluated with closed-form expressions, by solving the equations of motion or with Response Amplitude Operators (RAOs) imported from external software packages. The hydrodynamic models and the web-based approach are brought together to perform multibody motion simulations more interactively compared to a traditional approach.

The following section presents the web-based approach and the principles guiding the development of the simulations. Section 3 introduces the available hydrodynamic models. Section 4 describes the process of assembling a simulation case with Vessel.js, also presenting the usage of other software when necessary. This process is applied to the case studies in Sect. 5. Section 6 provides guidelines for users who want to obtain and modify the Vessel.js source to create customized examples. Section 7 concludes the paper and describes current and future work.

2 Simulation and visualization

2.1 Web-based simulations

The web-based approach presents the advantage of making engineering simulations available to any user with a web browser connected to the internet. Web applications are supported by three key programming languages: JavaScript, which allows the execution of algorithm scripts on a web environment; HTML, which deals with document presentation; and CSS, which takes care of the style of the website. These open standards present a solution to several problems of compatibility between the software application, on one side, and different devices and operating systems, on the other [2, 3].

Being the most used programming language in the world, according to statistics by the hosting website GitHub, JavaScript enjoys a wide base of openly available resources, libraries, and documentation. Several of such libraries are used in this work, e.g., Three.js to create and render 3D graphics [4] and Numeric for the solution of ordinary differential equations [5].

JavaScript supports object-oriented programming, allowing the developer to define and organize variables and functions inside objects with an intelligible data structure [6]. In that programming approach, the code development relies on different objects, which work as encapsulated elements that can handle information, call functions stored as methods, make calculations, among various other operations. Different objects can be combined to accomplish a task or reused inside a script, for example, with instance patterns.

2.2 The Vessel.js library

The simulations presented in this work are developed with Vessel.js, an open-source library for ship design [1]. Vessel.js provides tools to represent a ship as an object in JavaScript. Top-down design can be done, starting with a hull, payload, and traditional equations [7]. Bottom-Up approaches, such as Andrews’ design building blocks [8], are possible considering blocks that are created with “derived objects”, which will have a parent called “base object”. The derived objects are placed in the right coordinates to create an approximation to the vessel [9]. Every derived object has a state that collects the positions and changing characteristics of it. Once the ship is defined, these states can be used to simulate different behaviors. The library can calculate the weights (considering the lightweight and the filling ratio of the tanks) and, therefore, the overall displacement of the ship. Also, draft, hydrostatic, stability coefficients, and small angles of trim can be calculated as part of the state of the ship [10].

The library aims to develop code following a well-defined structure that is understandable for other users that might be interacting and improving the code in the future. The simulations are hosted on an open-source platform to be accessible and encourage a collaborative community (http://vesseljs.org). The website provides various examples where it is possible to interact with the simulations presented in the following sections. Additionally, other examples start to work on multi-entity configurations by including new bodies on the ship deck, having independent or coupled behaviors, such as a lifted load with a pendulum motion.

2.3 Simulation models in the library

The simulation approach employed in Vessel.js is based on the representation model for virtual prototyping in the design of engineering systems proposed by He et al. [11]. It is constituted of three elementary submodels (Fig. 1):

  • Entity model, which defines the physical product to be simulated, including design specification data and information about the product, 2D, and 3D models.

  • State model, which represents the entity model exposed to internal and external state constraints, such as a working position in a kinematics simulation, thus analyzing the entity by assigning it a state.

  • Process model, which is an accumulation of the state models, representing a behavior over time, from the initial to the final state. This model can also be obtained by subjecting the entity model to a dynamic constraint.

This taxonomy was adapted for application to virtual prototyping of marine operations on previous works [9, 12]. The entity models represent a maritime system with the desired level of detail, such as the 3D model of a ship with a component specification or the characteristics and visualization of a mooring line. The state models represent the entities subjected to internal or external disturbances. For a ship, this could be the environmental conditions or instantaneous resistance at a given speed and loading condition. They are evaluated with analyses performed with Vessel.js or even with external software.

The process model is a sequence of states that change over time, offering a dynamic simulation scenario. Finally, the case studies comprise several scenarios that can be accessed by modifying simulation parameters to study the system behavior under different conditions, e.g., different wave characteristics. Figure 1 illustrates these concepts.

Fig. 1
figure 1

Configuration of the simulation approach, from an entity to a case study

3 Hydrodynamic analyses

3.1 Modeling approaches

The simulator can be used for evaluation of motion behavior and visualization of motion results calculated with other software. There are three methods to accomplish that. Following the taxonomy presented previously, the state model represents static constraints or stimuli applied to an entity model. The states are stored in a specific object in the Vessel.js library and linked to 3D visualization. As the states evolve over, this state object is updated to account for this time variation, thus representing a scenario.

The first method calculates the motion response with closed-form expressions implemented inside the Vessel.js library. In the second method, the equations of motion are evaluated as the ship and the mooring lines move in the simulation. The motion coefficients are estimated based on the physical characteristics of the ship and the mooring lines modeled in the simulator. Some simplifications are taken that make this method only suitable for small motions of barge-shaped hulls.

However, hydrodynamic models are not always simple to be implemented directly in the source code. For more complex cases, a module was designed in which the user can supply the hydrodynamic coefficients through external inputs provided, for example, by any commercial software. This method allows the importing of RAOs evaluated externally, so the simulation can be modeled with Vessel.js and then animated with results obtained from other software.

These methods are detailed with their corresponding hydrodynamic models in the following sections, with emphasis on the third one which is later explored in the main case studies in this paper.

3.2 Ship motions with closed-form expressions

The first method, based on Jensen et al. [13], is a semi-analytical approach to derive frequency response functions for the wave-induced motions of monohull ships. This approach was developed to obtain a quick and close approximation of the wave-induced motions and accelerations in the conceptual design phase. Thus, it relies on parameters known during this stage of the design, such as length, breadth, draft, block coefficient, waterplane area coefficient, heading, and speed.

The method calculates the heave and pitch amplitudes with an analytical strip theory formulation by approximating the hull with a box-shaped vessel while neglecting motion coupling and assuming a constant sectional added mass equal to the displaced water. For the roll amplitude, the hull is modeled with a composition of two prismatic beams.

The Jensen’s work presents a comparison between the proposed closed-form expressions, a seakeeping analysis based on the strip theory method, and experimental results from model tests. The comparison shows that the closed-form results are reasonably close to the other methods, except for the following cases:

  • Heave is too small for \(\lambda /L \le 1\).

  • Pitch is too large around \(\lambda /L = 1\) for Froude numbers larger than 0.2.

  • Roll is too large around the resonance frequency.

The results of the analysis are the amplitude response in heave, roll, and pitch for a given regular wave and heading angle. These are calculated with specialized methods in the Vessel.js library, and they access all the parameters necessary to perform the simulation inside the ship object. For that reason, the entire simulation can be performed on a web browser, and there is no dependence on external software for calculating the responses. The ship motion amplitudes in heave, roll, and pitch are converted to a time series by applying Eq. 1.

$${\eta _{i}} = {\xi _{i}} \cdot A \cdot \cos (\omega t - {\lambda _{i}} ),$$
(1)

where \({\eta _i}\) is the vessel displacement (in meters or degrees), \({\xi _i}\) and \({\lambda _i}\) are the RAO amplitude and phase of the i-th degree of freedom (DOF), respectively, A and \({\omega}\) are the wave amplitude (in meters) and the wave frequency (in radians per second), respectively, and t is the time (in seconds).

3.3 Ship motions with differential equations

3.3.1 Vessel motion

Like the previous method, the motion calculation is performed totally on the web browser. The Vessel.js library provides time-domain models of motion response based on the equations of motion for the vessel. A work by Fossen and Fjellstad [14] was used as a reference for modeling of marine vehicles in six degrees of freedom (DOF). The model follows a Newtonian motion. The equation of motion is given as follows:

$${M_{RB}{\dot{\nu }} + C_{RB}(\nu )\nu = \tau _{RB}}.$$
(2)

The term \({\tau _{RB}}\), which stands for a generalized vector of external forces in the six degrees of freedom, can be expanded, yielding the following equation of motion:

$$\begin{aligned}&(M_{RB} + M_{A}){\dot{\nu }} + (C_{RB}(\nu ) + C_{A}(\nu ))\nu \nonumber \\&\quad + B(\nu )\nu + g(\eta ) = \tau , \end{aligned}$$
(3)

where \({M_{RB}}\) is the rigid body inertia matrix, \({M_{A}}\) is the inertia of the added mass, \({C_{RB}(\nu )}\) is the rigid body Coriolis, centripetal matrix \({C_{A}(\nu )}\) is the hydrodynamic added Coriolis, centripetal matrix \({B(\nu )}\) is the hydrodynamic damping matrix, \({g(\eta )}\) is the vector for generalized gravitational and buoyancy forces, and \({\tau}\) is the vector of external forces. The formulation was originally developed for control of marine vehicles, so it considers two frames of reference, one global and the other body-fixed, requiring the addition of the Coriolis matrices to the equations of motion. This approach makes the formulation well suited for future expansion with maneuvering forces, currents and others, thus being applicable to a wide range of marine operations.

Even with the equations of motion in place, the estimation of motion parameters is still challenging due to the estimation of appropriate motion coefficients. For that reason, a series of assumptions were made to simplify their estimation [15], and, at the moment, the motion simulation is only suitable for small motions of a barge-shaped hull. It does not yet account for wave interaction. The inertia and restorative coefficients are derived from the hull shape, while the damping coefficients need to be entered manually by the user. The equation is solved in synchrony with the 3D animation, with variable time steps.

3.3.2 Mooring line motion interaction and visualization

The interaction between ship and mooring can be modeled considering a mooring force applied by the cable to the vessel [16]. The model assumes a quasi-static behavior of the catenary mooring line with part of its length lying on the seabed, considering that only traction forces acting along the tangent are applied to the line. The model also disregards any force applied to the cable after it passes to semi-catenary geometry. Figure 2 shows a scheme with the model parameters.

Fig. 2
figure 2

Catenary mooring line configuration with relevant parameters [16]

The model considers that the vertical force applied by the catenary is given by the suspended length of the line multiplied by the linear density of the mooring line, \({\omega}\). The method assumes that the total distance d is predefined by the user, but that the horizontal force H and the suspended length s are unknown. A given rope configuration can be solved by finding the a that satisfies the following equation:

$$\begin{aligned}&l- a\sinh {\Biggl (\cosh {\Biggl (\frac{h}{a}\Biggr )}+1\Biggr )} \nonumber \\&\quad + a\Biggl (cosh{\Biggl (\frac{h}{a}\Biggr )}+1\Biggr ) - d = 0, \end{aligned}$$
(4)

where l is the mooring line length and \({a = H/\omega}\). The equation is solved with an iterative method. For any given rope configuration, after the horizontal and vertical forces are calculated, they can be included in the vector of external forces in the equations of motion to simulate their interaction with the moored vessel.

3.4 Multibody motions

3.4.1 Importing external analysis results to Vessel.js

A third approach to performing simulations with Vessel.js is to rely on an external file with the RAO results to model the motion of the entities in the simulation. This allows the user to execute complex analyses with an external commercial software package of their preference and then visualize the results on the simulation environment. As the Vessel.js library is open, it can be linked to results incoming from any other software, as long as they are expressed as a textual list containing wave characteristics, i.e., amplitude, period, heading direction, and vessel response, i.e., amplitude and phase.

This procedure is exemplified here with the WAMIT (Wave Analysis MIT) software package, which solves the diffraction and radiation problem to analyze the interaction between waves and structures [17]. The software solves the velocity potential in the wet surface of the structure, and it is based on the linear potential theory [18], which solves the problem by using the Boundary Element Method (BEM) with three-dimensional panel elements [19]. The analyses described here do not account for second-order wave effects such as mean drift forces and moments. Additionally, the evaluation of restoring matrices for inclusion in WAMIT analyses is performed with a second software, Mooring Analysis Program (MAP++). The following sections are going to present the modeling principles of multibody simulations as a foundation for the usage of that software in the creation of simulations with Vessel.js. A comprehensive study on multibody dynamics simulation can be consulted in [20], for example.

3.4.2 Coupled motion of multiple vessels

When multiple vessels float in proximity, the motion of each vessel will affect the wave elevation field surrounding the other ones, a phenomenon called hydrodynamic interactions or hydrodynamic coupling, as pointed in [21]. To account for this, the motion of a system with \({N_{body}}\) vessels is described to include \({6 \times {N_{body}}}\) degrees of freedom instead of only six. The coupled motion equation for the interacting vessels can be expressed with a set of \({6 \times {N_{body}}}\) coupled linear equations, as presented in Eq. 5.

$$\begin{aligned} \begin{aligned}&\sum _{j=1}^{6 \times N_{body}} [ -\omega ^2 (M_{ij} + A_{ij}) + i \omega (B_{ij} + B_{ij}^E)\\&\quad +(C_{ij} + C_{ij}^E) ] \xi _j = X_i \,\,\hbox {for} i=1 \hbox {...} 6, \times N_{body} \end{aligned} \end{aligned}$$
(5)

where the subscripts i and j identify the elements of the following matrices: M is the mass-inertia matrix, A is the added mass matrix, B is the potential damping matrix, \({B^E}\) is the external damping matrix, C is the hydrostatic stiffness matrix, and \({C^E}\) is the external stiffness matrix. Furthermore, \({\xi _j}\) is the motion complex amplitudes in the j-th DOF and \({X_i}\) is the wave force or moment for the i-th DOF.

\({B^E}\) is usually provided to account for viscous damping effects that are not calculated by potential theory. These values can be obtained through model-scale experiments or regression for similar cases. \({C^E}\) generally represents the linearized restoration matrix due to the mooring system or due to any other mechanical coupling. To evaluate the motions \({\xi _j}\), as presented in Eq. 5, the BEM model provides the evaluation of A, B, C, and \({X_i}\), and the user must provide the external matrices \({B^E}\), and \({C^E}\).

3.4.3 Mooring line motion interaction and visualization

When evaluating the responses of multibody side-by-side configurations, it is essential to consider other aspects that can affect the interaction, such as the mechanical coupling between the bodies and other structures such as fenders, mooring lines, risers, and hawsers [22]. Ormberg and Larsen [23] proposed two different approaches to analyze multibody interactions, as seen in Fig. 3. The first one consists of analyzing the vessel and the mooring line separately, while the second is a coupled analysis which evaluates the whole system simultaneously.

Fig. 3
figure 3

Coupled and decoupled approach [23]

On the difference between both approaches, they comment that “the turret motions estimated by a separated analysis also compare well with both coupled analysis and experiments if mean current loads and low-frequency damping from moorings and risers are included accurately. Otherwise, the use of separate analysis will severely underpredict the mean offset and overpredict low-frequency motions”.

For simplification of the simulation method, this study will carry the motion analyses with a decoupled approach, even if, due to the approach limitations, this may lead to overprediction of frequency motions and underprediction of the mean offset. In the studied case, a vessel will be considered as a rigid body, and the ropes will be regarded as flexible bodies. For the sake of simplification, some of the bodies will have only 3 DOF, such as the ropes, where the rotations will be disregarded. The link between two or more bodies will be defined by kinematic constraints which restrict their motions by limiting the relative translation or rotation between two or more bodies. In general, the constraints were defined by setting the relative motion between two bodies. For the anchoring point of a mooring line to the seabed, however, a fully fixed constraint is applied.

For the mooring lines, the inertia forces are proportional to the acceleration, consisting of rigid body mass and added mass. Also, if the load frequency is higher than the natural frequency, then the systems gain some inertia. These influences can be more accurately modeled as a linear restoring matrix accounting for the effect of such forces, with elements depending on the combination of motion for each degree of freedom.

However, given that these restoring coefficients are often complex to estimate due to the many factors they depend on, these calculations are made by external software (MAP++) developed by the National Renewable Energy Laboratory (NWTC). This software uses a theory for catenary lines based on a work by Peyrot and Goulois [24] to determine the external linear restorative matrices for mooring lines and hawsers. These mooring lines will act as spring for the ship, soothing and restraining its motion according to the coefficients for each degree of freedom.

In the examples using external hydrodynamic results, the catenary visualization is built using the model proposed by Irvine [25]. It assumes that the mooring system is composed of two parts: a half free hanging catenary and a line resting on the seabed. The model is more complex than the previous one, as it assumes elongation of the line and that the horizontal force applied to the cable is transmitted even to the resting section. For simplification of the calculations performed on the web browser, the visualization of hawsers was modeled as a straight line linking two floating systems.

4 Creating a simulation with Vessel.js

4.1 Information flow

The preparation of a simulation requires the modeling of all elements in the simulation taxonomy: entities, analysis, scenarios, and cases, as illustrated in Fig. 4.

Fig. 4
figure 4

Information flow for the preparation of a simulation case as discussed in the following sections

The first step to create the simulation is to define the involved objects, such as ships, mooring lines, and ocean. Before proceeding to perform the required analysis, which will be used to evaluate the states of the entities, it is necessary to choose among one of the three models for motion calculation discussed in the previous section. Once the analysis is functional, it can be linked to a visualization of the case with its scenarios to obtain a simulation that evolves with a dynamic character.

4.2 Defining entities

The simulation entities are the elements that are displayed and manipulated in the simulation. Some examples of entities included in the cases presented on this work are ships, ocean, seabed, mooring line, and hawsers. The entity visualizations are created and rendered with the Three.js library.

The most complex entity among these is by far the ship. It needs to be created with a Vessel.js specification written on the JavaScript Object Notation (JSON) file format. The specification defines the hull shape, structure, and other elements contained in the vessel. This data will be used by the analysis models in Vessel.js to derive the ship motion response. On the other hand, if the user plans to import the motion RAOs from external software, then it is not important to define the hull topology and the weight distribution accurately on the ship specification. In this case, a simplified barge-like geometry is enough to visualize the global motion response of the vessel.

Similarly, the mooring line needs to be defined with a geometric arrangement and physical characteristics on the Vessel.js library. The lines were divided into small segments to create visualizations of a catenary mooring line touching the seabed. A simple line geometry is created with several vectors containing empty positions. Then, the positions of each line segment are calculated and stored on these vectors, which are used to create the 3D catenary visualization.

Finally, the ocean and seabed entities are defined for visualization purposes. The simulation script synchronizes the 3D animation to ensure that the displayed wave corresponds to the motion response exhibited by the entities.

4.3 Choosing the analysis model

When developing a simulation, it is necessary to choose an analysis model that addresses the simulation purpose with adequate accuracy while avoiding excessive detailing. The different hydrodynamic methods provided described in Sect. 3 can be selected and combined according to these principles. The closed-form model can be used to perform the lightweight evaluation of motion response during the preliminary design stage. As the design is detailed, the simulation can incorporate accurate motion results from the external BEM software. The following sections detail how these different analyses methods can be used to calculate states in simulation scenarios.

4.4 Motion simulations with closed-form expressions

This method allows the user to compare the motion response between, e.g., different wave conditions, vessels, design proposals, or load conditions of the same vessel. It does not account for any kind of dynamic interaction between the vessel and other entities, e.g., interaction with mooring lines or shadow effect.

When executing the analysis, the web application accesses the required parameters on the ship object to derive hydrostatic and stability characteristics that are used to calculate the motion response. These characteristics are calculated and stored for the simulated ship. At every change of wave characteristic, they are consulted to evaluate the motion amplitude response for the new wave condition, allowing the simulation of the scenario. This calculation happens in real time as the user manipulates the simulation parameters. These parameters can be related to the wave condition or to the ship itself, e.g., its main dimensions.

4.5 Motion simulation with differential equations

The analysis model solving the equations of motion in real time on the browser is at the preliminary stage. It represents a direction for a future development of web applications with advanced hydrodynamic models.

The analysis allows the user to simulate the response of a barge to an initial excitation, with or without mooring lines. Similarly to the previous example, the analysis is performed based on the contents of a Vessel.js ship object. The calculation of hydrodynamic coefficients is suitable for small movement amplitudes of barge-shaped hulls and the motion coefficients are estimated based on the physical characteristics of the barge. It is complemented with damping coefficients that are entered as input by the user.

To specify mooring lines when creating a simulation, the user defines the number of lines and their geometric arrangement around the vessel. The simulation models their effect on the barge as external forces and moments to be included in the barge’s equations of motion.

As the simulation does not yet account for wave interaction, it requires the user to provide an initial excitation to the barge so that the motion response can start. After that, the equations of motion will be solved to evaluate the barge oscillation, with an eventual motion with decay due to damping effects.

4.6 Multibody simulations with external RAO results

Boundary Element Method The creation of multibody simulations with external hydrodynamic evaluation requires the chaining of several tools, so the hydrodynamic coefficients can be imported to the Vessel.js simulation. An overview of the calculation process used in this study is shown in Fig. 5, where WAMIT is integrated with a custom TPN-Petrobras software [26] to simulate side-by-side operations. A typical analysis requires as input the wet-surface 3D panels mesh, the mass-inertia matrix of each vessel, and the periods and the wave incidence angles. The software deals with two main subroutines: POTEN, which solves the velocity potential of the body, and FORCE, which evaluates physical parameters such as force and motion coefficients, fluid pressure, velocity, and free surface elevation.

Fig. 5
figure 5

Process followed to run the cases on this study with the custom TPN-WAMIT software

The software outputs hydrodynamic data such as added mass, potential damping coefficients, restoring terms, wave exciting force (calculated via Haskind’s Relation), and 6 DOF motions for a given geometry in a specific wave period and direction.

Mooring analysis If the ship motion is constrained by mooring lines or hawsers, these elements need to be included in the model with proper restoring matrices. These matrices are calculated with the software MAP++, which receives as input a file with the characteristics of the mooring lines and the fairlead position on the vessel.

Similarly, the inclusion of hawsers on the operation requires the addition of an external linear restorative matrix to the motion model of both ships connected by it. The stiffness matrix, in that case, is fully coupled, and the matrix is computed by assuming that the displacement of the attaching point from one vessel is the same as the negative displacement of the attaching point of the other, resulting in a 12 x 12 stiffness matrix, i.e., 6 DOF for each body.

Multibody analysis The BEM software is executed with the associated inputs, which include the analysis setup, ship geometry, and restorative matrices for the mooring lines, among others. When more than one vessel is simulated in a side-by-side configuration, a resonant effect occurs on the free surface elevation in the gap between vessels, as pointed by [27]. So a new body consisting of an artificial rectangular damping lid is placed on the gap, and external damping can be inserted in the model, as suggested by [28]. Theoretical background of this dampening method can be obtained in [29].

An example of mesh configuration is presented in Fig. 6, where the gray panels represent two adjacent barges, and the blue panels represent the lid surface. Generally, the lid length has the order of magnitude of the shortest vessel length.

Fig. 6
figure 6

Example of mesh used as input for the hydrodynamic model considering a lid for adding external damping in gap between vessels. Gray panels: adjacent barges; Blue panels: damping lid (top view) (Color figure online)

Interface BEM-JavaScript It is necessary to establish an interface between the BEM software and JavaScript to use the analysis results to create simulation scenarios with Vessel.js. The web application reads the data from the text file and turns it into an object containing the amplitude and phase RAOs, separating them according to the different degrees of freedom, number of ships, number of wave periods, and headings.

There are two ways to link these results to the visualization. In the first one, a display with a pre-determined configuration of vessels and mooring lines is created. The user is then able to upload the RAOs obtained with the external software. In this case, the user needs to be aware of the adequate data formats and be sure that the uploaded data is representative of the operation being simulated. In the second approach, the visualization is already pre-loaded with a data file containing the results from different simulation scenarios. This option is less flexible, but is also simpler to use.

4.7 Linking analysis to scenario visualization

The scenario visualization is created to represent the simulation entities, which may include ships, mooring lines, hawsers, ocean, and seabed. The ships can be positioned with different heading angles and locations in the scenario. When adding a mooring system, it is essential to certify that its geometric arrangement in the visualization, including fairlead points and catenary ropes, is consistent with the one assumed when preparing the analysis models.

Once the simulation is started, the simulated states are continuously tracked at every time step of the visualization. At the same time, the user can modify simulation parameters to observe the system behavior in different scenarios. For the scenarios which model the ship motion as an amplitude response, i.e., closed-form expressions and RAOs, the motion is converted to a sinusoidal time series, as in Eq. 1. In the case of simulations evaluating the equations of motion, the behavior is animated by solving the equations with variable time steps delimited by each frame of the visualization.

The mooring line visualizations are also updated as the simulation progresses. As the fairlead of a given line moves, the positions of the segments constituting the lines are recalculated, and their vertices in the 3D visualization are updated.

5 Simulated cases

5.1 Overview

The cases are presented following a progression that goes from more straightforward simulations to more complex ones. The first two cases present the motion simulation performed with closed-form expressions, which can be achieved with one or more vessels. The two following ones show simulations with equations of motion solved in real time on the web browser. Then, the following cases show various simulations created with hydrodynamic analysis imported from external software, including interactions with mooring lines and hawsers in offshore operations. The following list summarizes these cases:

  1. 1.

    Closed-form expressions:

    1. (a)

      Single vessel (Sect. 5.2).

    2. (b)

      Multiple vessels (Sect. 5.3).

  2. 2.

    Differential equations solved in real time:

    1. (a)

      Free-floating barge (Sect. 5.4).

    2. (b)

      Moored barge (Sect. 5.5).

  3. 3.

    RAO imported from external software (verification of BEM results in Sect. 5.6):

    1. (a)

      Free-floating FPSO (Sect. 5.7).

    2. (b)

      Side-by-side operation (Sect. 5.8).

The accompanying visualizations were developed with a focus on intuitive user interaction. The graphic user interfaces (GUIs) show sliders that allow configuration of sea state, number of ships, presence of hawsers, and mooring lines, among others.

5.2 Motion of a single vessel with closed-form expressions

The first case is developed to simulate the motion response of a single ship in regular waves with closed-form expressions. The entities included in this simulation are one vessel and an ocean. The ship is defined as a PSV (Platform Support Vessel) specification with 106 derived objects and a simplified hull shape, which is automatically generated from a table of offsets stored in the specification. The ocean is governed by a regular wave with amplitude, period, and heading direction configurable by the user. The wavelength is derived automatically from the period with the dispersion relation for deep waters.

Figure 7 shows a screenshot of the simulator. The user can navigate through different simulation scenarios by adjusting the sliders on the GUI. Besides modifying the wave parameters, the sliders also allow the user to scale the main ship dimensions on the three coordinate axes, i.e., length, beam, and depth. Doing so automatically calculates the new vessel weight distribution, hull shape, and updates the motion response accordingly. During the early design stage, this functionality can be used to quickly visualize the effect of variations of main dimensions on the motion response.

Fig. 7
figure 7

Simulation of motion response for a single vessel with closed-form expressions

5.3 Motion of various vessels with closed-form expressions

The previous case can be expanded to account for the motion of multiple vessels simultaneously to compare their responses. As the motion of individual vessels is governed by closed-form expressions, the simulation does not account for interactions such as the shadow effect between them. Similar to the previous example, the user can adjust the simulation scenario using the GUI sliders, but now the option to control the number of vessels in the scenario is also provided. The application supports simulation of dozens of vessels simultaneously, as Fig. 8 illustrates. The user can also upload external vessel specifications to be included in the simulation case.

Fig. 8
figure 8

Motion response scenario with 24 vessels

5.4 Simulation of the radiation problem

This case models the radiation problem for a barge floating on still water. It considers that the barge is stationary until an initial motion disturbance applied by the user will start a movement that is dampened by the interaction with the water [15]. The entities included in this simulation are a box-shaped barge and a calm ocean. The analysis is based on the differential equations of motion with 6 DOF.

The simulation view includes the box-shaped barge placed on a flat plane representing the ocean entity for simplification of the visualization model, and the ocean does not display the excitation waves generated by the barge motion. Figure 9 shows a screenshot of the simulation. The initial conditions for heave, roll, and pitch, i.e., the modes which have restoring effects, can be modified by the user. The motion starts after the initial state is set with the sliders and then is dampened as fast as the coefficients allow.

Fig. 9
figure 9

Simulation of the radiation problem based on differential equations, with the barge subject to an initial pitch motion

Alternatively, the case can be assembled with hydrodynamic coefficients obtained from external software. For this, an analysis resembling the radiation problem needs to be prepared. The diffraction problem is set to null, so the BEM software can identify the intention to solve only the radiation problem. The number of periods and wave headings is set to zero to ensure a calm sea and a seabed depth is specified. The resulting hydrodynamic coefficients are written on the corresponding arrays in the simulation source code. The final simulation presents similar functionalities, but with more accurate added mass, damping, and restoring matrices.

5.5 Interaction with mooring lines

By expanding the previous case, the simulation can include mooring lines anchored to the barge to restrain its motions. The mooring lines are new entities added to the 3D visualization and the barge’s equations of motion. The resulting simulation behaves similarly to the previous case, but now accounting for a simplified mooring interaction. Figure 10 shows a screenshot of the web application.

Fig. 10
figure 10

Bottom view of the barge in the simulation with mooring line interaction calculated with differential equations

5.6 Motion response with BEM and verification of results

The following simulations in this section are carried with an FPSO (Floating, Production, Storage and Offloading Platform), and eventually, an additional Suezmax tanker simulating a side-by-side offloading operation. The characteristics of such vessels were defined based on typical dimensions and are listed in Table 1, while Table 2 shows the physical characteristics described for the mooring line. The FPSO is considered as being moored to the seabed, while the Suezmax vessels are only attached to the FPSO with hawsers. These lines exert motion interactions that need to be considered with adequate restoring matrices.

Table 1 Vessels main characteristics for FPSO and Suezmax for the simulated loading conditions
Table 2 Characteristics of the mooring line used to calculate the restoring matrix

Four different models were evaluated in WAMIT:

  1. 1.

    FPSO only.

  2. 2.

    Suezmax only.

  3. 3.

    FPSO and Suezmax in Side-by-side.

  4. 4.

    FPSO and Suezmax in Side-by-side with mooring.

The RAO results in heave, roll, and pitch for the FPSO and the Suezmax are presented in Figs. 11 and 12, respectively. These figures show the results for two wave incidence angles, 150 and 210 degrees, where the angle of 150 corresponds to the case in which the FPSO is protected from the waves by the Suezmax and the angle of 210 to the situation in which the Suezmax is protected by the FPSO. The angle of incidence is measured from the stern (0°) up to the bow (180°) in a counterclockwise direction, according to [17].

Fig. 11
figure 11

Comparison of heave, roll, and pitch RAOs considering the FPSO isolated and in a side-by-side configuration without and with the linearized mooring effects

Fig. 12
figure 12

Comparison of heave, roll, and pitch RAOs considering the Suezmax isolated and in side-by-side configuration without and with the linearized mooring effects

In both figures, it is possible to observe that all coupled RAOs (blue and red solid lines) differ from the results obtained for the models in which vessels are isolated (black solid lines). These differences are found mainly in the region close to the natural periods of the ships, that is, for periods between 5 and 15 s. For both vessels, the most considerable differences were obtained for heave and roll motions. The pitch motion showed no essential differences.

In the case of the FPSO considering only the hydrodynamic coupling, it was observed that the heave motion is more significant for waves incident by 210°. The mooring effect, represented by dashed lines, is only evident in the roll motion, for which case a significant difference is observed for waves of 150°. Also, a peak in 25 s is found related to mechanical coupling due to the mooring system.

Considering the heave motions of Suezmax, it was observed that for periods up to 12 s, the movement for an incident wave of 210° is greater. This behavior probably occurs due to the waves radiated by the FPSO resonant heave motion. For periods over 12 s, the shadow effect is observed, and the motion of 150° waves is greater. The shadow effect is more pronounced for the roll motion throughout the region between 5 and 15 s. However, when mooring is considered, the difference between motions decreases. A peak in the region of 22 s is also observed due to the mooring coupling.

Similar results were obtained, for example, by Hu et al. [30]. Their work performed experimental research on the motions of an FLNG (Floating Liquefied Natural Gas platform) with similar dimensions and conditions to the ones discussed in this work. The researchers also compared the experimental results with the motions obtained with the software SESAM [31]. It was found that the model from the experiment produces similar results. However, the roll motion for the simulation in the current case is more pronounced for lower periods in comparison to the referenced study. The same applies, though with less severity, to the pitch motion. As for the other degrees of freedom, the amplitudes are quite close to the values obtained in this study.

5.7 FPSO motion response with BEM

This case presents the FPSO floating on an ocean with an incoming regular wave. A simplified barge-like entity was used to visualize the FPSO motion response. The case considers 5 wave amplitudes, 30 periods, and 25 different wave headings, being one heading every 15° until a 360° circle is completed. To simulate the FPSO motion, the RAOs in 6 DOFs obtained from the BEM software are imported to the web application. Once the platform starts moving, the results are fetched and converted to the corresponding time series.

This case is also taken as an opportunity to verify that the external RAO results are correctly interpreted by the web application. This was done by comparing the displayed motion amplitude to the values in the RAOs from the BEM software. For example, Fig. 13 shows the FPSO without mooring floating on a wave with heading of 150°, period of 10 s, and amplitude of 1 m. By comparing the movement amplitudes on the plot to the black RAO line in Fig. 11, it is possible to note that the amplitudes are correctly retrieved and displayed in the simulation.

Fig. 13
figure 13

FPSO motion as retrieved for a wave with 150° heading, 10 s period, and 1 m amplitude

5.8 Multiple vessels: side-by-side offloading operation

The last case models multiple vessels, including interaction with mooring lines and hawsers. An interface was developed where the user is able to visualize the motion of the moored FPSO only or of the FPSO with a Suezmax ship, as in a side-by-side operation. The user can adjust the desired case by scrolling sliders to add the Suezmax ship or the FPSO mooring to the seabed. For every user choice, the web application fetches the results from the corresponding hydrodynamic models, whether they are for one or two vessels, with or without mooring line. The final interface is illustrated in Fig. 14.

Fig. 14
figure 14

Visualization of operation with hawsers showing plots for the motion of the two vessels in real time

6 Vessel.js as a tool to develop open and collaborative simulations

The cases in the previous section illustrate the ability to perform multibody simulations by following the proposed procedures. Furthermore, the taxonomy applied through the work establishes a common framework to organize the elements in different simulations. As Vessel.js is open and web-based, all the simulations and their source code are available for online access and can be downloaded, modified, and reused by any interested party. This allows users to take the case studies and build upon them for further applications using the available models.

To create a new multibody operation, the steps shown in Fig. 15 should be followed. First, the last version of Vessel.js library needs to be downloaded, where one will find the examples shown in the previous sections. Then, it is possible to choose the case that better suits the desired application and adapt it with new entities or setups by reusing the source code needed for simulating the marine operation.

Fig. 15
figure 15

Process to create a multibody marine operation using the Vessel.js library

In the process, the user should reason about which of the analysis models is suitable for the intended simulation. This may require an external hydrodynamic analysis to obtain accurate motion results, especially if new interacting bodies such as mooring lines or vessels in proximity are added to the simulation.

The simulation methods can have different applications depending on the stage of the life cycle when they are used. For example, during system design, they can be used to visualize the expected motion response in a given wave condition. During operation, it can be used to plan and discuss an operation before it is executed.

7 Conclusion and future work-closing the gap between design and operation

This paper presents functionalities for simulations of multibody operations developed into the Vessel.js library. The work uses a taxonomy that organizes the simulations by entities, analysis, and scenarios, which allow treating each entity separately so they can later be linked together to simulate an operation.

The simulations are open-source and developed with a web-based approach, making use of GUIs, 3D animations, plots, and other functionalities. The results are particularly promising because they were able to reconcile usage of well-established tools, e.g., WAMIT and MAP++, with an approach based on open standards ensuring that the simulations and visualizations can be accessed across devices and geographic locations. The cases were developed with the idea that other users can adapt and reuse the code freely, improving and creating new operations, and this is encouraged by the authors.

Previous sections discussed how the simulations can be used to support activities during different stages of the life cycle. Future work will focus on closing the gap between the design and operation of floating systems. In one front, the source code is being adapted to the development of digital twins. Digital twins are simulations that replicate the behavior of a physical asset during operation to provide decision support. A recent work was able to successfully implement a digital twin which mirrored an experiment with a scale model ship in real time. Further work will attempt to develop digital twins of real maritime systems by applying the same principles.

As it was not the objective of this work to validate computational results for any particular operation, it discussed the hydrodynamic behaviors based only on their feasibility and on similar works found in the literature. Another front of future work focuses on validating the side-by-side simulations based on experiments such as those presented in [22]. The study should help establish the usage of simulations to plan complex maritime operations, once the use of a virtual prototype is very necessary for the presentation of hydrodynamic behavior to other professionals involved in those operations as commanders, pilots, crane operators etc.

8 Source code and examples

The simulations presented in this work and other examples are available on the address http://vesseljs.org.