A modular graphical user interface for WAMIT Gr´egory S. Payne School of Engineering and Electronics, University of Edinburgh Mayfield Road, Edinburgh EH9 3JL, Scotland E-mail:
[email protected]
Abstract The hydrodynamic numerical modelling package WAMIT is a widely used boundary element method code. It is mainly distributed in its PC executable version which does not include any graphical user interface. Instead, input settings are entered into the program by means of text files. Computation results are output in the same way. Preparation of the input files and post-processing of the outputs is often time consuming and repetitive. This paper presents a graphical user interface addressing this task. The interface, programmed in MatLab, is split into pre- and post-processing parts. Its key feature is its modular structure. The programme consists of numerous independent modules that carry out specific and self contained tasks. This makes it easy to customise the interface to suit new requirements. Keywords: graphical user interface, numerical modelling, WAMIT, wave energy.
Nomenclature A aθ bθ cθ Dpto F eθ Fpto g m Pmax Pwave T uθ η θ ρ ω
= = = = = = = = = = = = = = = = =
wave amplitude added mass along translation axis hydrodynamic damping along translation axis hydrostatic stiffness along translation axis power take-off damping coefficient wave exciting force along translation axis power take-off control force gravitational acceleration device mass maximum power captured wave power wave period translational velocity capture width angle of the translation axis water density radian frequency
has evolved from custom specialist applications to general commercial packages. As these are becoming more common throughout universities and industries, they tend to be utilized more readily by users without necessarily strong numerical and programming backgrounds. The packages are, however, often adapted from academic FORTRAN research codes developed with little emphasis on user friendliness and some users may find themselves spending significant time preparing and post-processing computations rather than analysing results. WAMIT (Wave Analysis Massachusetts Institute of Technology) is a state of the art package for the hydrodynamic numerical analysis of the interactions between ocean waves and floating or submerged bodies. It is based on linear theory and on the panel method. It has been widely used in the offshore industry [1] and more recently for the modelling of wave energy converters [2–4]. The PC executable version of WAMIT does not include a graphical interface. Settings and parameters are input to the program via text files. Computation results are output using the same method. There are several examples of tools developed to render the use of WAMIT more efficient and more accessible. In most cases, WAMIT has been used as a ‘computation core’ integrated into a broader numerical modelling utility. In [5], Weber and Thomas have imbedded WAMIT into a wave energy converter modelling and optimisation tool focusing on the variation of multiple design parameters. The tool has been developed using the Mathematica package. In [6], Birk and Clauss present an integrated optimisation system which automates hull design and hydrodynamic analysis of offshore structures. The hydrodynamic quantities are computed using WAMIT and the rest of the system is programmed in Python language. The present paper describes a generic graphical user interface developed for WAMIT 6.0 which includes pre- and postprocessing capabilities. The concept of the interface is first presented. A detailed description of the programme is then given and finally a case study illustrates the possibilities of customising the interface.
Introduction
1
Hydrodynamic numerical modelling has now become a powerful tool for the development of wave energy converters. It
WAMIT is a complex numerical package with numerous input settings and parameters as well as a wide range of output quantities. Moreover, the numerical modelling of wave energy converters often requires significant post-processing of the computation outputs to assess a device’s performance. Developing
c Proceedings of the 7th European Wave and Tidal
Energy Conference, Porto, Portugal, 2007
Conceptual approach
a graphical interface capable of comprehensively handling all the pre- and post-processing tasks that any device developer would ever consider is virtually impossible. This is mainly because the requirements for such an interface are largely specific to the type of analysis and to the type of wave energy converter considered. As an example, the design parameters to investigate when carrying out a sensitivity analysis on mooring loads are different whether it is for a Pelamis or for a floating OWC system. Similarly, energy capture of these devices will be computed differently from the hydrodynamic quantities output by WAMIT. The new interface aims at laying the foundations on which users can develop add-ons to suit their requirements. The key feature of the interface is its modular structure. The different modules of the interface carry out specific and self contained tasks. They ‘communicate’ with each other via a well defined procedure. This modular structure makes it easy to accommodate extensions. MatLab can be considered as a standard programming language for technical computing. It is widely used throughout academia and industry and offers good graphical capabilities. It was therefore chosen for developing the interface as it makes the programming of extensions accessible. MatLab also includes a compiler to turn MatLab functions into stand-alone applications. Unfortunately the compiler comes with restrictions and the interface cannot be compiled properly as a stand-alone program. In other words, MatLab needs to be running on the computer where the interface is to be used. The interface consists of pre- and post-processing units. Both can be run independently of the actual WAMIT computations. The pre-processing interface gathers, through a series of windows, the input parameters. These can be saved, then later loaded and modified to create a new input configuration. This feature makes it easy to set up series of computations whose runs can then be automated. This is for example useful when carrying out convergence tests which consists of several computations for which the only differences are the size and distribution of the panels. The post-processing interface deals with the outputs from WAMIT computations and allow the user to graphically analyse various physical quantities and performance indicators associated with the wave energy converter modelled.
2
Detailed description
2.1
Pre-processing
For a WAMIT computation to be run, several input text files are required. These are typically: • The configuration files (CONFIG.WAM) that contains the configuration settings for the computation. These typically specify the type of solver, the amount of memory available for the computation etc. • The potential file (.POT) specifies the parameters relative to the potential flow to be computed. These are typically the different degrees of freedom, wave periods and heading angles to be investigated. • The geometry file (.GDF) specifies the geometry of the body studied.
Figure 1: Graphic user interface window for defining parameters relative to the potential file. • The ‘force’ file (.FRC) specifies the external forces applied to the body studied as well as its inertia. • The name file (FNAMES.WAM) lists the names of the above files. The pre-processing graphical user interface consists of a series of data specification windows which gather the input parameters from the user. There is at least one window associated with each of the different input files described above. An example of such a window is shown in figure 1. Navigation between the different windows is achieved by pressing the ‘Next’ or ‘Back’ button at the bottom of each of them. All the settings of a window are stored in a MatLab object orientated variable called a structure. Every setting available in the window is associated with a field of this structure. Control of a new setting can easily be implemented by modifying the window and adding a corresponding field to the structure. The structure variable for each window is part of the main structure variable which stores the settings for the whole pre-processing interface. This programming approach is key to the flexibility of the interface and makes it easy to extend the interface with new features. Setting the input parameters is decoupled from running WAMIT. Once these parameters have been set through the interface they can be saved. The MatLab programme running the actual WAMIT computations generates the input text files from the main structure variable containing all the settings defined with the interface. This makes it possible to define a set of several input settings using the interface and then to automate the execution of all the corresponding WAMIT runs at a suitable time, for example overnight.
• The file is automatically converted into an input geometry file for WAMIT using the DOS based utility. • The geometry file can be visualised at the user request. -2
2.1.2
-4 -6 -8 10
-10 -10
5 -5
0
0 -5
5 10
-10
Figure 2: Graphical representation of the input geometry produced by the interface.
2.1.1
Geometry definition
In WAMIT, the definition of the geometry of the body studied is the most complex input. Three methods are available: • Using a set of quadrilateral flat panels to approximate the geometry.
Inertia data
The mass properties of a free floating body can have a significant impact on its response to waves. It is therefore important to specify these accurately in WAMIT inputs. This can turn out to be a tedious task when the wave energy device considered is made of several parts of different shape and different materials. In this case, it is useful to create a CAD model of the device using a 3D mechanical design package such as SolidWorks. Such software can easily compute the mass properties of the system. Using the mass properties computed by SolidWorks and saved as a text file, the pre-processing tool can generate the mass matrix required by WAMIT and incorporate it into the ‘force’ input file. Alternatively, mass properties can be input manually or extensions can be developed to compute them automatically for simple shapes.
• Using B-spline surfaces which are generated by piecewise continuous polynomial parametric curves [7].
2.1.3
• Defining the geometry analytically by coding a set of analytical functions.
The flowcharts of figure 6 (in the appendix) show the structures and the different MatLab ‘functions’ forming the pre-processing interface. A brief description of these functions is given in table 1. The modular aspect of the programme calls for the different subroutines to carry out individual and self contained tasks, hence the large number of functions.
The pre-processing interface covers the last two techniques which are associated with the higher order method for computing the velocity potential. For most applications this method associates versatility with computational efficiency [8]. When using B-splines, the geometry is first created using the CAD package MultiSurf. This software has been specially developed to design surfaces and its main application lie in the yachting industry. It provides a wide range of ways to generate surfaces including B-splines. A special DOS based add-on enables these surfaces to be exported into the WAMIT geometrical input format. The pre-processing tool provides a graphical interface to the DOS utility. It also gives the possibility to visualise the geometry defined. This feature requires a short WAMIT run during which no hydrodynamic quantity is computed (hence the very short running time), but an auxiliary output file is generated. This file provides the Cartesian coordinates of a number of points describing the different patches of the geometry which are then plotted by the interface. The advantage of using these output data is that they correspond to the geometry as reconstructed by WAMIT, so that this visualisation relies on WAMIT itself and not on any other user coded routine. An example of this visualisation is shown in figure 2 for a hemisphere. The different steps of the geometry definition are summarised in the following: • A shape consisting of surfaces is created using MultiSurf. A corresponding file is saved under the format NBS (Nonuniform B-Spline). • When running the interface, the user is asked to locate the NBS file.
2.2
Programme flowchart
Post-processing
The post-processing of WAMIT outputs is by nature less generic than the pre-processing. As explained in section 1, part of the pre-processing is application specific. However, the preparation of WAMIT computations relates to creating a well defined set of input parameters. The calculations and plots involved in the post-processing depend on what the user wants to make out of the data and this is very case specific. As mentioned earlier, the way computational outputs are processed to derive the capture width of a device is very different for an OWC and a Pelamis type device. The inputs to the post-processing tool are the result text files output by WAMIT. The interface presented here consists of several generic units that allow graphical comparison of added mass, hydrodynamic damping, wave exciting force and body response for different WAMIT computations. It also gives the possibility to display the hydrostatic coefficients. Figure 3 shows the main window of the interface plotting the added-mass coefficients. The corresponding flowchart is shown in the appendix in figure 7 with the routine descriptions given in table 2. As with the pre-processing tool, the modular aspect of the post-processing interface allows easy adaptation and extension to specific applications. This is demonstrated in the following case study.
cθ the hydrostatic stiffness along the translation axis. The corresponding power captured Pmax is given by [9]: Pmax =
|F eθ |2 4 (bθ + Dpto )
(3)
where F eθ is the wave exciting force along the translation axis. The performance of the device is investigated in terms of relative capture width η defined here as the ratio of the power captured by the device to the power contained in the incoming wave front of the same width as the device. Assuming infinite water depth, the incoming wave power Pwave per unit of wave front width is given by [10]: ρg 2 A2 T Pwave = (4) 8π where ρ is the water density, g the gravitational acceleration, A the wave amplitude and T the wave period. Figure 3: Graphic user interface window for plotting the added mass coefficients
z
3.2
damper translation direction
θ x
incoming wave direction Figure 4: Schematic diagram of the spherical single degree of freedom wave energy converter. θ indicates the angle of the translation direction to the x-axis.
3 3.1
The present case study investigates the relative capture width of the device described above with the angle θ of the translational direction varying from 0◦ to 180◦ . The wave periods considered range from 5 to 20 seconds.
Case study Generalities
For the sakes of simplicity, the wave energy converter considered is a single degree of freedom point absorber whose performance is investigated in regular waves. The device consists of a neutrally buoyant hemisphere, 20m in diameter whose motion is restrained to a single translation. The axis of the translation lies at an intermediate angle θ between surge and heave. A simple control strategy is adopted with the control force of the power take-off, Fpto being proportional to the translational velocity uθ : Fpto = Dpto uθ (1) where Dpto is the power take-off damping coefficient and is real. A schematic of the device is shown in figure 4. In these conditions it can be shown [9] that the optimum value of Dpto to maximise the power captured is: cθ Dpto = bθ + iω(m + aθ ) − i (2) ω where aθ and bθ are respectively the frequency dependant added-mass and hydrodynamic damping coefficients along the translation axis, ω the radian frequency, m the device mass and
Extension of the interface
No modification nor extension of the pre-processing interface is required for preparing the WAMIT computations associated with the device. From equations (2) and (3) it can be seen that the four quantities required from WAMIT are added-mass, hydrodynamic damping, hydrostatic restoring force and wave exciting force. Given the configuration of the device, only two modes of motion need to be analysed: surge and heave. A representation of the device geometry obtained from the pre-processing interface is given in figure 2. The post-processing required to analyse the relative capture width of the device first involves the computation of the hydrodynamic quantities along the translation direction from the surge and heave outputs of WAMIT. This is done using transformation matrices [11]. The maximum power captured can then be computed from equation (3) and the relative capture width derived and plotted. The flowchart of figure 8 in the appendix shows the structure of the post-processing. The MatLab functions with the † symbol are ‘borrowed’ from the generic post-processing modules described in section 2.2. The ‡ symbol indicates the functions that were created for the case study but which are self-contained and have a generic aspect making them easy to use for other post-processing applications. The functions are described in table 3. This case study shows how the modular structure is well appropriated to make the extension of the post-processing interface quick and easy.
3.3
Results
Figure 5 shows the relative capture width in percent plotted against wave period and angle of the translational direction (θ). It can be seen that in places relative capture width exceed 100%. This is not non-physical and it is due to the ‘point absorber’ effect that makes it possible for a wave energy device to absorb energy from a wave front wider than its physical width [12].
180 10
30
20
160 20
30
40
90
8 70 0
1 120130 100110
30
40
20
60
120
30
50
30
40
10
θ (degree)
0
40 15
140
100
80 20
40
100 90
60
0 11
60 120
130
140
80
40
30
50
150
40 70
30
60 40
50
20 40
20
10
30
0 5
10
15
20
Period (s)
Figure 5: Contour graph of the relative capture width plotted against wave period on the abscissa (x-axis) and against θ on the ordinate (y-axis). The relative capture width values, in percent, are indicated by the contours. The scale of the contour graph has been deliberately limited to a maximum relative capture width value of 150% despite the fact that some of the values computed reach several hundred percents. This was done to avoid ‘flattening’ the graph. Such very high relative capture width values imply large motions of the sphere which are impractical from an engineering point of view and incompatible with the linear hydrodynamic theory that WAMIT is based on. The actual values of the relative capture width maxima are therefore of limited interest. The trend of the graph however shows the advantage of a sloped axis of translation versus pure surge or heave motions. For values of θ between 30◦ and 40◦ the capture width is high over a large part of the wave period range.
The key feature of the interface is its modular structure which allow users to easily develop modifications and extensions to suit their requirements. This is illustrated in the case study of section 3 for which a post-processing tool is created. The tool consists of several modules of which only a minimum are specific to the application. The others are either pre-existing or newly developed modules but with strong generic capabilities. At present the interface only deals with WAMIT computations involving a single rigid body. It is desirable to develop extensions that would allow preparation and post-processing of computations for multiple and deformable bodies.
Conclusions and further work
As the interface will be utilised by more users it can be expected that they will develop more generic modules. As the ‘library’ of modules will expand, so will the capabilities of the interface.
The graphical interface presented in this paper is designed to render the use of WAMIT more accessible by easing the preand post-processing of WAMIT computations.
Acknowledgements
For the pre-processing, the interface covers a wide range of WAMIT functionalities. It also integrates the MultiSurf and SolidWorks CAD packages to create geometries and derive mass properties respectively. The post-processing is by nature case specific but a set of generic modules are provided to graphically compare hydrodynamic coefficients from different WAMIT computations.
This work has been supported by the UK Engineering and Physical Sciences Research Council through the SuperGen Marine Research Consortium.
References
Appendix
[1] J.N. Newman and P.D. Sclavounos. The computation of wave loads on large offshore structures. In Conference on the Behaviour of Offshore Structures (BOSS ‘88), volume 2, pages 605–622, Trondheim, Norway, 1988.
WG_initial_01b
general
[2] C.-H. Lee, J.N. Newman, and F.G. Nielsen. Wave Interactions with an Oscillating Water Column. In 6th International Offshore and Polar Engineering Conference, volume 1, pages 82–90, Los Angeles, USA, May 1996.
config_GUI config_GUI_out.frc_frm
frc1_GUI
[3] Y.M.C. Delaur´e and A. Lewis. 3D hydrodynamic modelling of fixed oscillating water column wave power plant by a boundary element methods. Ocean Engineering, pages 309–330, 2003. [4] G. Payne, J.R.M. Taylor, P. Parkin, and S.H. Salter. Numerical Modelling of the Sloped IPS Buoy Wave Energy Converter. In 16th International Offshore and Polar Engineering Conference, pages 396–402, San Francisco, USA, May-June 2006.
frc2_GUI
pot1_GUI
geometry
WG_run_01b
preproc_01b
general_c
[5] J. Weber and G. Thomas. An efficient flexible engineering tool for multi-parametric hydrodynamic analysis in the design & optimisation of WECs. In 6th European Wave Energy Conference, pages 543–548, Glasgow, UK, AugustSeptember 2005.
config_c
frc1_c
[6] L. Birk and G.F. Clauss. Parametric hull design and automated optimization of offshore structures. In 10th International Congress of the International Maritime Association of the Mediterranean, Hellas, Greece, May 2002.
matxt
frc2_c
pot1_c
per_layout
geometry_c
[7] M.E. Mortenson. Geometric Modeling. John Wiley & Sons, 2nd edition, 1997.
mk_fnames_01a
[8] C.-H. Lee, H. Maniar, J.N. Newman, and X. Zhu. Computations of Wave Loads Using a B-Spline Panel Method. In 21st Symposium on naval hydrodynamics, pages 75–92, Trondheim, Norway, 1996.
basic_runwam_01b
rd_mp_frc1
[9] C.-P. Lin. Experimental studies of the hydrodynamic characteristics of a sloped wave energy device. PhD thesis, The University of Edinburgh, Scotland, 1999.
dmp_error
frc1_GUI
mp_error
wt_mp_frc1
stf_error
rd_dmp_frc2
rd_dmp_frc2
[10] J. Falnes. Ocean waves and oscillating systems. Cambridge University Press, 2002. ex_stf_frc2
frc2_GUI
ex_dmp_frc2
[11] G.S. Payne. Numerical modelling of a sloped wave energy device. PhD thesis, The University of Edinburgh, 2006. wt_stf_frc2
[12] D.V. Evans. A theory for wave-power absorption by oscillating bodies. Journal of Fluid Mechanics, 77(1):1–25, 1976.
wt_dmp_frc2
mp_frc2 rd_mp_frc2
wt_mp_frc2 sw2massmat_4_frc2
basic_runwam_01b
GDFgen
nbs2GDF4GUI
geometry
checkwamgeo4GUI
mk_ana_gdf_01a
Figure 6: Flowchart of the pre-processing interface (top). The bottom charts describe in full detail the elliptical boxes the top flowchart.
rd mp frc1: Reads a text file containing the mass property rebasic runwam 01b: Runs WAMIT from the input folder and quired for force files of alternative form 1. moves the output files to the output folder. rd mp frc2: Reads a text file containing the mass property recheckwamgeo4GUI: Provides a visual representation of the quired for force files of alternative form 2. .GDF file as seen by WAMIT. stf error: GUI displaying a window with the error message config c: Creates the CONFIG.WAM file from the input set“You have forgotten to input external stiffness proptings gathered by config GUI. erty data”. config GUI: GUI gathering the parameters to generate the sw2massmat 4 frc2: Outputs the centre of gravity and the inCONFIG.WAM file for WAMIT. ertia matrix from a mass property text file dmp error: GUI displaying a window with the error message generated by SolidWorks 2003. “You have forgotten to input external damping WG inital 01b: First window of the WAMIT pre-processing property data”. GUI. Offers the possibility to load existing inex dmp frc2: GUI gathering the external damping properties put settings or to create new ones. required for force files of alternative form 2. OfWG run 01b: Last window of the WAMIT pre-processing fers the possibility to save data in a text file and GUI. Offers the possibility to save the input setto load data previously saved. tings just created before creating a new set of ex stf frc2: GUI gathering the external stiffness properties resettings or before running WAMIT. quired for force files of alternative form 2. Offers wt dmp frc2: Writes external damping properties (6 × 6 mathe possibility to save data in a text file and to load trix) suitable for force files of alternative form 2 data previously saved. in a text file. frc1 c: Creates the .FRC file of alternative form 1 from the inwt mp frc1: Writes mass properties suitable for force files of put settings gathered by frc1 GUI. alternative form 1 in a text file. frc1 GUI: GUI gathering parameters to generate force files of wt mp frc2: Writes mass properties (position of the centre of alternative form 1. gravity and inertia matrix) suitable for force files frc2 c: Creates the .FRC file of alternative form 2 from the inof alternative form 2 in a text file. put settings gathered by frc2 GUI. stf frc2: Writes external stiffness properties (6 × 6 matrix) wt frc2 GUI: GUI gathering parameters to generate force files of suitable for force files of alternative form 2 in a alternative form 2. text file. GDFgen: GUI gathering the parameters to convert a NBS file read_hs_4_GUI hydrostat_GUI into a GDF. Table 1: Description of flowchart functions of figure 6 general: GUI for locating the input and output folders and for specifying the names of the computation files. general c: Creates the directories corresponding to the data am_dp_index sel_am_file am_dp_index gathered by general. geometry: GUI gathering the parameters required to generate GDF files. Deals with both analytical and B-Spline descriptions of the geometry. plot_am added_mass am_coef_sel geometry c: Creates or copies the GDF files from the input settings gathered by the geometry function. matxt: Lays the matrix consisting of a cell array of strings in the form suitable for the generation of WAMIT input period_conv am_coef_sel_GUI files. mk ana gdf 01a: Creates a GDF file for analytical description of the geometry. Figure 7: Flowchart of the post-processing interface dealing mk fnames 01a: Creates the FNAMES.WAM file. with added-mass coefficients. am_dp_index sel_am_file am_dp_index mp error: GUI displaying a window with the error message “You have forgotten to input mass property data”. added mass: GUI for generic plotting of added-mass coeffimp frc2: GUI gathering the mass properties required for force plot_dp cients.added_damping dp_coef_sel files of alternative form 2. Offers the possibility to am coef sel: Selects the added mass coefficients to be plotted. save data in a text file and to load data from previam coef sel GUI: GUI allowing the user to select the added ously saved data or from SolidWorks mass property mass coefficients to be plotted amongst text file. period_conv dp_coef_sel_GUI those available. nbs2gdf4GUI: Converts NBS file into .GDF file. am dp index: Works out, from the hydrodynamic coefficients per layout: Lays out the different period/angle values in neat file, the indices of the added-mass and damping columns for writing the .POT file. analysed. pot1 c: Creates the .POT file of alternative form 1 from the in- rao_mode_index coefficients sel_rao_file rao_mode_index period conv: Converts wave period in other wave parameters: put settings gathered by pot1 GUI. wavelength, wave number etc... pot1 GUI: GUI gathering parameters to generate potential files plot am: Plots the added-mass coefficients. of alternative form 1. sel am file: Selects theRAO_plot hydrodynamic coefficients file to be rao_plotting rao_mode_sel preproc 01b: Main function of the pre-processing interface. plotted. rd dmp frc2: Reads external damping and stiffness properties (6 × 6 matrix ) suitable for force files of Table 2: Description of flowchart functions of figure 7 alternative form 2 from a text file created by period_conv mode_sel_GUI wt dmp frc2 or wt stf frc2.
rao_mode_index† rot_mat‡ read_force_01a‡
wave_pow‡
cw_1dof_01a
read_hydrocoeff_01a‡
read_hs_4_GUI† ewtec_07_plot_01a
am_dp_index†
Figure 8: Flowchart of the case study post-processing. The † symbol indicates pre-existing routines and ‡ indicates routines developed for the case study but which have generic use.
am dp index: Works out, from the hydrodynamic coefficient file, the indices of the added-mass and damping coefficients analysed. cw 1dof 01a: Main function deriving relative capture width from WAMIT results. ewtec 07 plot 01a: Plots the relative capture width. rao mode index: Works out the modes, the periods and the angles of the RAO and force files analysed. read force 01a: Reads the WAMIT text file containing the exciting force coefficients, sorts them and puts them in dimensional form. read hs 4 GUI: Reads the hydrostatic parameters from the .OUT file. read hydrocoeff 01a: Reads the WAMIT text file containing the added-mass and hydrodynamic damping coefficients, sorts them and puts them in dimensional form. rot mat: Creates a rotation matrix that can be used as a transformation matrix. wave pow: Calculates the power contained in a metre width of wave front. Table 3: Description of flowchart functions of figure 8