NEMOHNemoh is a Boundary Element Methods (BEM) code dedicated to the computation of first order wave loads on offshore structures (added mass, radiation damping, diffraction forces). It has been developed by researchers at Ecole Centrale de Nantes for 30 years. It is still used in many of our research projects. Typical use is estimation of dynamic response of floating structures or performance assessment of wave energy converters. Nemoh is the world first open source BEM code. Since January 2014, it has been released under the terms of the Apache 2 licence. Copy of the license may be obtained at http://www.apache.org/licenses/LICENSE2.0. Unlike other BEM softwares, Nemoh’s approach decouples the resolution of the linear free surface Boundary Value Problem (BVP) and the definition of the boundary condition on the body (body condition). This feature makes it easy to deal with flexible structure, hydroelasticity, generalised modes and unconventional degrees of freedom with Nemoh. News
* Code acceleration by a factor typically 7 when using the Matlab routine. Gain depends on the number of BVP per frequency.
OverviewNemoh is composed of three programs which are supposed to be run one after the other. A Matlab wrapper Nemoh.m is provided in the Matlab routine folder. It makes it easy to use Nemoh from the Matlab environment. Meshing tools are also provided. See the matlab routines axiMesh.m, Mesh.m in the Matlab routine folder and the Mesh code. Examples are shown in the example section below. Referencing NemohPublication or report using NEMOH should refer to:
InstallationSource codeTo download the source code, the only requirement is to register here http://lheea.ecnantes.fr/redmine/account/register. Then, the source code can be downloaded from http://lheea.ecnantes.fr/cgibin/hgweb.cgi/nemoh/. Log in using your account information. Code development uses Mercurial for version control. If you wish to contribute to code development, it is advised to clone this Mercurial repository and use the same version control tool. Win32 compatible environmentExecutables version of the code (.exe) can be downloaded here. Matlab routines for use of Nemoh in the Matlab environment can be downloaded here. Alternatively, you may wish to compile your own version of the codes. Codes should compile without troubles with the Intel Fortran compiler ifort. Dependencies are:
The Visual Studio solution Nemoh.sln may be used for easy compilation of Nemoh with Microsoft Visual Studio. Linux and Mac OS X environmentA makefile is provided with the source code for compiling Nemoh in Linux and Mac OS X environment. The Intel Fortran compiler ifort shall be used for Linux. The gfortran compiler should be used for Mac OS X. Some adjustments may be require for Mac, look at the OSXreadme.txt. Other compilers may compile with small adjustments to the libraries. Dependencies are the same as for compiling in Win32 environment. Thanks goes to Christophe Peyrard, YiHsiang Hu and Eliot Quin for providing the makefile. TheoryNotations and conventionsNotations and conventions are described here. General equationsRunning NemohRunning Nemoh with MatlabIt is the easiest way to start with Nemoh. In the folder Matlab routines/, one can find .m files for generating meshes and running Nemoh with them. Note that the code is expected to be run on a win32 compatible environment. Mesh generationOne may use axiMesh.m to generate an axisymmetric mesh with Matlab. Non axisymmetric meshes may be generated using Mesh.m. Type help axiMesh or help Mesh in Matlab to obtain guidance in using these routines. NemohBoth mesh generators will generate the appropriate folder structure and input files, so that Nemoh can be used right after having generated the mesh. The routine Nemoh.m is a Matlab wrapper for Nemoh. It takes care of the calculations and imports results (first order hydrodynamic coefficients) in the Matlab environment. Type help Nemoh in Matlab for guidance. Running Nemoh in command lineRunning Nemoh in command line is necessary to make use of full capabilities of the code, such as generalized modes and non conventional degrees of freedom. Input files

input.txt
Nemoh.cal
preProcessorThe aim of the preProcessor is to prepare the mesh and to generate the body conditions for each calcuation case (radiation and diffraction). Calculation cases are defined in the input file Nemoh.cal which must be located in the working folder. Once the preProcessor has been run successfully, the following files are created in the working folder:
solverThe aim of the solver is to solve the linear BVP for each problem defined in the file Normalvelocities.dat. The calculation depends on parameters which are read in the file input.txt, located in the working folder. Once run successfully, the following results files are created and stored in the working folder:
postProcessorThe aim of the postProcessor is to postprocess the results in order to provide the relevant quantities (added mass, radiation damping, excitation force) in the usual format. It also provides a framework to make relevant calculations. Once run successfully, the following results files are created and stored in the working folder:
ExamplesVertical cylinderThis example is a floating vertical cylinder with usual 6 degrees of freedom (surge, sway, heave, roll, pitch, yaw). Input files may be downloaded here. Results are shown in the following figure. Comparison with results obtained using the BEM code Aquaplus are also shown in the same figure. Two interacting bodiesThis example deals with the hydrodynamic interactions between two bodies. The bodies are cubes. One of the cube is rotated by 45° degrees around the z axis. Each body has the usual 6 degrees of freedom (surge, sway, heave, roll, pitch, yaw). Input files may be downloaded here. Results are shown in the following figure. Comparison with results obtained using the BEM code Aquaplus are also shown in the same figure. Non symmetrical bodyThis example deals with a body for which the (xOz) plane is not a symmetry plane. The body has the usual 6 degrees of freedom (surge, sway, heave, roll, pitch, yaw). Input files may be downloaded here. Results are shown in the following figure. Comparison with results obtained using the BEM code Aquaplus are also shown in the same figure. postprocessingThis example displays postprocessing capabilities of Nemoh. These capabilities are:
The body is a cube with the usual 6 degrees of freedom (surge, sway, heave, roll, pitch, yaw). Input files may be downloaded here. Results are shown in the following figure. Comparison with results obtained using the BEM code Aquaplus are also shown in the same figure. MeshMesh formatThe mesh is composed of flat quadrangular panels. Only the submerged part of the body must be described. The format of a mesh file is:
The sketch below shows the orientation convention used to describe the panel as seen looking from the fluid domain into the body. It is possible to consider several bodies with different degrees of freedom with hydrodynamic interactions. This is obtained by meshing separetely each body. The assembled mesh will be defined in the Nemoh.cal input file and built by the preProcessor. Mesh generationThere are several alternatives to generate meshes for Nemoh. Some tools are provided in order to help. However, one may use any CAD software provided that one will be able to export the mesh to the correct format for Nemoh. Mesh generation using the Matlab routines axiMesh.m or Mesh.mOne may use axiMesh.m to generate an axisymmetric mesh with Matlab. Only the line generating the profile needs to be described in this case. The axis will be necessarily vertical in this case. As an example, here is how to generate a vertical cylinder with 10m diameter and 5m draft: >> n=4;>> r=[0 5 5 0];>> z=[5 5 5 5];>> [Mass,Inertia,KH,XB,YB,ZB]=axiMesh(r,z,n) Non axisymmetric meshes may be generated using Mesh.m. However it is assumed that a symmetry about the (xOz) plane is used, thus only half of the body must be described. This routine also allows to generate meshes with several interacting bodies. In this case one will have to describe roughly the geometries. Mesh will be refined automatically and part above sea water level will be cut out. As an example, here is how to generate a mesh for a regular box with 10m length and 5m draft: >> nBodies=1;>> n=5;>> X(1,1,:,:)=[5. 5. 5.;5 5. 5.;5. 5. 5.;5. 5. 5.];>> X(1,2,:,:)=[5. 0. 5.;5 5. 5.;5. 5. 5.;5. 0. 5.];>> X(1,3,:,:)=[5. 0. 5.;5 0. 5.;5. 5. 5.;5. 5. 5.];>> X(1,4,:,:)=[5. 0. 5.;5 5. 5.;5. 5. 5.;5. 0. 5.];>> X(1,5,:,:)=[5. 0. 5.;5 0. 5.;5. 5. 5.;5. 5. 5.];>> tX(1)=0.;>> CG(1,:)=[0. 0. 2.5];>> nfobj(1)=300;>> [Mass,Inertia,KH,XB,YB,ZB]=Mesh(nBodies,n,X,tX,CG,nfobj) Mesh generation using the Mesh codeThe Mesh code is not a meshing software. Actually, it allows to refine a mesh and to calculate properties such as displacement, buoyancy center, hydrostatic stiffness. It also makes estimate of masses and inertia matrix. The concept with this software is to write by hand a coarse description of the body under consideration and to have Mesh make the refined mesh for Nemoh calculations. Input files are:

Output files are:
Using a CAD softwareCAD softwares may be used to generate meshes for Nemoh, provided they can export surfacic meshes which can be further converter to Nemoh’s mesh file format. Some of them can generate .gdf mesh files, which may be used in combination with the nemoh2wamit_01a.m Matlab routine. It is also possible to use the meshmagick utility that is a converter between major mesh file formats used in hydrodynamics.
ToolboxMesh manipulation in Python with MESHMAGICKMESHMAGICK is a mesh conversion tool whose goal is the interoperability between major mesh file formats being used for hydrodynamic softwares (NEMOH, WAMIT, DIODORE, HYDROSTAR), and visualization softwares (STL, TECPLOT, PARAVIEW). MESHMAGICK is also a mesh manipulation tool (translation, rotation, scaling…) for ease of mesh preparation. Since version 1.0, it also includes hydrostatics utilities to retrieve hydrostatics data (center of buoyancy, hydrostatic stiffness matrix…) and lid creation for irregular frequency removal in Nemoh (This Nemoh’s feature is not released yet). The project is open source (under GPLlike CeCILL 2.1 licence) and it’s official web page is here (just like Nemoh, you need an account on the LHEEA’s redmine platform). The mercurial repository to clone the project is : Mesh conversion in MatlabConverting a Nemoh mesh to WAMITNemoh mesh files may be converted to WAMIT .gdf files. One may use the nemoh2wamit_01a.m Matlab routine to do so. The routine has been developed and made available to the community by G. Payne. Using a WAMIT mesh with NemohWAMIT .gdf mesh files may be used with Nemoh. One may use the GDFMesh.m Matlab routine to do so. The routine has been developed and made available to the community by L. Banos. Alternatively, one may use the runNemoh.m Matlab routine, which allows running Nemoh with .gdf files and only one routine. The routine has been developed and made available to the community by M. Thott Andersen. Mesh conversion from opensource SalomeMeca framework to NemohThis script may be used to convert meshes created in the opensource SalomeMeca framework to Nemoh format. The routine has been developed and made available to the community by P. Schmitt. Mean horizontal drift forcesA Matlab routine has been developed in order to calculate the mean horizontal drift forces on a body using the far field approach (Maruo,1960 and Newman,1967). The routine has been developed and made available to the community by V. Arnal. Nemoh to OrcaflexA Matlab routine has been developed in order to export Nemoh’s outputs in Orcaflex’s format. The routine has been developed and made available to the community by V. Arnal. Contact usFor questions, comments or bug reports, please leave a post on Nemoh’s forum: http://lheea.ecnantes.fr/redmine/projects/nemoh . You may have to register first (http://lheea.ecnantes.fr/redmine/account/register). For other queries, you may contact Dr. Aurélien Babarit, aurelien.babarit@ecnantes.fr
