NEMOH-Running

Running NEMOH with Matlab

It 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 generation

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

NEMOH

Both 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 line

Running 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

•ID.dat file: This file is used for identifying the calculation. It must be located in the working folder where the codes are run. Second line is a string of characters. It is the name of the working folder. First line is the length of this string. Here is an example:

7

number of characters in file name

example

file name


•input.txt and Nemoh.cal files: These files are the input files for the NEMOH calculation. They must be located in the working folder, according to the ID.dat file. Here are examples. input.txt
 

Calculation parameters

0

Solver selection

Nemoh.cal
                       Environment                                    
 1025.  Sea water density (kg/m3)
 9.81  Gravity (m/s2)
 0.  Water depth (0 for deep water)
 0. 0.  Coordinates of wave measurement point
Description of bodies
 1 Number of bodies
 First body
 example  Name of mesh file
 500 280 Number of nodes and panels
 2  Number of DoFs
 1 1. 0. 0. 0. 0. 0. DoF :  1 for translation (2 for roation), followed by direction vector (axis and center of rotation for rotation). This example is surge
 2  0. 1. 0. 0. 0. -
3.
 
 DoF: 1 for translation (2 for roation), followed by direction vector (axis and center of rotation for rotation). This example is pitch about gravity centre
 2 Number of generalised forces to calculate
 1 1. 0. 0. 0. 0. 0. 1 for force (2 for moment force), followed by direction vector (axis and center of rotation for rotation). This example is force in x direction
 2  0. 1. 0. 0.    0.  -
3.
 
1 for force (2 for moment force), followed by direction vector (axis and center of rotation for rotation). This example is moment force along y axis about gravity centre
 0      Number of additional lines
Load cases to solve
41 0.1 2.  Number of wave frequencies, min, max (rad/s)
1 0. 0.  Number of wave direction, min, max (degrees)
Post processing
1 0.1 10. IRF calculation (1 for yes), time step and duration
0 Save pressure on body surface (1 for yes)
0 0. 181. Kochin function calculation: nb of direction (0 for no), min, max (degrees)
0 50. 500. 500. Free surface vizualization: nb of points in x (0 for no), y and dimensions of domain in x and y directions
 End
• Mesh file: Of course, NEMOH requires an input mesh. The input mesh may be generated by hand, by using the Matlab routines axiMesh.m or Mesh.m, by using the Mesh.exe mesh generation program or by any other meshing software provided that the mesh format meets NEMOH requirements. The mesh format is explained in the mesh section.
 

preProcessor

The 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:
• /Mesh/L12.dat, /Mesh/L10.dat and /Mesh/Mesh.tec files: They are the mesh files. The first one contains tables of nodes and connectivities. The second one contains additional geometrical information such as use of a symmetry about the (xOz) plane, number of nodes, number of panels, number of bodies, panel to body belonging, panel centres, panel normal vectors and panel areas. The last one is in Tecplot compatible format for vizualisation purpose.

• /Normalvelocities.dat file: This file contains the body conditions for each radiation and diffraction problem defined in the Nemoh.cal file.

• /Integration.dat file: This file contains the information about how the pressure has to be integrated over the body surfaces to obtain the requested forces (as defined in the Nemoh.cal file).

• /Results/FKForce.dat, /Results/FKForce.tec files: Froude Krylov forces for each of the diffraction problem. Format of the second file is compatible with Tecplot. It may be used for vizualisation of Froude Krylov forces.

• /Results/FreeSurface.dat file: This file contains the coordinates of the free surface where to calculate the wave elevation.

• /Results/Kochin.dat file: This file contains the angle for which the Kochin function will be calculated.

• /Results/index.dat file: This table gives correlatoin between force ID number, body ID number on which it applies and number if the Nemoh.cal file. It also contains the correlation between ID number of radiation problem, ID of body which is actually moving and the number of degree of freedom.
 

solver

The 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:
• /Results/Forces.dat: This file contains the forces resulting from each problem.

• /Results/freesurface.XX.dat: This file contains the free surface elevation for problem number XX.

• /Results/Kochin.XX.dat: This file contains the Kochin function for problem number XX. Follow this link for more information on notations and conventions used in NEMOH for calculation of the Kochin function.

• /Results/Pressure.XX.dat files: This file contains the pressure field on body surfaces for problem XX.
 

postProcessor

The 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:
• /Results/RadiationCoefficients.tec: This file contains the added mass and damping forces for the radiation problems.

• /Results/DiffractionForce.tec: This file contains the diffraction force for the diffraction problems.

• /Results/ExcitationForce.tec: This file contains the excitation force for the diffraction problems.

• /Results/IRF.tec: This file contains the infinite frequency added mass and the impulse response function for the radiation force.
Published on November 22, 2017 Updated on January 25, 2023