Before you begin, it is recommended that you open the NEMOH website and the read the articles on 'Running NEMOH' and creating a 'Mesh'. This article provides some useful guidance which supplements that provided on the official NEMOH website. NEMOH is run from a command prompt window as it does not currently have a dedicated user interface. So you may find that it is not very user-friendly, but provided you follow some basic guidelines, you should be able to run the program without much difficulty.
NEMOH is an open source software developed by researchers at Ecole Centrale de Nantes which is freely available for download. The product currently does not have a dedicated installer pack, so you simply download the ZIP file, unzip it to extract the program executables, and store these on your local hard drive. In order to make the product easy to find, we suggest that you create a sub-folder in your standard program directory (e.g. 'C:\Program Files\Nemoh v2.03' or similar). If you do not have administrator privileges on your computer, you may wish to choose a generic folder which over you have full access (e.g. your 'desktop' or 'my documents' folders).
Meshmagick is a useful meshing tool which is compatible with NEMOH. It enables mesh visualisation so we recommend that you install it along with NEMOH. We recommend that you install Meshmagick via Python, as this will allow you to use the command line options programmatically via Python scripts if desired. Meshmagick is currently written in Python 2.7 so this needs to be installed before installing Meshmagick itself. Installation instructions are available online, but the main points are summarised here for convenience...
•Navigate to the Anaconda download page using your internet browser.
•Click on Downloads, then click on Windows.
•Under the section 'Python 2.7 version', click on '64-Bit Graphical Installer' to install the 64-bit version (or the 32-bit version if your local operating system happens to be 32-bit).
•Run 'Anaconda2-2019.03-Windows-x86_64.exe'. Select the default options during installation, and also tick the box which allows the installer to add Anaconda to the Windows system path (this allows your computer to recognise Python via the Windows Path, which is useful when running Python scripts from the command prompt).
Next you can proceed to the installation of Meshmagick itself.
•Open an Anaconda command prompt window. You'll find this on the Windows start menu by clicking Windows->Anaconda2 (64-bit)->Anaconda Prompt, or similar. Or simply use the Windows search bar to locate 'Anaconda Prompt'.
•In the Anaconda command prompt, change the version of conda to 4.2, by typing: conda install conda=4.2. Type y to accept the changes when prompted.
•Close the current Anaconda command prompt and then reopen a new one.
•Now install Meshmagick by typing: conda install -c frongere meshmagick. Type y to accept the changes when prompted.
•You can check if the installation has completed successfully by typing: meshmagick -h. This should show the Meshmagick command line help.
Create a new folder somewhere on your local hard drive to act as your working directory for running your NEMOH simulations. NEMOH requires that the working directory contains 4 files and 2 sub-folders (otherwise it will not run, and the command line errors may not offer much in the way of explanation). So the contents of your working directory must include:
•Mesh (folder)
•MeshFileName.dat (where 'MeshFileName' is the name of your pre-mesh file)
•Results (folder)
•This folder can be empty, but must be present nonetheless
•ID.dat
•Input.txt
•Mesh.cal
•Nemoh.cal
This file is simply used to identify the location of the working folder. It consists of a text expression to identify the path to the working folder, with another variable used to state the length of this text expression. The most straightforward approach is to identify the current folder as the working folder. So the file contents would read as follows.
1 ! Number of characters in working folder name
. ! Working folder name
This file contains some solution parameters for controlling the operation of NEMOH. The following illustrates some default values as taken from an example provided with NEMOH.
--- Calculation parameters ------------------------------------------------------------------------------------
0 ! Indiq_solver ! - ! Solver (0) Direct Gauss (1) GMRES (2) GMRES with FMM acceleration (2 not implemented yet)
20 ! IRES ! - ! Restart parameter for GMRES
5.E-07 ! TOL_GMRES ! - ! Stopping criterion for GMRES
100 ! MAXIT ! - ! Maximum iterations for GMRES
1 ! Sav_potential ! - ! Save potential for visualization
This file controls the meshing program which accompanies NEMOH. A sample file which you may use as a starting point is as follows. The variables are fairly self-explanatory. Note that the z coordinate of the centre of gravity is measured from the mean water line downwards.
MeshFileName.dat ! Name of pre-mesh file
0 ! 1 if a symmetry about (xOz) is used. 0 otherwise
0 0 ! Possible translation about x axis (first number) and y axis (second number)
0 0 -1 ! Coordinates of gravity centre
144 ! Target for the number of panels in refined mesh
2
0
1
1025 ! Water density (kg/m3)
9.81 ! Gravity (m/s2)
MeshFileName.dat
This is the pre-mesh file which NEMOH's meshing program can refine for you. The format is as follows.
Nn Number of nodes (integer)
Np Number of panels (integer)
x y z List of nodal coordinates (real numbers).
. . .
. . .
. . .
N1 N2 N3 N4 List of panel connectivities (integers).
. . .
. . .
. . .
Notes:
•NEMOH's convention is that the z axis is vertical, while the x and y axes are horizontal.
•The z coordinate values are measured from the mean water line downwards (i.e. any nodes below the water line should have a negative z value). It is not necessary to include any part of the body which lies above the water line, but we recommend that you include the full body, as no further mesh creation will be required if you decide to alter the body's draft subsequently.
•N1 to N4 are the indices of the 4 nodes which form each quadrilateral panel. The nodes should be numbered anti-clockwise when the panel is viewed from the fluid domain towards the body.
•You can model triangular panels also, but you must still specify 4 nodes. For example, if your nodes are numbered 1, 2 & 3, then the panel will be defined as 1, 2, 3, 1.
This file controls the operation of NEMOH. A sample file which you may use as a starting point for a single body is as follows. The variables are fairly self-explanatory.
--- Environment ------------------------------------------------------------------------------------------------------------------
1025.0 ! RHO ! KG/M**3 ! Fluid specific volume
9.81 ! G ! M/S**2 ! Gravity
25. ! DEPTH ! M ! Water depth
0. 0. ! XEFF YEFF ! M ! Wave measurement point
--- Description of floating bodies -----------------------------------------------------------------------------------------------
1 ! Number of bodies
--- Body 1 -----------------------------------------------------------------------------------------------------------------------
.\Mesh\MeshFileName.dat.dat ! Name of mesh file
276 72 ! Number of points and number of panels
6 ! Number of degrees of freedom
1 1. 0. 0. 0. 0. 0. ! Surge
1 0. 1. 0. 0. 0. 0. ! Sway
1 0. 0. 1. 0. 0. 0. ! Heave
2 1. 0. 0. 0. 0. -0.5 ! Roll about CdG
2 0. 1. 0. 0. 0. -0.5 ! Pitch about CdG
2 0. 0. 1. 0. 0. -0.5 ! Yaw about CdG
6 ! Number of resulting generalised forces
1 1. 0. 0. 0. 0. 0. ! Force in x direction
1 0. 1. 0. 0. 0. 0. ! Force in y direction
1 0. 0. 1. 0. 0. 0. ! Force in z direction
2 1. 0. 0. 0. 0. -0.5 ! Moment force in x direction about CdG
2 0. 1. 0. 0. 0. -0.5 ! Moment force in y direction about CdG
2 0. 0. 1. 0. 0. -0.5 ! Moment force in z direction about CdG
0 ! Number of lines of additional information
--- Load cases to be solved -------------------------------------------------------------------------------------------------------
21 0.2 3.0 ! Number of wave frequencies, Min, and Max (rad/s) -> goes from T=2.1s to 31.4s approx
1 0. 0. ! Number of wave directions, Min and Max (degrees)
--- Post processing ---------------------------------------------------------------------------------------------------------------
1 0.1 10. ! IRF ! IRF calculation (0 for no calculation), time step and duration
0 ! Show pressure
181. 0. 180. ! Kochin function ! Number of directions of calculation (0 for no calculations), Min and Max (degrees)
0 2 1000. 2. ! Free surface elevation ! Number of points in x direction (0 for no calcutions) and y direction and dimensions of domain in x and y direction
Notes:
•The name of the mesh file refers to the file which is created by NEMOH's meshing program, not the pre-mesh file which you created.
•The number of points and panels again refers to the final mesh file, which are most likely different from those specified in the pre-mesh file.
NEMOH does not have a user interface in the conventional sense and so must be ran from a command prompt window. Begin by taking the following steps.
•Open a command prompt window by selecting it from your Windows start menu. Alternatively use the Windows search bar to search for 'Command Prompt'.
•Navigate to your working folder by using the 'cd' (change directory) command. For example, type something like cd "C:\My Working Folder" and press return to execute the command. Note that you must include quotation marks if the path to your working folder contains spaces.
•Make a note of the location of the NEMOH program executables on your local hard drive. This will typically be something like 'C:\Program Files\Nemoh v2.03'.
There are 4 steps involved in running NEMOH.
1.Run the meshing program, 'Mesh.exe'.
•e.g. type something like "C:\Program Files\Nemoh v2.03\Mesh.exe" and press return to execute the command.
•Assuming the program runs correctly, the 'Mesh' sub-folder of your working folder will now contain the final mesh file. If your pre-mesh file is named 'MeshFileName.dat', then the final mesh file will be named 'MeshFileName.dat.dat'.
•Note the number of nodes and panels in the final mesh file - you will need to specify these in the 'Nemoh.cal' file before running NEMOH itself.
•Examine the mesh visually using Meshmagick. To do this you should open an Anaconda prompt window (use the Windows search bar to locate 'Anaconda Prompt'), navigate to the 'Mesh' sub-folder of your working folder, type something like meshmagick Description_Full.tec --show and press return to execute the command. Make sure that the mesh looks correct and that the panel normal vectors are pointing outwards from the body into the fluid domain (once Meshmagick is open, you can press 'N' to display the normal vectors).
2.Run the pre-processor, 'preProcessor.exe'.
•e.g. type something like "C:\Program Files\Nemoh v2.03\preProcessor.exe" and press return to execute the command.
3.Run the simulation solver, 'Solver.exe'.
•e.g. type something like "C:\Program Files\Nemoh v2.03\Solver.exe" and press return to execute the command.
4.Run the post-processor, 'postProcessor.exe'.
•e.g. type something like "C:\Program Files\Nemoh v2.03\postProcessor.exe" and press return to execute the command.
Sample Mesh Displayed by Meshmagick
Once you are satisfied with the hydrodynamic simulation performed by NEMOH, you should use the Hydrodynamic Data Importer to convert its output data into a format which is readily accessible by Flexcom. The importer produces the following 4 files.
•Hydrostatic_Stiffness.dat. This file contains Hydrodynamic Stiffness data which is used to model the effects of buoyancy on the floating body. These inputs may be copied into the *FLOATING BODY keyword in your Flexcom model.
•Force_RAOs.dat. This file contains Force RAO data from which high frequency First-Order Wave Loads are derived. This file name may be referenced directly from the *FORCE RAO keyword in your Flexcom model.
•Added_Mass.dat. This file contains Added Mass data from which Wave Radiation Loads are derived. This file name may be referenced directly from the *ADDED MASS keyword in your Flexcom model.
•Radiation_Damping.dat. This file contains Radiation Damping data from which Wave Radiation Loads are derived. This file name may be referenced directly from the *RADIATION DAMPING keyword in your Flexcom model.