PA032_1 FHR reports
Beheer en Onderhoud CFD modellen Hull grid generation for potential panel methods using Blender
www.flandershydraulicsresearch.be
Beheer en Onderhoud CFD modellen Hull grid generation for potential panel methods using Blender
Van Hoydonck, W.; Villagomez Rosales, J.; Delefortrie, G.; Mostaert, F.
Cover figure
The Government of Flanders, Department of Mobility and Public Works, Flanders Hydraulics Research
Legal notice Flanders Hydraulics Research is of the opinion that the information and positions in this report are substantiated by the available data and knowledge at the time of writing. The positions taken in this report are those of Flanders Hydraulics Research and do not reflect necessarily the opinion of the Government of Flanders or any of its institutions. Flanders Hydraulics Research nor any person or company acting on behalf of Flanders Hydraulics Research is responsible for any loss or damage arising from the use of the information in this report. Copyright and citation The Government of Flanders, Department of Mobility and Public Works, Flanders Hydraulics Research, 2020 D 2020 3241 46 This publication should be cited as follows: sĂŶ ,ŽLJĚŽŶĐŬ͕ t͖͘ sŝůůĂŐŽŵĞnj ZŽƐĂůĞƐ͕ :͖͘ ĞůĞĨŽƌƚƌŝĞ͕ '͖͘ DŽƐƚĂĞƌƚ͕ &͘ (2020). Beheer en Onderhoud CFD modellen: Hull grid generation for potential panel methods using Blender. Version 2.0. FHR Reports, PA032_1. Flanders Hydraulics Research: Antwerp Reproduction of and reference to this publication is authorised provided the source is acknowledged correctly. Document identification Customer:
Flanders Hydraulics Research
Ref.:
WL2020RPA032_1
Keywords (3‐5):
Hydrostar, Blender, Mesh generation, grid convergence, potential methods
Text (p.):
16
Confidentiality:
No
Author(s):
Van Hoydonck, W.; Villagomez Rosales, J.
Appendices (p.):
3
Available online
Control Name Revisor(s):
Delefortrie, G.
Project leader:
Van Hoydonck, W.
Signature Getekend door: Guillaume Delefortrie (Signa Getekend op: 2020-03-10 09:18:53 +01:00 Reden: Ik keur dit document goed
Getekend door: Wim Van Hoydonck (Signat Getekend op: 2020-03-10 10:01:44 +01:00 Reden: Ik keur dit document goed
Approval Head of division:
F‐WL‐PP10‐5 version 21 VALID AS FROM: 21 2 2020
Mostaert, F.
Getekend door: Frank Mostaert (Signature) Getekend op: 2020-03-10 09:26:09 +01:00 Reden: Ik keur dit document goed
Beheer en Onderhoud CFD modellen: Hull grid generation for potential panel methods using Blender
Abstract The objective of this report is to demonstrate methods to efficiently generate approximate hull geometries suitable for programs based on potential theory such as Hydrostar and ROPES. The methods used in this report make use of the free and open�source 3D creation suite Blender. The mesh modelling capabilities available in Blender are perfectly suitable to quickly create approximate hulls starting from an accurate representation consisting of triangles of the actual hull shape. Two methods will be detailed in this report. In the first method, a panel approximation is created from scratch. In the second method, an existing panel approximation of one vessel is moulded around the hull of a different vessel. After that, some sample computations are executed in Hydrostar, including a grid convergence study to determine the dependence of the results on the panel density.
fields of knowledge: Manoeuvreergedrag � Open Water � Numerieke berekeningen
Final version
WL2020RPA032_1
III
Beheer en Onderhoud CFD modellen: Hull grid generation for potential panel methods using Blender
Contents Abstract................................................................................................................... III List of Figures ............................................................................................................ VI List of Tables ............................................................................................................. VII List of Listings ............................................................................................................ VIII 1 Introduction ......................................................................................................... 1.1 Grid creation methodologies.................................................................................. 1.2 Hydrostar coordinate system..................................................................................
1 1 2
2 Mesh creation ....................................................................................................... 2.1 Creating a panel discretisation from scratch ................................................................ 2.1.1 Remeshing the triangulation ............................................................................. 2.1.2 Shrinkwrapping the remeshed barge onto the triangulation ......................................... 2.1.3 Mesh output to Hydrostar format ....................................................................... 2.2 Morphing an existing panel geometry to another hull shape ............................................. 2.3 Workflow improvements using Blender 2.8 .................................................................
3 3 3 4 6 7 9
3 KCS Sample Computations ......................................................................................... 10 3.1 Hull geometry ................................................................................................... 10 3.2 Convergence study ............................................................................................. 10 4 Conclusions .......................................................................................................... 16 A1 Hydrostar input files for coarsest mesh .......................................................................... A1
Final version
WL2020RPA032_1
V
Beheer en Onderhoud CFD modellen: Hull grid generation for potential panel methods using Blender
List of Figures Figure 1 Figure 2 Figure 3 Figure 4 Figure 5 Figure 6 Figure 7 Figure 8 Figure 9 Figure 10 Figure 11 Figure 12 Figure 13 Figure 14 Figure 15 Figure 16 Figure 17 Figure 18 Figure 19 Figure 20 Figure 21 Figure 22 Figure 23 Figure 24 Figure 25 Figure 26 Figure 27 Figure 28 Figure 29 Figure 30
VI
Second variant of the D0M barge geometry.............................................................. 1 Hull geometries of container vessels C0W (top) and C0D (bottom). .................................. 2 Hull triangulation created in HEXPRESS. ................................................................. 3 Rescale the mesh in Edit mode with a factor 0.5. ...................................................... 3 Add Remesh modifier to STL geometry. ................................................................. 4 Change Remesh modifier settings. ....................................................................... 4 Hull geometry after applying the Remesh modifier..................................................... 4 Comparison of remeshed barge hull with the original triangulation. ................................ 5 Remove half the mesh (left) and scale vertices laterally to set the centreline (right). ............. 5 Activating the Mirror modifier. ........................................................................... 5 Activating the Shrinkwrap modifier on the slightly scaled mesh...................................... 5 Mesh after some manual editing and refining near sharp edges. .................................... 6 Quadrilateral faces replaced by two triangles in areas with large distortions in an example hull geometry shipped with Hydrostar. .................................................................. 6 Mesh analysis in Blender showing severely distorted quadrilateral faces. .......................... 7 Length difference between the source and target geometries. ...................................... 7 Application of the shrinkwrap modifier on the target hull. ........................................... 8 Application of the shrinkwrap modifier: adaptation of the bow to fit the target geometry better. 8 Differences in hull width near the stern (left) and adapted geometry (right). ...................... 8 The newly created panel discretisation for hull C0D (top) based on the panel discretisation of hull C0W (bottom).......................................................................................... 9 Improvements in the Blender 2.8 sculpt mode remesher (bottom) as compared to the result of the remesh modifier (top) ............................................................................. 9 Holes in the STL discretisation of the KCS hull near the connection of the bulbuous bow with the hull....................................................................................................... 10 Four panel discretisations of the hull of the KCS........................................................ 11 Convergence of the longitudinal centre of gravity as a function of the number of panels of the discretisation. .......................................................................................... 11 Side view of the coarse hull of the KCS cut at a draft of 10.8 m. ...................................... 12 Convergence study ‐ Added mass for surge (left), sway (center) and pitch (right). ................. 13 Convergence study ‐ Wave Damping for surge (left), sway (center) and pitch (right). ............. 13 Convergence study ‐ Wave excitation forces for surge (left), sway (center) and pitch (right). .... 13 Convergence study ‐ Drift Forces for surge (left), sway (center) and yaw (right), near field method. ..................................................................................................... 14 Convergence study ‐ Drift Forces for surge (left), sway (center) and yaw (right), far field method. 14 Computing times as a function of the problem size on a single core. ................................ 15
WL2020RPA032_1
Final version
Beheer en Onderhoud CFD modellen: Hull grid generation for potential panel methods using Blender
List of Tables Table 1 Table 2
Number of panels of one side of the hull, relative panel sizes and average aspect ratio. ........... 12 Computing times of the different computations for each of the four meshes........................ 14
Final version
WL2020RPA032_1
VII
Beheer en Onderhoud CFD modellen: Hull grid generation for potential panel methods using Blender
List of Listings Listing 1 Listing 2 Listing 3 Listing 4 Listing 5 Listing 6
VIII
Input file to be used with the hscut command for the coarsest mesh. .......................... Hydrostar project file C04_m1.hsg for computations with the coarsest KCS mesh. ........... Hydrostar input data for the radiation and diffraction computation. ............................ Hydrostar input data for the motion computation. ................................................ Hydrostar input data for the second�order drift computations in uni�directional waves. ..... Hydrostar input data for the construction of transfer functions. .................................
WL2020RPA032_1
12 A1 A1 A2 A2 A3
Final version
Beheer en Onderhoud CFD modellen: Hull grid generation for potential panel methods using Blender
1 Introduction 1.1
Grid creation methodologies
This report shows two methodologies using Blender1 to generate panel discretisations of ship hulls for use in software such as ROPES and Hydrostar that are based on potential theory. The first method generates a panel discretisation from scratch while the second one uses an existing panel discretisation of a vessel and transforms that into the shape of another vessel. Both methods make use of modifiers in Blenders. The first one uses the Remesh modifier to create a coarse (and approximate) panel discretisation from the input STL geometry. Afterwards, the Shrinkwrap modifier is used to stick all vertices of the panels to the STL geometry. This latter modifier is also used in the second method to mold a panel discretisation from one hull geometry into the geometry of a new hull. In addition to these two modifiers, the mirror modifier can be used to im‐ prove efficiency by only working on one half of the hull geometry: the second half is automatically created by mirroring all vertices in the y‐direction. All methods require an accurate (triangular) STL representation of the hull to be meshed. Normally, STL geo‐ metries are generated by the author in Hexpress from a Parasolid geometry that was created in CADFix using an IGES CAD model2 . The STL geometries that are created with this procedure are guaranteed to be watertight. This method is preferred by the author because it allows one to use the resulting CAD models for all purposes such as performing CFD computations. However, when no STL geometry can be generated from a CFD CAD model because the hull was never used in CFD (no Parasolid available), Rhino can also be used to create an STL approximation from an IGES or 3dm model (which is likely sufficient for the purpose of using it as a basis for creating a panel geometry). There is no guarantee that the resulting triangulation is watertight, so the STL may not be useful for future CFD computations. For the current report, two hull geometries will be used: a barge (Fig3 . 1) will be used to illustrated the first method and two container vessels (Fig. 2) are used to demonstrate the second method. Figure 1 – Second variant of the D0M barge geometry.
1
Blender version 2.79 is used in the current research. In the future, newer versions will be used. The need to go from IGES to CADFix is caused by the limited import options of our CADFix license: it can only import IGES files. This is generally not an issue because Rhino can convert 3dm files to IGES format without problems. 3 Second variant of D0M on the wiki: https://wlwiki.vlaanderen.be/wiki/display/wlwiki/D0M 2
Final version
WL2020RPA032_1
1
Beheer en Onderhoud CFD modellen: Hull grid generation for potential panel methods using Blender Figure 2 – Hull geometries of container vessels C0W (top) and C0D (bottom).
1.2
Hydrostar coordinate system
Hydrostar uses the following coordinate system: • Axis Ox points in the forward direction; • Axis Oy points towards port side; • Axis Oz is positive upward. For Blender, this is very convenient because it uses exactly the same convention for the vertical axis: Oz points upward. It is recommended to create meshes for Hydrostar in Blender with the bottom of the hull at � = 0 m. This makes it easy to adjust the meshes for different drafts using the hscut tool of Hydrostar, which cuts the mesh at the requested draft and defines the vertical origin at the water surface. An example of the use of this tool will be given in chapter 3.
2
WL2020RPA032_1
Final version
Beheer en Onderhoud CFD modellen: Hull grid generation for potential panel methods using Blender
2 Mesh creation 2.1
Creating a panel discretisation from scratch
When no suitable discretisation (i.e., one with a topology that is similar to the target hull geometry) is available, with this method, one starts from an accurate STL discretisation of the hull geometry. For this case, it was generated from the Parasolid model in HEXPRESS and is shown in Fig. 3. Figure 3 – Hull triangulation created in HEXPRESS.
2.1.1
Remeshing the triangulation
For this method, it is useful to duplicate the geometry of the barge before starting as the modifier will be applied which replaces the original STL geometry with new panel geometry. In object mode, select the barge geometry, SHIFT+D to duplicate and ESC to cancel moving the geometry. Type M 2 to move the duplicate to the second layer. Activate both the first and second layer. In order to create panels on flat surfaces that are twice as long as they are wide or high, in Edit mode (TAB) the triangulation is scaled down with a factor two (Fig. 4). After remeshing, the geometry will be scaled up again with a factor two (also in Edit mode). Figure 4 – Rescale the mesh in Edit mode with a factor 0.5.
In the properties editor (modifier panel), activate a Remesh modifier (Fig. 5) and change the default settings as shown in Fig. 6. Note that the scale was change to 0.99 and the sharpness was decreased to −1.0 (the actual value does not matter, as long as it is negative). For this case, the octree depth is increased from its default value of 4 to 5. At this point, the Remesh modifier is applied (press the Apply button in the panel of the modifier). This action replaces the original geometry with the approximate geometry created with the Remesh modifier, see Fig. 7)
Final version
WL2020RPA032_1
3
Beheer en Onderhoud CFD modellen: Hull grid generation for potential panel methods using Blender Figure 5 – Add Remesh modifier to STL geometry.
Figure 6 – Change Remesh modifier settings.
Figure 7 – Hull geometry after applying the Remesh modifier.
If one now compares the remeshed barge hull to the original triangulation (after scaling the mesh in the X‐ direction with a factor two, Fig. 8), one can see that at sharp edges, the quadrilaterals do no align with the triangulation. This can be fixed by using the shrinkwrap modifier on the remeshed barge with the original triangulation as target. For this to work, the remeshed barge vertices should be located on the outside of the original triangulation so that the mesh can be shrinkwrapped onto the triangulation. 2.1.2
Shrinkwrapping the remeshed barge onto the triangulation
In order to simplify this process, one half of the mesh is removed and the vertex edge loop closest to the lateral mirror plane is placed exactly at the symmetry plane (Fig. 9). The Mirror modifier is applied to the remaining geometry (y‐direction) such that only one half of the mesh needs to be edited (Fig. 10). The mesh is scaled up slightly to ensure that most of the vertices are on the outside of the triangulation. Then the Shrinkwrap modifier is activated with as target the STL triangulation (Fig. 11). At this point, the resulting grid is a reasonable approximation of the reference triangulation and could be used in potential computations. Only near sharp edges, the grid deviates from the reference because it is too coarse there. This has to be improved by some
4
WL2020RPA032_1
Final version
Beheer en Onderhoud CFD modellen: Hull grid generation for potential panel methods using Blender mesh editing actions using e.g. the Loop cut and slide tool and manually moving vertices to better places. After a while, the mesh as shown in Fig. 12 is obtained. Figure 8 – Comparison of remeshed barge hull with the original triangulation.
Figure 9 – Remove half the mesh (left) and scale vertices laterally to set the centreline (right).
Figure 10 – Activating the Mirror modifier.
Figure 11 – Activating the Shrinkwrap modifier on the slightly scaled mesh.
Final version
WL2020RPA032_1
5
Beheer en Onderhoud CFD modellen: Hull grid generation for potential panel methods using Blender Figure 12 – Mesh after some manual editing and refining near sharp edges.
2.1.3
Mesh output to Hydrostar format
A Python script was written to output the grid directly in Hydrostar format from Blender. The file format adopted by Bureau Veritas is very similar to the file format as used in ROPES: a header is followed by a list of coordinates (one per line) and a list of vertex indices for each face (one per line). Multiple vertex lists and corresponding faces index lists are supported. One of the main differences between Hydrostar and ROPES is that the former allows faces with both three and four edges. This is achieved by replicating the index of the third vertex at the fourth position. In the example geometries that accompany the software, triangles are mostly used in places where quadrilateral faces are not planar (or, far from planar). This occurs most often at doubly‐curved regions where large changes in curvature happen, such as near the bow and stern of ships (see for example Fig. 13). A feature that automatically converts quadrilaterals into two triangles can improve the mesh quality while keeping the face count as low as possible (one could triangulate the whole mesh, but then, computations take at least four times as long). This was implemented in the export script as a user option with a single parameter (angle threshold) above which faces are triangulated. For the barge used here, five quadrilateral faces are converted into triangles when the threshold is set to 10°. To check in Blender for the faces with most distortion, the Mesh analysis tool in the numerical tab can be activated. Faces whose angular distortion falls between the lower and upper limit are coloured (red values occur near the upper limit, while blue values correspond to values near the lower limit, see Fig. 14) In addition to exporting meshes to Hydrostar format, the reverse operation was also added: importing existing Hydrostar meshes in Blender is now also possible.
Figure 13 – Quadrilateral faces replaced by two triangles in areas with large distortions in an example hull geometry shipped with Hydrostar.
6
WL2020RPA032_1
Final version
Beheer en Onderhoud CFD modellen: Hull grid generation for potential panel methods using Blender Figure 14 – Mesh analysis in Blender showing severely distorted quadrilateral faces.
2.2
Morphing an existing panel geometry to another hull shape
In this method, an existing hull discretisation consisting of quadrilateral (and possibly some triangular) faces is used and morphed around another (but similar) hull geometry for which a panel discretisation is required. This method works best if the topology of both hulls is similar: if the target geometry has a bulbous bow, the source mesh should have one as well. Idem for the propellers: a target geometry with two propellers will be difficult to create from a source mesh of a hull with a single propeller. The hull geometries used for this demonstration are C0W and C0D, shown earlier in Fig. 2. When importing both, it is clear that the target STL geometry is significantly shorter than the source panel geometry (Fig. 15). Figure 15 – Length difference between the source and target geometries.
Application of the shrinkwrap modifier on the target panel geometry (Fig. 16) shows that this modifier did not steal its name: in places where the distance between the source and target is too large, the resulting surface looks like a shrinkwrapped object. Especially the bow and stern need some manual work. This is done by scaling and moving the mesh backwards towards the bulbeous bow of the target geometry. Proportional editing is used often for this task. The initial state, three intermediate states and a geometry that is close to the final shape are shown in Fig. 17. Something similar needs to be done for the stern, and by extension, the complete lateral side of the hull. The target STL is significantly more narrow than the source panel geometry (see e.g. Fig. 18). The complete process will not be described here, but it involves moving vertices manually (with or without proportional editing turned on) and applying the shrinkwrap modifier more than once. The final result is shown in Fig. 19, where the newly created mesh is shown at the top and the target mesh is shown below (in orange). Topologically speaking, these grids are very similar.
Final version
WL2020RPA032_1
7
Beheer en Onderhoud CFD modellen: Hull grid generation for potential panel methods using Blender Figure 16 – Application of the shrinkwrap modifier on the target hull.
Figure 17 – Application of the shrinkwrap modifier: adaptation of the bow to fit the target geometry better.
Figure 18 – Differences in hull width near the stern (left) and adapted geometry (right).
8
WL2020RPA032_1
Final version
Beheer en Onderhoud CFD modellen: Hull grid generation for potential panel methods using Blender Figure 19 – The newly created panel discretisation for hull C0D (top) based on the panel discretisation of hull C0W (bottom).
2.3
Workflow improvements using Blender 2.8
Blender 2.8 boasts a completely revamped user interface as compared to the Blender 2.7x series. Some of the tools used in the current chapter to create quadrilateral meshes have been improved, or new tools have been added with better functionality. One of these is the remesh tool in sculpt mode. For potential panel methods, this tool can create better quadrilateral mesh approximations of an input geometry than the remesh modifier. The latter one contains poles that are removed automatically with the sculpt remesher (see Fig. 20). Neither one of the resulting meshes is perfect, but using the sculpt tool remesher does reduce the time to create a good quality mesh. The sculpt remesh tool also lets the user set the size of the voxels in absolute units. Figure 20 – Improvements in the Blender 2.8 sculpt mode remesher (bottom) as compared to the result of the remesh modifier (top)
Final version
WL2020RPA032_1
9
Beheer en Onderhoud CFD modellen: Hull grid generation for potential panel methods using Blender
3 KCS Sample Computations 3.1
Hull geometry
A mesh has been generated from scratch for the hull of the KCS (C04) with the method as detailed earlier in this report. The STL geometry was generated from the Rhino file as stored in the towing tank database. Fig. 21 shows holes in the discretisation near the connection of the bulbuous bow with the hull. These are caused by adjacent surfaces in the hull that do not fully match. From this hull discretisation with 1757 panels, two coarser meshes were generated using the Decimate modifier in Un�Subdivide mode with an even number of iterations (2 and 4). Due to the less�than�perfect topology of the mesh, the coarser variants need some cleaning after applying the decimate modifier, especially near the open edges of the meshes. One finer grid was generated by subdividing each face in each direction once. This means that every quadrilateral face is divided in four smaller quadrilateral faces and every triangle is divided in four triangles. For this particular case, the finest grid contains eight triangles that are all located above the waterline. The resulting meshes are shown in Fig. 22, with coarsest on top and finest at the bottom. These starboard hull sides contain – from top to bottom – 172, 486, 1757 and 7043 panels. Figure 21 – Holes in the STL discretisation of the KCS hull near the connection of the bulbuous bow with the hull.
Loading these geometries in Hydrostar reports the position of the centre of buoyancy in the terminal. The reported values of the longitudinal centre of gravity were divided by the reference length đ??żđ?‘?đ?‘? = 230.0 m and these are shown in Fig. 23. There is a large difference between the value for the coarsest grid and three finer grids: for the latter, the centre of buoyancy lies before the midship location, while for the coarsest grid, it lies aft of the midship location. It is likely that results computed with the coarsest grid will differ significantly from results obtained with the finer grids. Also, results computed with the two finest meshes might differ very little, but this will have to be verified.
3.2
Convergence study
In order to investigate the applicability of the generated meshes, a convergence study was performed by using Hydrostar. As the meshes represent the complete hull geometry and Hydrostar requires the submerged part of the hull for computations, it was necessary to cut the meshes at the required draft. This was performed by using the command hscut of Hydorstar. This function needs an input file containing the information of the name of the Hydrostar mesh (*.hst) to be cut, the new name of the cut mesh and the draft (and roll and trim
10
WL2020RPA032_1
Final version
Beheer en Onderhoud CFD modellen: Hull grid generation for potential panel methods using Blender Figure 22 – Four panel discretisations of the hull of the KCS.
Figure 23 – Convergence of the longitudinal centre of gravity as a function of the number of panels of the discretisation.
0.5075
x CoB/Lpp
0.5050 0.5025 0.5000 0.4975 0.4950 103 number of panels angles if nonzero). The command runs from the command line by using: >> hscut input.cut An example of the input.cut file is shown in Listing 1. The file can be dragged into the Hydrostar GUI (HStarICE) and executed (by pressing F11) from there as well. The viewer will automatically show the mesh cut at the requested waterline with the panels above the waterline shown transparently (see Fig. 24 for an example). An overview of the number of panels of the meshes (both the complete and submerged parts) are shown in the Table 1 where also, the average, minimum and maximum panel sizes of the complete (uncut) hull are shown together with the average aspect ratio of the panels. These surface area were made dimenâ€? sionless by dividing the face areas with the submerged lateral hull area computed from the length between perpendiculars and the draft (đ??żđ?‘?đ?‘? â‹… đ??ˇ).
Final version
WL2020RPA032_1
11
Beheer en Onderhoud CFD modellen: Hull grid generation for potential panel methods using Blender Listing 1 – Input file to be used with the hscut command for the coarsest mesh.
MESH_IN C04_m1.hst MESH_OUT C04_m1_T108.hst 10.8 ENDMESH_OUT
Figure 24 – Side view of the coarse hull of the KCS cut at a draft of 10.8 m.
Table 1 – Number of panels of one side of the hull, relative panel sizes and average aspect ratio.
Mesh Coarsest Coarse Medium Fine
Complete hull
Submerged hull
����
����
����
Ađ?‘Žđ?‘Łđ?‘”
172 486 1757 7043
148 379 1282 4982
1.62 Ă— 10−2 5.78 Ă— 10−3 1.60 Ă— 10−3 4.00 Ă— 10−4
7.19 Ă— 10−5 4.41 Ă— 10−5 6.23 Ă— 10−5 4.93 Ă— 10−6
4.78 Ă— 10−2 1.96 Ă— 10−2 5.64 Ă— 10−3 1.47 Ă— 10−3
2.97 2.33 2.23 2.23
Hydrostar was configured to compute two headings (0° and 90°) and a range of frequencies from 0.1 to 2 rad/s in steps of 0.05 rad/s with zero speed. Computations of added mass, damping coefficients, wave excitation forces, response in waves (RAO) and second order forces were performed. The results of the computations of these variables are presented in Figs. 25 to 29. As is clear from the graphs, results computed with the coarsest mesh differ significantly from results computed with the three finer meshes especially for higher frequencies. The wave damping plot (Fig. 26) shows that the coarse mesh results in small differences with both the medium and fine meshes. In the graphs of the wave excitation forces (Fig. 27), the curves of both the medium and fine mesh are practically the same. Figs. 28 and 29 show the calculations of drift forces. As in the previous plots, the coarsest and coarse meshes differs significantly from the medium and fine meshes. These two last meshes give almost identical results. For panel sizes of hulls, Hydrostar recommends to have panels smaller than 1/8 of the length of the shortest wave, which occurs at the highest wave frequency that is computed. The shortest wavelength is computed using 2đ?œ‹đ?‘” đ?œ†= 2 , (1) đ?œ” where đ?‘” is the acceleration due to gravity and đ?œ” is the wave frequency for deep water. For this particular case, đ??ż is around 15.4 m. This means that panels should be generally smaller than 1.926 m. Converting the values of the average panel sizes in Table 1 to dimensional numbers, the following values are found: 40.2 m2 , 14.4 m2 , 3.97 m2 and 1.00 m2 for the coarsest to finest meshes. Assuming square panels (which is an approximation), the edge lengths are simply the square root of the panels surface areas: 6.34 m, 3.79 m, 1.99 m and 1 m. This means that strictly speaking, only the finest mesh is sufficient for the complete range of frequencies. Close inspection of the results shows that graphs of the fine and medium meshes only diverge for the higher freâ€? quencies and that the differences are very small. It is hence safe to use the medium meshes for computations up to a wave encounter frequency of 2 rad/s. One of the biggest disadvantages of Nâ€?body problems such as potential panel methods is that the computing
12
WL2020RPA032_1
Final version
Beheer en Onderhoud CFD modellen: Hull grid generation for potential panel methods using Blender times scale with the square of the number of panels. This means that a quadrupling of the number of panels will increase the computing times 16‐fold. For the current grid convergence study, the computing times for each part of the computation were recorded and these are shown in Table 2. It is clear that the significant extra time required to finish the computations on the fine grid are not worth it, given that the differences between the results on the medium and fine grid are very small. Plotting the data on a double logarithmic scale gives the result as displayed in Fig. 30. This figure appears to show that the order of the algorithm increases with increasing problem size: the slope of the line increases with the problem size. Normally, for this type of problem, the slope should be (nearly) constant. Apart from the fact that the computations were run on a laptop computer that was also busy with other tasks that may affect the resources allocated to the Hydrostar computation, the authors do not have an explanation for this behaviour. Figure 25 – Convergence study ‐ Added mass for surge (left), sway (center) and pitch (right).
Figure 26 – Convergence study ‐ Wave Damping for surge (left), sway (center) and pitch (right).
Figure 27 – Convergence study ‐ Wave excitation forces for surge (left), sway (center) and pitch (right).
Final version
WL2020RPA032_1
13
Beheer en Onderhoud CFD modellen: Hull grid generation for potential panel methods using Blender Figure 28 – Convergence study ‐ Drift Forces for surge (left), sway (center) and yaw (right), near field method.
Figure 29 – Convergence study ‐ Drift Forces for surge (left), sway (center) and yaw (right), far field method.
Table 2 – Computing times of the different computations for each of the four meshes.
coarsest coarse medium fine
14
hull, s
rdf, s
mcn, s
dft, s
rao, s
total, h:mm:ss
0.21 0.31 0.95 6.35
8.64 23.71 160.14 3886.86
1.89 3.24 3.62 9.08
3.14 11.44 49.59 715.72
1.78 2.62 1.54 1.73
0:00:16 0:00:41 0:03:36 1:17:00
WL2020RPA032_1
Final version
Beheer en Onderhoud CFD modellen: Hull grid generation for potential panel methods using Blender Figure 30 – Computing times as a function of the problem size on a single core.
computing time, s
103
hslec hsrdf hsmcn hsdft hsrao totals
102
101
100
103 number of panels
Final version
WL2020RPA032_1
15
Beheer en Onderhoud CFD modellen: Hull grid generation for potential panel methods using Blender
4 Conclusions This report has presented details of two methodologies to generate panel geometries of ship hulls for used in computer programs based on potential theory such as Hydrostar and ROPES. Both methods require a tri� angulation of the hull geometry, the first method creates the panel geometry from scratch, while the second method uses an existing panel discretisation and moulds it around a different hull shape. The panel geomet� ries are created in Blender, an open�source 3D content creation tool. The geometries can be exported from Blender in Hydrotar format using a Python script. In addition, existing Hydrostar geometries can be imported as well. For the KCS hull, a grid convergence study has been executed in waves with zero speed for a range of wave frequencies using four panel geometries. The results show that the coarsest mesh (with only 148 panels below the waterline) is too coarse for use in Hydrostar: significant differences are observed in the output for the full range of wave frequencies. Results are better with the coarse mesh (with 379 panels below the waterline), but results still diverge for the higher half of the frequency range. It is only for the two finest meshes (with respectively 1282 and 4982 panels below the waterline) that convergence is good. Both methods give almost identical results. Computations executed with the finest mesh do take more than one hour when executed on a laptop with a single core while the computations on the medium mesh take less than four minutes, which is factor 22 times as short. Bear in mind that computations were only executed for two headings. Depending on the problem, it could be necessary to run computations for more headings which will increase computing times even more. For this case, it is both safe (in terms of accuracy) and beneficial (in terms of computing time) to use the medium panel geometry with 1282 panels below the waterline. The report also shows that the same conclusion could be drawn from the graph of the longitudinal centre of buoyancy as a function of the mesh size without executing actual computations. There, it was found that for the two finest meshes, the computed longitudinal centre of buoyancy differs very little while the location of the centre of buoyancy computed with the coarsest grid differs significantly from the values computed with the three finer meshes.
16
WL2020RPA032_1
Final version
Beheer en Onderhoud CFD modellen: Hull grid generation for potential panel methods using Blender
A1 Hydrostar input files for coarsest mesh For the coarsest mesh, the input files to run the computations are saved in the Hydrostar project file C0_m1.hsg shown in Listing 2. Listing 2 – Hydrostar project file C04_m1.hsg for computations with the coarsest KCS mesh.
<?xml version="1.0" ?> <hydrostar_project> <InputFiles Name="C04_m1_T108.hst"/> <InputFiles Name="C04.rdf"/> <InputFiles Name="C04.mcn"/> <InputFiles Name="C04.dft"/> <InputFiles Name="C04.rao"/> </hydrostar_project>
This file refers to the different files used for the computations. The first one (C04_m1_T108.hst) is the geo‐ metry file that was created with the hscut command as discussed before. C04.rdf (see Listing 3) contains the input data for the radiation and diffraction computation. The third one (C04.mcn, Listing 4) is used for mo‐ tion computations and the fourth one (C04.dft) is used for second‐order drift computations in uni‐directional waves, see Listing 5. Lastly C04.rao constructs the transfer functions of the motions, velocities, accelerations and second order loads (Listing 6). Listing 3 – Hydrostar input data for the radiation and diffraction computation.
#Name of the output file FILENAME rd1 #Range of frequency FREQUENCY TYPE 2 WMIN 0.05 WMAX 2.0 WSTP 0.05 ENDFREQUENCY #Range of heading HEADING TYPE 2 HMIN 0.0 HMAX 90.0 HSTP 90.0 ENDHEADING #Waterdepth WATERDEPTH
INF
SPEEDS TYPE 0 1 0.0 ENDSPEEDS ENDFILE
Final version
WL2020RPA032_1
A1
Beheer en Onderhoud CFD modellen: Hull grid generation for potential panel methods using Blender Listing 4 – Hydrostar input data for the motion computation.
#Diffraction results to use FILENAME rd1 #Mass of the body (in kg) MASS_BODY 1 5.20367E+07 #Center of gravity (in mesh reference) COGPOINT_BODY 1 111.3131 0.000 #Rotational inertia GYRADIUS_BODY 1
15.750
69.147
3.476
70.888
0.000
3.523
0.000
#Additional damping in roll LINVISCOUSDAMPING 1 4.0 INFFREQ ENDFILE
Listing 5 – Hydrostar input data for the second‐order drift computations in uni‐directional waves.
HSKDTYPE
SOURCE
NFORMULE FFORMULE MFORMULE
Yes Yes No
ENDFILE
A2
WL2020RPA032_1
Final version
Beheer en Onderhoud CFD modellen: Hull grid generation for potential panel methods using Blender Listing 6 – Hydrostar input data for the construction of transfer functions.
#Motion GSWAY GSURGE GHEAVE GROLL GPITCH GYAW
BODY BODY BODY BODY BODY BODY
1 1 1 1 1 1
FILE FILE FILE FILE FILE FILE
sway.rao surge.rao heave.rao roll.rao pitch.rao yaw.rao
#Added mass and damping CA BODY 1 FILE ca.rao TERM 11 22 33 44 55 66 CM BODY 1 FILE cm.rao TERM 11 22 33 44 55 66 #Drift forces (HSdft) DRIFTFX BODY 1 FILE driftfxNF.rao DRIFTFY BODY 1 FILE driftfyNF.rao DRIFTMZ BODY 1 FILE driftmzNF.rao
PRE PRE PRE
DRIFTFX BODY 1 FILE driftfxFF.rao DRIFTFY BODY 1 FILE driftfyFF.rao DRIFTMZ BODY 1 FILE driftmzFF.rao
MOM MOM MOM
#Full QTF (hsqtf) #QTFFX BODY 1 FILE #QTFFY BODY 1 FILE #QTFFZ BODY 1 FILE #QTFMX BODY 1 FILE #QTFMY BODY 1 FILE #QTFMZ BODY 1 FILE
qtf_fx.qtf qtf_fy.qtf qtf_fz.qtf qtf_mx.qtf qtf_my.qtf qtf_mz.qtf
#Internal loads (HSwld) #SECTMY SECT 10 BODY 1 FILE my_10.rao #SECTMZ SECT 10 BODY 1 FILE mz_10.rao
Final version
WL2020RPA032_1
A3
DEPARTMENT MOBILITY & PUBLIC WORKS Flanders hydraulics Research Berchemlei 115, 2140 Antwerp T +32 (0)3 224 60 35 F +32 (0)3 224 60 36 waterbouwkundiglabo@vlaanderen.be www.flandershydraulicsresearch.be