An open-source library for hydrodynamic simulation of marine structures

The work focuses on an open and collaborative approach for hydrodynamic simulations of multibody operations. It builds on Vessel.js, an existing web-based ship design library, by modeling the interaction between entities and creating multibody models able to output different responses. To develop the cases here studied, the simulations are decomposed into single elements to understand their behavior separately before making them interact with other elements to create a multibody simulation. In the process, different hydrodynamic models are used to analyze the bodies according to the requirements of the simulations and the needed level of complexity. The simulations are coded in JavaScript and visualized in a web environment, with the option of using external hydrodynamic analyzes, which in this work were exemplified using a commercial software that adopts the linear potential wave theory. The paper concludes with a discussion about future applications of methods and simulations.


Open hydrodynamic simulations
This study presents new developments of Vessel.js, an opensource 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.

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.

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://vesse ljs. 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.

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 Fig. 1 Configuration of the simulation approach, from an entity to a case study 1 3 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.

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.

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 closedform results are reasonably close to the other methods, except for the following cases: -Heave is too small for ∕L ≤ 1.
-Pitch is too large around ∕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.
where i is the vessel displacement (in meters or degrees), i and i are the RAO amplitude and phase of the i-th degree of freedom (DOF), respectively, A and are the wave amplitude (in meters) and the wave frequency (in radians per second), respectively, and t is the time (in seconds).

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: The term 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: where M RB is the rigid body inertia matrix, M A is the inertia of the added mass, C RB ( ) is the rigid body Coriolis, centripetal matrix C A ( ) is the hydrodynamic added Coriolis, centripetal matrix B( ) is the hydrodynamic damping matrix, g( ) is the vector for generalized gravitational and buoyancy forces, and 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.

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 semicatenary geometry. Figure 2 shows a scheme with the model parameters.
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, . 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: where l is the mooring line length and a = H∕ . 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.

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 1 3 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.

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 × 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 × N body coupled linear equations, as presented in Eq. 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, 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 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 .

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.
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 Coupled and decoupled approach [23] 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.

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.
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.

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.

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.

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.

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.

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. 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 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.
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.

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.

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:  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.

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.

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.

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 boxshaped 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.
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.

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.

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

Fig. 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 of incidence is measured from the stern (0°) up to the bow (180°) in a counterclockwise direction, according to [17].
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.

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.

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 sideby-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

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 webbased, 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.
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.

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.

Source code and examples
The simulations presented in this work and other examples are available on the address http://vesse ljs.org.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creat iveco mmons .org/licen ses/by/4.0/.