100% found this document useful (1 vote)
179 views128 pages

Shipflow Tutorials - Basic

This tutorial demonstrates how to set up a new SHIPFLOW case starting from an existing IGES file of a container ship hull form. The key steps are: 1. Importing the IGES file of the KCS container ship hull into a new SHIPFLOW project. 2. Creating a surface group and SHIPFLOW setup to define the computational domain. 3. Configuring the case for a free-surface potential flow simulation at Froude number 0.25 using the XPAN program. 4. Starting the computation and monitoring progress. 5. Examining the results including the wave pattern visualization and detailed output files.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
179 views128 pages

Shipflow Tutorials - Basic

This tutorial demonstrates how to set up a new SHIPFLOW case starting from an existing IGES file of a container ship hull form. The key steps are: 1. Importing the IGES file of the KCS container ship hull into a new SHIPFLOW project. 2. Creating a surface group and SHIPFLOW setup to define the computational domain. 3. Configuring the case for a free-surface potential flow simulation at Froude number 0.25 using the XPAN program. 4. Starting the computation and monitoring progress. 5. Examining the results including the wave pattern visualization and detailed output files.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 128

Revision 14, 2014-05-07

SHIPFLOW DESIGN
Tutorials
BASIC

2(128)

Table of Contents
Introduction to SHIPFLOW DESIGN environment........................................................................5
Tutorial 1 part 1 Setting up new case directly from IGES file.....................................................7
Tutorial 1 part 2 Starting and monitoring...................................................................................12
Tutorial 1 part 3 Result post processing.....................................................................................13
Tutorial 1 part 4 Additional information for IGES import.........................................................16
Tutorial 1 part 5 Import of a configuration.................................................................................17
Tutorial 1 part 6 Setting up new case directly from offset file...................................................19
Tutorial 1 part 7 Starting and monitoring...................................................................................25
Tutorial 1 part 8 Result post processing.....................................................................................26
Tutorial 2 part 1 Creating Design Variants.................................................................................29
Tutorial 2 part 2 Speed variation using Ensemble investigation................................................32
Tutorial 2 part 3 Importing a command file and modifying the panellization............................37
Tutorial 2 part 4 A mesh refinement study..................................................................................44
Tutorial 3 part 1 Importing a command file and running XPAN................................................47
Tutorial 3 part 2 Hydrostatics calculations.................................................................................50
Tutorial 3 part 3 Hull form modification using Lackenby shift..................................................54
Tutorial 3 part 4 Optimization of the forebody...........................................................................57
Tutorial 3 part 5 Creating manual variants of the design............................................................65
Tutorial 3 part 6 Export of optimized geometry to IGES...........................................................69
Tutorial 4 part 1 Twin-skeg example IGES.............................................................................72
Tutorial 5 part 1 Manual offset generation.................................................................................76
Tutorial 5 part 2 Creating and exporting offset data ..................................................................79
Tutorial 5 part 3 Method for quick offset file generation...........................................................92
Tutorial 6 part 1 XBOUND........................................................................................................94
Tutorial 7 part 1 Automatic grid generation with XGRID..........................................................99
Automatic grid generation FINE, MEDIUM and COARSE grids......................................103
Automatic grid generation Global approach........................................................................104
Automatic grid generation One and two sides.....................................................................105
Automatic grid generation Wet transom grid.......................................................................107
Tutorial 7 part 2 Automatic grid generation for Twin-skeg hulls.............................................109
ZONAL...................................................................................................................................109
GLOBAL.................................................................................................................................110
Tutorial 7 part 3 Viscous free-surface.......................................................................................112
Running a very coarse vof example........................................................................................115
Tutorial 7 part 4 XGRID manual control..................................................................................117
Tutorial 7 part 5 XGRID manual control VOF cases............................................................119
Tutorial 7 part 6: XCHAP post-processing..................................................................................122
Cutting plane, contour and vector plots..................................................................................122
Trace and display streamlines.................................................................................................124
Visualize the convergence history of XCHAP........................................................................124
Visualization VOF...................................................................................................................125
Tutorial 7 part 7 XCHAP Rudder.............................................................................................127

3(128)

4(128)

Introduction to SHIPFLOW DESIGN environment

First start of the SHIPFLOW Design application (Windows OS)


START > All Programs > FLOWTECH > SHIPFLOW x.x.xx > Shipflow Design x.x.xx

Workspaces
Menu

Object
Tree

Object
Editor

Documentation browser

3D View tab

Documentation browser /
3D View

Console

5(128)

Customized workspace

Saved custom workspace

Object Tree

3D View

Object Editor

6(128)

Tutorial 1 part 1 Setting up new case directly from IGES file


This tutorial takes the user through necessary steps to compute wave pattern and resistance for a
container ship. Part 1 of the tutorial shows how to set up a new SHIPFLOW project starting from an
existing IGES file. The XPAN module is used to obtain the results and the default values are used
where possible.
Ship data

KCS (Korean Container Ship), IGES file: kcs_g2010.igs

Lpp 230m

Draft 10.8m

Design speed Fn = 0.25, Rn=1e6


Computations:

Free surface with free sinkage and trim

Open New Project


Import kcs_g2010.igs IGES file from C:\FLOWTECH\SHIPFLOW5.x.x-x\examples
directory.

A file selection window will then appear in which the user can navigate to and select the
IGES file. Thereafter a window for selecting the IGES entities pops up. In this case accept
all entities that are pre-selected by pushing the OK button. The warnings about unsupported
entities that appears in the Console Widget can be ignored in this example.

7(128)

Change the main view to 3Dview by clicking on the tab


. Select the Zoom extent
button in the lower left corner of the 3DView window, or use the short cut F10, to adjust

the view of the hull surface.


Thereafter try the short commands Control+X, Control+Y and Control+Z or click on the
corresponding buttons in the lower part of the 3Dview window to change the view direction.
Try the isometric view options as well.
Save the project in your working directory from the File menu or using the short cut Cntr+s

Select imported surfaces to be used in computations and create Surface Group

Selection
box

8(128)

Create SHIPFLOW setup

After selecting SHIPFLOW from


Connections > Setups menu.
Configuration and Computation will
be created.

9(128)

Default set of program parametres will be


visible in the object tree under config
node.

Configure the case


Add offset configuration to xflow and set it up according to given instructions:
Select xflow in the Object Tree
Select offset in the xflow Object Editor
Push the + button to add the offset configuration in the Object Tree
Similarly, select and add iges, lpp and zori in the offset editor
Choose the CAD tab in the Object Tree. Drag the surface group object grp1 into the
Iges box. Complete the command by filling in the remaining part of the command:
grp1.exportIGES(kcs_iges.igs).
Tip: Type Cntl+Space to auto complete a command.
Fill in the remaining data for Lpp and the draft Zori.

Complete the configuration such that SHIPFLOW will run a free-surface potential flow
simulation at Froude number 0.25.
Select the program command and choose xpan in the roll down menu. Don't forget
to push the add button (+).
Select the vship command and set Fn to 0.25. Add also the Rn (Reynolds number)
from the roll down menu and set it to 1e6.
10(128)

Finally, add the fsflow keyword in the hulltype command. This will instruct XPAN
to include a free-surface. Add also xmdens and set it to coarse in order to make the
computational time shorter.

The configuration is now completed. Save the project and continue to the next section.

11(128)

Tutorial 1 part 2 Starting and monitoring


In order to start the calculations following the instructions below.

Select the Computation object comp in the Object Tree


Press the green arrow button to start the SHIPFLOW run
Check progress in the Task Monitor. It's found on the side bar.

Save the project. This project is used as a starting point in later parts of the tutorial.

12(128)

Tutorial 1 part 3 Result post processing

The computations are finished when the play button turns green again and the Task
Monitor shows the SHIPFLOW message with the start and end of computations times.

The computation result summary is contained in the table available in the Table Viewer tab.

More informations about the computation settings and results can be found in File Viewer
tab under case1_OUTPUT tab. Scroll down to see the complete data.

13(128)

The wave pattern from XPAN is visualised by default in 3DView.

The post-processing tools are available in Object Tree | Connections | Computations &
Results | comp.

14(128)

To change for example the wave pattern visualisation style go to Object Tree |
Connections | Computations & Results | comp | XPAN | Free Surface | XPAN (or click
on the free surface in the 3DView) and in the Object Editor change Presets to Black
isolines on coloured surface.
In a similar way the style can be changed on the hull panels

15(128)

Tutorial 1 part 4 Additional information for IGES import

In case of trimmed surfaces the IGES can be imported directly to the solver bypassing the
GUI. In such case there is no need for importing hull surfaces into the user interface. Instead
give a full path to the IGES file in the offset | Iges parameter.

Absolute path to the file

Create a new project and repeat the previous exercise with this technique.
The IGES surfaces will not be visible in the GUI, but configurations and results are
displayed as usual.
The offset file created during the IGES import can be used for visualizing the hull. How to
import the offsets is explained in another part of the tutorial.

16(128)

Tutorial 1 part 5 Import of a configuration


This tutorial requires that the previous parts 1 to 3 are completed.
The purpose with this tutorial is to show how to import an existing configuration. After completion
the user will know how to start a project from a new IGES file, convert it to an offset file and finally
import a configuration and the offset file for further computations.

Choose the Import Configuration (SHIPFLOW) option in the File menu

Search for the configuration file created in part 2. Select the configuration file in the
SHIPFLOW working folder config_RUN_DIR. This configuration is using the
automatically created offset file.

The configuration in the comp folder is the original configuration with the IGES import.

The user may be required to select the offset file under some circumstances, but mostly the
file can be found automatically.

SHIPFLOW have created an offset file and a configuration file for the offsets during the
conversion process. The program has added additional information regarding offset groups
in the hull command. You can see the different offset groups by selecting them in the
CAD Object Tree tab. The names of these groups can be found in the entries of the hull
command.
The automatically generated configuration file in the RUN_DIR folder contains a command
control. In this case it holds only information about the executable and the working
directory. It's recommended to delete this command before any further usage.

17(128)

Save the project.

18(128)

Tutorial 1 part 6 Setting up new case directly from offset file


This tutorial takes the user through necessary steps to compute wave pattern and resistance for a
tanker ship. Part 1 of the tutorial shows how to set up a new SHIPFLOW project starting from an
existing offset file. The XPAN module is used to obtain the results and the default values are used
where possible.
Ship data

Dyne tanker, offset file: off_dyne3

Lpp 253m

Draft 14.25m

Design speed Fn = 0.165, Rn=1e6


Computations:

Free surface with free sinkage and trim

Import off_dyne3 offset file from /examples directory found in SHIPFLOW installation
folder.

A file selection window will then appear in which the user can navigate to and select the
offset file. Thereafter a window for selecting the offset groups in the offset file pops up. In
this case accept all offset groups that are pre-selected by pushing the OK button.

Change the main view to 3Dview by clicking on the tab


. Select the Zoom extent
button in the lower left corner of the 3DView window to adjust the view of the offsets.
Thereafter try the short commands Control+X, Control+Y and Control+Z or click on the
corresponding buttons in the lower part of the 3Dview window to change the view direction:

Save the project in your working directory

19(128)

Create SHIPFLOW setup from menu Connections > Shipflow.

SHIPFLOW configuration is in the Connections tab of the Object tree

Add xpan to Object Tree | Configurations | config | xflow | program

20(128)

Add offset command to Object Tree | Configurations | config | case1 | xflow

Edit data in Object Tree | Configurations | config | xflow | offset, specify Lpp, xori, and
zori according to ship data
Associate the offset file with the configuration using following command:
SHF_Import_off_dyne3|as_off_dyne3.exportSHF("off_dyne")

Add Shiptype to Object Tree | Configurations | config | xflow | hull and set it to mono.

21(128)

Add xmdens to Object Tree | Configurations | config | xflow | hull and set density
parameter to coarse.

Add fsflow to Object Tree | Configurations | config | xflow | hull

Set speed to Fn = 0.165 in Object Tree | Configurations | config | xflow | vship

Add Rn in Object Tree | Configurations | config | xflow | vship and set it to 1e6.

Add h1gr entry to Object Tree | Configurations | config | xflow | hull and set it to hull
22(128)

Similarily add ogrp entry and set it to stern

Add xpan to Object Tree | Configurations | config

Add parall to Object Tree | Configurations | config | xpan and set number of threads to
available cores in your computer CPU

23(128)

Finally select program module to be run. Add xpan to Object Tree | Configurations |
config | xflow | program

Save the project

24(128)

Tutorial 1 part 7 Starting and monitoring


In order to start the calculations follow the instruction below.

Select Object Tree | Connections | Computations & Results | comp and click play icon.

When the computations are running it is possible to follow their progress. For this purpose a tool
called Task Monitor is used which is located on the side bar.

25(128)

Tutorial 1 part 8 Result post processing

The computations are finished when the play button turns green again and the Task
Monitor shows the SHIPFLOW message with the start and end of computations times.

The computation result summary is contained in the table available in the Table Viewer tab.

More informations about the computation settings and results can be found in File Viewer
tab under case1_OUTPUT tab. Scroll down to see the complete data.

The wave pattern from XPAN is visualised by default in 3DView.

26(128)

The post-processing tools are available in Object Tree | Connections | Computations &
Results | comp.

To change for example the wave pattern visualisation style go to Object Tree |
Connections | Computations & Results | comp | XPAN | Free Surface | XPAN (or click
27(128)

on the free surface in the 3DView) and in the Object Editor change Presets to Black
isolines on coloured surface.

In a similar way the style can be changed on the hull panels

28(128)

Tutorial 2 part 1 Creating Design Variants


The purpose with this part of the tutorial is to repeat the case setup with and show how to create
design variants as well as speed variation.
Ship data

Athena ship
Lpp 1
Draft set by geometry
Design speed Fn = 0.632, Rn=1e7

Computations:

Free surface with free sinkage and trim

Variants: with and without dry transom option

Investigations: speed variation

Before the variants are created prepare the base configurations in the way similar to the previous
tutorial or go through the steps summarised below.

Import file off_ath offset file from /examples directory found in SHIPFLOW installation
folder and save the project e.g. Tutorial_2_1

Create SHIPFLOW setup from menu Connections > Setups > Shipflow.
Add xpan to Object Tree | Configurations | config | xflow | program
Add offset command to Object Tree | Configurations | config | xflow
Edit data in Object Tree | Configurations | config | xflow | offset, specify:
Lpp=1
xaxd=1
ysign=-1
xori=0
zori=0

Associate the offset file with the configuration using following command:
SHF_Import_off_ath|as_off_ath.exportSHF("off_ath")

Add xmdens to Object Tree | Configurations | config | xflow | hull and set density
parameter to coarse.
Add fsflow to Object Tree | Configurations | config | xflow | hull
Set speed to Fn = 0.632 in Object Tree | Configurations | config | xflow | vship
Add Rn in Object Tree | Configurations | config | xflow | vship and set it to 1e7.
Add h1gr entry to Object Tree | Configurations | config | xflow | hull and set it to athena.
Add xpan to Object Tree | Configurations | config
Add parall to Object Tree | Configurations | config | xpan and set number of threads to
available cores in your computer CPU.
Run the computations.

Save the project.

29(128)

Now we will create a design variant where we will add a transom group to the free surface.

First create a design variant from menu Optimization > Create New Design From
Current Design and name it e.g. transom

This new design will become the current one automatically, you can see its name on the
status bar at the bottom of the application window. All changes you make to the
configuration will be contained in this variant and the baseline variant will remain
unchanged.

Now, add a transom option to Object Tree | Configurations | config | xflow | hull and run
the computations again.
Make sure that the Ship is set to mono.

30(128)

Start the computation

To compare the result with the baseline lock the current one by clicking the lock icon at
the bottom of the 3DView and thereafter select Object Tree | Optimization | Designs |
baseline.

31(128)

Tutorial 2 part 2 Speed variation using Ensemble investigation

Continue the previous work or open the T_2_1_f.fdb file from


..\BasicTraining\Tutorial_2\T_2_1\. Save the project as Tutorial_2_2.fdb.
Make sure your current design is transom

Double click

Create a Design Variable from the menu Optimization > Design Variable. Name it Fn and
set it to 0.5.

Add the Fn variable in the vship command instead of the speed value in Object Tree |
Configurations | config | xflow | vship section.

32(128)

Create a Parameter for the pressure resistance cw by double clicking CW value in the result
table in the TableViewer

Create an Ensemble Investigation from the menu Optimization > Ensemble Investigation.

33(128)

In the ObjectEditor for the Ensemble Investigation chose Fn as the Design variable. Set the
Series to 0.3,0.4..0.7.
In the ObjectEditor for the Ensemble Investigation choose eval_CW as the Evaluation
parameter.

Select the Object Tree | Optimization | Design Engines | Ensemble Investigation in and
click Run (play icon).

When it is finished you will get a table with Fn values and obtained CW values. These
values can be displayed graphically by clicking the create new diagram button. When the
diagram editor is open switch to Mapping tab and select the Fn for x-axis data and the CW
for the y-axis. Finally click OK.

34(128)

The Diagram settings such as point size may be modified in the Adminstration tree in the
DiagramScene. The Administration tab is located to the left in the Object tree and marked
with letter P, see the picture below.

35(128)

The CFD Results can also be visualized and compared. You can find each computation
under Object Tree | Optimization | Designs | baseline | transom | EnsembleInvestigation.

Save and close the Project.

36(128)

Tutorial 2 part 3 Importing a command file and modifying the


panellization
The purpose with this part of the tutorial is to show how to import existing SHIPFLOW command
and offset files and modify the hull panellization. The command file is a simple hull configuration
without a free-surface.

Import file s60_dm from the directory ..\BasicTraining\Tutorial_2\T2_3\source\


by selecting File > Import > Configuration(SHIPFLOW)

Save the project e.g. Tutorial_2_3 by selecting File > Save as or click on the icon

Select SHIPFLOW computation in the object tree and Run the calculations by clicking on
the icon

Click 3DView tab to see the dynamic pressure on the hull.

37(128)

In Object Tree > CAD click on the scope containing the offsets (SHF_Import_off_s60) to
hide them from the 3DView.

In order to modify Visualisations go to Object Tree > Connections > Computations &
Results > comp > XPAN.
Select XPAN_BodyContours and in the Object Editor click White isolines on colored
surface.

38(128)

Select Body and in the Object Editor first select create new and the click
FMeshVisualization to show the panellization on the hull. Finally click Draw mesh
only.

39(128)

Zoom in on the stern and you can see for this specific hull that the panels do not match
between the stern and main groups. The stern has 5 points and the main group has 7 points
for the same region. We will now fix this!

In order to keep the result we have we will work on a different design. Select Create New
Design From Current Design in the Optimization menu. The newly created design will be
called des1 and will be the active one in the CAD and Connections tabs in the Object Tree.

Run XPAN for the new design by select SHIPFLOW computation in the object tree and
Run the calculations by clicking on the icon

40(128)

Check which group number the stern group has in the SHIPFLOW OUTPUT file by
selecting FileViewer>s60_dm_OUTPUT and scrolling down to the stern group.

Select Object Tree > Connections > Configurations > s60_dm and create the XMESH
module in the Object Editor.

41(128)

In the XMESH module create a BODY command with the keywords GRNO and POINT.
Set GRNO to the stern group number found in the OUTPUT file previously and POINT to 7.

Select SHIPFLOW computation in the object tree and Run the calculations by clicking on
the icon

42(128)

In the 3DView you can now see that the panellization looks better around the stern.

Save the project.

43(128)

Tutorial 2 part 4 A mesh refinement study


This is a continuation of the previous tutorial. The purpose with this tutorial is to learn how to refine
the mesh and understanding why it is important.

Continue from the project in the previous tutorial.

In Object Tree > Optimization double click on baseline to make it the current design.
Check the lower right corner to see that baseline is set as the current design. Rename the
design coarse.

44(128)

Select Create New Design from Current Design from the Optimization menu. Rename it
medium.

In Object Tree > Connections > Configurations > s60_dm > xflow > hull change keyword
Xmdens from coarse to medium.

Select SHIPFLOW computation in the object tree and Run the calculations by clicking on
the icon

45(128)

Create another design from the medium design and call it fine. For this design set Xmdens
to fine and run SHIPFLOW.

For double model calculations (no free surface) the integrated pressure force on the hull is zero
according to potential flow theory. Since we are using numerical methods to calculate the pressure
on the hull, the pressure force from XPAN will not be zero, however it is a good measure of how
good your hull panellization is. CXPI is the integrated pressure force from XPAN. It is important
that CXPI is much smaller than the wave resistance CW from XPAN with a free surface, since CW
is also calculated from pressure integration.

Check how CXPI varies for different panellizations. CXPI is found in TableViewer tab. You
can see results for different designs by clicking on them in Object Tree > Optimization.

Save the project.

Extra exercise: Create more designs and add a free surface. Run and compare CW to CXPI.

46(128)

Tutorial 3 part 1 Importing a command file and running XPAN


The purpose with this part of the tutorial is to show how to import existing SHIPFLOW command
and offset files to create a new project. The command file is a simple configuration for a linear freesurface computation. It will serve as a starting point for the following tutorial on optimisation.

Import file hamb_tut3 from the directory ..\BasicTraining\Tutorial_3\source\


by selecting File > Import > Configuration(SHIPFLOW)

Save the project e.g. Tutorial_3_1 by selecting File > Save as or click on the icon

47(128)

Check that the XPAN configuration is set to nonlinear and free condition and that the
number of iterations is restricted to 1.

Select SHIPFLOW computation in the object tree and Run the calculations by clicking on
the icon

48(128)

When the calculations are finished check the results in the FileViewer. A copy of the
command file and the OUTPUT file are available in the tabs and the results summarised in a
table available in the TableViewer tab.

To display the XPAN results select 3DView window tab. In order to modify Visualisations
go to Object Tree > Connections > Computations & Results > comp > XPAN.

Select the top view by clicking Z axis and zoom to extent. For clearer view you can switch
off the visibility of the scope with the offset points. The program window should look as
above.

Save the project.

49(128)

Tutorial 3 part 2 Hydrostatics calculations

Continue the previous work or open the T_3_1_f.fdb file from


..\BasicTraining\Tutorial_3\T_3_1\. Save the project as Tutorial_3_2.fdb.

For convenience switch off the visibility of the CFD results by clicking on the icon of Free
surface and Body in the object tree.

Switch on the offset points visibility.

Set view to Y and zoom extent. The screen should resemble the one below.

Create the hydrostatic configuration and computations by selecting from the menu
Connections > Setups > Hydrostatic.

50(128)

Now in the Object Tree you should find the FconfigurationHydro (see Type of the object)
with a default name (case1) in the baseline scope and also FhydroComputation with default
name (caseRun2) in the Computations scope.

Select hydrostatic configuration in the Object Tree and in the Editor give the Lpp = 153.7
and set the Sink to 9.5.

Add three more Offsetgroups in the hydrostatic configuration by clicking the + icon.

51(128)

For each offset group in the hydro configuration set the appropriate offset group from the
SHF_Import_off_file scope as shown in the picture below. To select you can use the dropdown menu in the OffsetGroup entry.

Select the Hydrostatic Computations in the Object Tree and run the hydrostatic calculations
by clicking the play icon. A table with hydrostatic data should be now available in the
TableViewer.

52(128)

Display the 3DOverView window from menu View > Windows > 3DOverView, rotate the
view to look from a side. Now you should see the Sectional Area Curve as below.

Save the project.

53(128)

Tutorial 3 part 3 Hull form modification using Lackenby shift

In this part of the Tutorial a hull modification using the Lackenby shift will be applied to the
main part of the hull.

Continue the previous work or open the T_3_2_f.fdb file from


..\BasicTraining\Tutorial_3\T_3_2\. Save the project as Tutorial_3_3.fdb.

Create a Lackenby entity by selecting from the menu CAD > Transformations > Shifts >
Lackenby.

54(128)

In the Object Editor specify the parametres for the Lackenby as follows:

Lpp = 153.7

DeltaXCB = 0.01 ( this value corresponds to a longitudinal shift of the centre of bouancy
by 1% of Lpp forward)

Xbeg = 7.0 for the Aftbody

Xend = 69.5 for the Aftbody

Xbeg = 69.5 for the Forebody

Xend = 153.7 for the Forebody

For the SAC the input should be the Sectional Area Curve computed by the Hydro
Computations. This can be extracted by giving the following command:

comp01.getSectionalAreaCurve() , where the first part is the name of the Hydro


Computation and the second is the command necessary to extract the SAC from it,
see also picture below.

Now the modification will be applied to the offset points and stored in a new offset group
called Image Offset Group.

55(128)

Create the Image Offset Group selecting from the menu CAD > Offsets > Image Offset
Group.

Rename the newly created ImageOffsetGroup to hull (this name should correspond to the
group in the original offset file that we will modify) and set the parameters as follows:

As the source take the hull offset group from the original offset file.

ImageTransformation set to the Lackenby01. (The Lackenby object created above.)

Now you can observe in the 3D Overview that there is a new set of offset points on the main
part of the hull that will react on the value of DeltaXCB in the Lackenby object.

56(128)

Tutorial 3 part 4 Optimization of the forebody


In this part of the tutorial an optimization of the forebody with the Lackenby shift will be set up

Continue the previous work or open the T_3_3_f.fdb file


from ..\BasicTraining\Tutorial_3\T_3_3\. Save the project as Tutorial_3_4.fdb.

Since the forebody only will be taken into consideration during the optimization the
Lackenby shift will be restricted to that part. The following changes have to be made
compared to the setup from the previous task:

DeltaXCB = 0.002

Xbeg = 65.0 for the Aftbody

Xend = 69.5 for the Aftbody

TanBeg and TanEnd set to 0 for the Aftbody

For the optimization process a design variable and parameter will be necessary to control the
process.

57(128)

To create a design variable select from the menu Optimization > Design Variable. Rename
it to XCB and set it to -0.003.

Create a parameter by double clicking the CWTWC value in the Table viewer (If there is no
the XPAN result table in Table Viewer the SHIPFLOW computations have to be performed).

58(128)

In the offset group assembly the hull offset group has to be replaced with the image offset
group created in the previous part of the tutorial.

The design variable now has to be inserted in the Lackenby as an input variable. Go to the
Lackenby object in the Object Tree and edit the DeltaXCB. Set it to XCB variable.

To optimize the hull Simplex method will be used. To create engine for this optimization
select from the menu Optimization > NelderMeadSimplex

59(128)

The Design Engine now has to configured in the following way:

Set number of evaluations to 10

Design Variable: choose XCB and set lower bound to -0.003 and the upper bound to
0.003

Evaluations: chose CWTWC parameter.

The rest of parameters is left as default for this exercise but more advanced
configurations are encouraged to e.g. speed up the optimization process.

Now you can run the optimization by clicking on the play icon

When the optimization is finished a tab with the results of the NelderMeadSimplex process
is available.

60(128)

You can see the Design Variable and also evaluated parameter values, click on the name at
the top of the table will sort the values.

To create a diagram showing the results click on the new diagram icon second from the
left in the tab with the results table

and then in the mapping tab select the XCB and CWTWC for x and y axes respectively.
After confirming with OK a new tab with the diagram will appear.

61(128)

If there is no wave pattern visible in either 3DView or 3DOverview select from the Object
tree Tab Connections | Computation & Results | comp | XPAN and switch visibility
option for Body and Free Surface objects by clicking on their icons in the tree. Then go to
3DView window and rotate the view to see the pattern from above Z.

62(128)

To check the wave pattern for different design variants go to the Object Tree Tab
Optimization and select first variant of the Designs | baseline | NelderMeadSimplex
optimization object. Set the CFD Result to be displayed in 3DView

Now lock the view clicking on the small lock icon at the bottom of the screen, now the
mirror image appeared and was locked

To compare different variants simply select other variant in the Designs tree.

63(128)

Important note:
By default the contour plot range is set dynamically for all variants independently and may lead to
difficulties in interpretation of the results. In order to use the same contour plot range a custom
color map has to be created manually. For example in Connections | Results () | comp | XPAN |
Free Surface | XPAN_FreeContours find a Color Map and click + icon to add a new color map,
then the range and number of countours can be easily adjusted.

Save the project

64(128)

Tutorial 3 part 5 Creating manual variants of the design


In this part of the tutorial a new variant will be created and an optimization of the forebody with the
Lackenby shift will be carried out for a different ship speed

Continue the previous work or open the T_3_4_f.fdb file from


..\BasicTraining\Tutorial_3\T_3_4\. Save the project as Tutorial_3_5.fdb.

First make sure you are working with the baseline variant by double clicking on the baseline
in the Designs in the Object Tree.
To verify that you are in the baseline variant check the status line at the very bottom of the
program window. Current design should be baseline.

Create a new variant from the baseline by selecting from the menu Optimization > Create
New Design From Current Design

A new variant should appear in the Object Tree, here with a default name des1
This newly created variant became a current one automatically. Now we can edit the
configuration without affecting other variants.

65(128)

As an example we will modify the speed and adjust the free surface panellization.
In the Object Editor set the Fn to 0.28 and decrease number of panels on the free surface in
the longitudinal direction as follows: Stad=33, Stam=69, Stau=25.
Save the project

Go back to the Design engine in the Object tree and run the optimization process again

66(128)

When the optimization is finished display the diagram with the results and compare it with
the results of the previous optimization, notice that the optimum now is different due to the
Fn difference and some designs were out of the bounds (red markers)

You can also find the best designs for both speed and compare the resulting free surface
pattern in the 3D View.

67(128)

Save the project and


Good luck with your own designs!

68(128)

Tutorial 3 part 6 Export of optimized geometry to IGES

Continue from the Tutorial 3 part 4 or part 5.

Import the IGES file t3_6_surface_model.igs from the ..\BasicTraining\Tutorial_3\T_3_6


directory.

Select all the imported surfaces and thereafter create a surface group

69(128)

Select the newly created surface group and create a Image Surface Group

Edit the Image Surface Group object such that the Image transformation is set to your
Lackenby shift

70(128)

Now if the XCB parameter is modified the hull surface will change according to the
Lackenby transformation. So set it to the value which was the best in the optimization task
and observe the new hull surface.

In order to export the new hull select the Image Surface Group object and in the drop down
menu select File | Export | IGES.

71(128)

Tutorial 4 part 1 Twin-skeg example IGES

Import twinskeg.igs file from Tutorial_4 folder and save the project

Select all surfaces and create surface group

72(128)

Create SHIPFLOW configuration from MENU > Connections > Shipflow.

Next configure the SHIPFLOW setup using the following data:

Lpp = 260

T = 15

iges file as a geometry input (use the created surface group)

Fn = 0.23

Rn = 6.3e6

coarse mesh

xpan calculations only

73(128)

Run SHIPFLOW. The program should start the IGES to offset converter first, then compute
the flow around the hull.

During this run SHIPFLOW first translated the IGES file to an STL file and thereafter
created an offset file that was submitted together with the configuration to the solver. The
process is automatic but it is good to be familiar with the process.

The directory structure is as follows:

in this example the project file called T_4_2.fdb is located in Tutorial_4 folder

if default names were used for the variant and configuration in the project the
configuration file together with the offset file will be located in folder called comp.

There SHIPFLOW solver is executed and another subfolder named config_RUN_DIR is


created where temporary solutions are stored.

In the config_RUN_DIR one can find a config file that contains some additional
informations. The most important for the user is the information about groups that are in
74(128)

the offset file.

The picture below shows the initial configuration as prepared by the GUI:

The next picture shows the final configuration used in the calculations that includes the
offset group information.

Note that the offset groups are different in xflow and for xgrid modules, this is due to the
fact that the xmesh and xgrid have different requirements regarding the offset station
arrangements.

After the initial run from an IGES file one can import the final configuration together
with the offset file into the GUI to save time. This method will be used later in
connection with xchap calculations.

75(128)

Tutorial 5 part 1 Manual offset generation

Start new project and save it as Tutorial_5_1.


Import ( menu File > Import > IGES (Subset) )the iges_version_A.igs file from the
directory: ..\BasicTraining\Tutorial_5\source\

Confirm the default settings of the imported iges.

Rotate the view to see the hull from the side (Y) and extend the view, you should see the
picture similar to that below.

76(128)

In the Object Tree select the BsplineSurface objects that are in the IGES_Import scope one
by one and observe that different surface patches are being highlighted.
Rename the patches using Object Editor using the following names:
bulb for forward bulb
stem for the bow overhang
main for the main part of the hull
boss for the boss
stern for stern overhang

Check the length of the hull with the coordinates display in the top right corner of the 3D
View (available only in the orthogonal views), notice that due to the unit conversion the hull
is 1000 times too small.
Select all the surfaces in the tree or on the screen and scale them using the following
command: .scale(1000,1000,1000)
extend the view to see the whole ship

77(128)

Save your project

78(128)

Tutorial 5 part 2 Creating and exporting offset data

Continue the previous work or open the T_4_1_f.fdb file from


..\BasicTraining\Tutorial_4\T_4_1\. Save the project as Tutorial_4_2.fdb.
Create a scope (selecting from the menu Create > Scope) and rename it to offsets, then
create scopes bulb, boss, main, stem, stern inside the offsets scope.

Create a plane selecting from the menu Create > Offsets > Plane

Give it a name xplane and check if the normal is pointing in x direction [1,0,0]. We will use
it later as the cutting plane to create sections.

79(128)

Now we will create sections on the main part of the hull. Select all surfaces and create a
Section group from the menu Create > Offsets > Section Group.

Select newly created section group and using the Object Editor do the following steps:
Rename it to section_main.
Put it in the offsets scope.
Make sure that in the window with Surfaces you have all surfaces that belong to the hull.
Set the Section Plane to xplane.
Specify the position giving the x coordinates 3.365,8,13..140,140.202 ,the first and the
last input lies just outside the main part and cuts the overhangs, boss and bulb, the
second, third and fourth input is necessary to create a set of sections from 8 to 140 with
step of 5. As you can see it is possible to give a specific positions separated by commas
and also specify a range by giving first position comma second position double dot last
position.
80(128)

For the time being leave the rest as default.

After all the input is given the sections are created, switch of the surface visibility, rotate the
view to look at the sections.

81(128)

In a similar way create the section groups for the rest of hull parts, use the positions:
bulb: 140.202,141,142..147,147.6
stem: 140.202,141,142,143,143.5
stern: -11.5,-9,-7..3,3.365
boss: 0.26,0.5,1..3,3.365

All sections are prepared now, your 3D View may look like the one below. Notice that the
distribution is rather coarse. This is however only for this exercise, some more informations
and guidelines about sections will be given at the end of this tutorial.

82(128)

***** Now create the offsets from the sections, first we start with the boss *****

Make boss scope current by clicking on it with the middle mouse button.

Select the section_boss in the Object Tree as shown below, the boss section should become
highlighted in the 3D View

83(128)

Create the offsets now by choosing from the menu Create > Offsets > Offset Group

The Offsets for each section on the boss and the Offset Group consisting those offsets were
created.
The offset group was put in the current scope (|offsets|boss), rename it to boss, this will be
the name in your offset file you will create later.
Switch off visibility of all section groups, your screen should look like the one below:

84(128)

Notice that the boss offset group contains also a part of the hull that is above it, this has to
be removed.
Select the offsets and from console window use command .cutMinMax(2,-1,6.618)
where 2 means direction along z-axis and -1,6.618 is the interval of offsets to be remained

SHIPFLOW is build in such a way that it accepts only the offsets where the first point
(marked with larger point marker) is at the keel line and therefore one should make sure that
the sections have the right direction.

If the point order has to be reversed: Select the Offsets that need to be reordered and type in
the Console the following command: .reverse() and hit return (enter) key. You should see on
the screen that the sections start at the other end of the curve.

+++++ Next important step is to check the offset stations order. Select the first section
(section001) and observe in the 3D View that it is the tip of the boss

Now in the Object tree select the boss OffsetGroup, in the Object Editor check the Entities
window (click on Edit there if necessary). Look at the list and check the first section name.
In this case it is the section001 which was the tip of the boss. In SHIPFLOW we need to
have the offset sections ordered from the bow to the stern, this is not the case here. We will
need to reverse the order.

85(128)

Make sure that the boss offset group is selected in the Object Tree and in the Console type
.reverse() and hit return key. Check again the Entities in the offset group, notice that the
section000 is at the end of the list. Now everything is in the right order for the boss.

86(128)

Repeat the steps for other groups (stern, stem, bulb, when you begin with the main part stop
just after you reversed the offset point order and read few additional informations that are
below) starting from the point that starts with ***** when we started creating offsets.

So now you are at the point where the offset lines start at the keel line and the sections are
ordered in longitudinal direction. Zoom in to see closer the first section at the bow.
Notice that it looks as if it had two beginnings, it is because there are two lines in fact, we
will now join them together.
Select the lower part and check the name in the Object Editor (here it is section029) , select
the lower part and check the name in the Object Editor (here it is section030)

87(128)

Now to join them type in the Console the following command:


|offsets|main|section029.attach(|offsets|main|section030)
this means: first_line.attach(second_line)

The lines are now joined but still the upper part remains, delete it.

88(128)

Repeat similar steps if you find other broken sections.

Now we will even out the sheer line, it is not necessary here but the commands can be useful
in some situations and it is good to know them. Switch on all the offset groups if you
switched them before for some reason.

Set view to Y and using the coordinates displayed in the top right corner of the 3D View
check where you like to cut the sheer line, say it is 14.0.

Select all offset groups and use the following command to trim them off:
.cutMinMax(2,-1,14)
this means we cut perpendicular to the Z direction (direction 2) and we cut everything
below -1 and above 14

To create an assembly of the offset groups make the offsets scope current (clicking with the
middle mouse button) and then select all the offset groups (you can hold the Ctrl key and
select them from the Object Tree) and choose from the menu Create > Offsets > Offset
Group Assembly

89(128)

The offset assembly is now created. Rename it to e.g. off_file and check in the Object Editor
that it consists all of the offsets groups (stem, bulb, main, boss, stern) in the Entities.

This is your offset group assembly that can be used in the further calculations directly or it
can be exported to the offset file.

To export the offset file select the offset group assembly and choose from the menu File >
Export > Offsets.

90(128)

Save the project and take a look at the offset file you just created with your favourite text
editor

91(128)

Tutorial 5 part 3 Method for quick offset file generation


To make the offset file quicker you don't have to do it from the beginning for each new hull you
work on. Here an example will be given how to replace the hull lines and keep the same or similar
settings for new offset file.

Open a new project and import an IGES file from


..\BasicTraining\Tutorial_5\source\

Rename the surface patches as in the part 1 of this tutorial, remember about the scaling.
(you can also find a project file named T_5_3_B in the same directory, it is the project with
already imported, scaled and renamed patches)

Save the file as Tutorial_5_3

Open another SHIPFLOW 4.0 application and load the result of the part 2 of the tutorial or
the file named T_5_2_f from

..\BasicTraining\Tutorial_5\T_5_2\
Remove the offsets from all groups, just select and delete.

Select in the Object Tree the offsets scope as well as the xplane object

92(128)

Press Ctrl+C or select the Copy icon in the Object Tree to copy the selected objects

Go to your second SHIPFLOW 4.0 application with the imported Version B of the hull and
paste the objects. Switch on the visibility of the section groups.

The sections with all the settings from the part 1 and 2 of the tutorial are now applied to the
second hull.

This new hull will probably require some adjustments of the positions and creation and
editing of the offsets but now you know how to do it so go back to the part 2 of the tutorial if
you need some help and create new offset file for this hull.

Good luck
93(128)

Tutorial 6 part 1 XBOUND


The purpose with this part of the tutorial is to show how to run XBOUND and make some basic
changes of the XBOUND configuration. The command file is a simple configuration for potential
and boundary layer flow.

Import configuration file config from the directory ..\BasicTraining\Tutorial_6\source\


by selecting File > Import > Configuration(SHIPFLOW)

Save the project e.g. Tutorial_6_1 by selecting File > Save as or click on the icon

The configuration is set up for a basic model solution with XPAN, i.e. it has a horizontal
symmetry plane instead of a free surface. This is sufficient for the purpose of this tutorial.
The configuration is set to run XMESH and XPAN and a command to run XBOUND must be
added. The speed of the ship must also be added. XBOUND requires that the Reynolds number Rn
is set.

Check that xpan and xbound is selected in Object Tree | Connections | Configurations |
config | xflow | program

Check that the Reynolds number Rn is set to 1.2e7 in Object Tree | Connections |
Configurations | config | xflow | vship

94(128)

Run the computations.


Save the project.

The keywords xmesh and xpan can be removed from the program command once the XPAN
solution is computed. The next time XBOUND is run it will read the potential flow solution from
the database files.

A summary of the results can be found in the TableViewer. Note that the wave resistance is
zero in this case since XPAN was computed without the free surface. The estimated friction
coefficient CF from the boundary layer computation is printed. The reference area Sref from
XPAN should be used for the rescaling of the coefficient, the AREA value is the the part of
the hull that is covered by the streamlines.

The complete configuration for XBOUND and some results can be read in the output file in
the FileViewer

95(128)

Hide the offset sections and go to Connections | Configurations & Results | comp | XPAN
& XBOUND in the ObjectTree to control the visualization of the results.

The next part of the tutorial will show some possibilities for the user to control the distribution of
the potential flow streamlines. In our example we will try to get some additional streamlines on the
side of the ship at midships. This can be done for example by specifying another value of the
ISTART parameter that controls the location of points from which the streamlines are traced (upand downstream).
Create an xbound section in the configuration tree and add a trace command. The default
values for the parameters can be found in the output file from the previous computation.
Change the value of Istart to 50 by adding this change to the trace command.

Delete xmesh and xpan from the program command and re-run XBOUND

96(128)

Modify the transverse distribution of starting points at Istart by increasing the distance
between the uppermost streamline and the waterline by changing the parameter Pn from
0.95 to 0.85.

Trace limiting streamlines on the forebody by adding two limit commands to the xbound
section. Set up the parameters required to trace 10 streamlines of 10 stations starting the
tracing at the first station. The first limiting streamline group should start at x/L=0.09 and
end at 0.11 and the second group from 0.19 to 0.21.

97(128)

Additional task:
The configuration contains the command prtopt with the keyword strlres to create an
additional output file with detailed results from XBOUND. Find this file in the directory
structure of your project, in this case
Tutorial_6_1\manual_results\baseline\comp\config_RUN_DIR\config_STRLRES. The
first half of the file contains the coordinates, arc-length, speed at the outer edge of the
boundary layer and curvature for each streamline. The last half contains the boundary layer
results along the streamlines.

98(128)

Tutorial 7 part 1 Automatic grid generation with XGRID


The purpose of this tutorial is to demonstrate automatic grid generation with XGRID. Different grid
refinements and simulation requirements will be applied for a container ship. Some basic postprocessing techniques for visualizing the grid and boundary conditions will be demonstrated.

Import configuration file kcs_import_offset from the shipflow examples directory


by selecting File > Import > Configuration(SHIPFLOW)

Save the project e.g. Tutorial_7_1 by selecting File > Save as or click on the icon

The configuration is set up to run free surface computation with XPAN on a coarse mesh. Change
the configuration to run all modules with a coarse XGRID grid and zero XCHAP iterations.

Rename the configuration kcs_import_offset to kcs_zonal_coarse

Select all in Object Tree | Connections | Configurations | kcs_zonal_offset | xflow |


program. This will make all modules XMESH, XPAN, XBOUND, XGRID, XCHAP run
Add xgrid in Object Tree | Connections | Configurations | kcs_zonal_offset
Add the size command
Add Xgdens in the size command and select coarse. XGRID will generate a coarse grid

99(128)

for the zonal approach


Add xchap in Object Tree | Connections | Configurations | kcs_zonal_offset
Add maxit in the control command and make sure it is set to 0
Add the parallel command
Add nthreads in the parallel command and set it to a suitable number of threads for your
computer, for example 2 on a dual core processor
The configuration is now completed. All SHIPFLOW module will be run in a sequence in the zonal
approach. The grids densities for XPAN and XGRID are set to coarse to make the computation
faster. XCHAP will only set boundary conditions and create an initial solution since the number of
iterations are set to zero.

Save the project


Select the Computation object comp in Object Tree | Connections | Computations &
Results
Press the green start button
View the execution in the TaskMonitor. It can be opened from the menu View | Windows

It is only the number of iterations for XCHAP that needs to be increased to about 4000 before a
XCHAP computation can be started. However, the grids should be changed to fine to achieve
accurate solutions. This will be left for the reader to exploit. The remaining part of the tutorial will
explain how to visualize the grid and the boundary conditions.
The results are found under the Object Tree | Connections | Computations & Results | comp.
Press the +. The program shows the pressure coefficient on the hull in the 3DOverView window
by default. In out case the pressure is zero so the hull is rendered in one colour. The visualization of
100(128)

the offsets has been turned off in the picture below. The outline of the XGRID grid has be turned on
by activating the Object Tree | Connections | Computations & Results | comp | XCHAP |
Component Grids | Xgrid_1 | XCHAP_ComponentOutline tool.

The GridSlice tool can be used for inspecting the grid planes in a 3d grid. The tool is created by
selecting the Xgrid_1 object and then selecting Create New in the empty row of the Visualization
widget as shown in the picture below.

101(128)

The next step is to select the newly created GridSlices object and create new in the empty row in
the Visualization widget. Choose the FmeshVisualization alternative.

Grid planes in the three parametric directions L, M, N can be activated in the editor. The planes can
be shifted in the corresponding parametric direction by moving the slider or entering the value. Try
to change the location of the grid plane and zoom in to inspect the grid.

102(128)

The boundary conditions can be visualized with the XCHAP_BoundaryConditions tool which can
be found in XCHAP | Component Grids | Xgrid_1 in this case. Activate the tool with the round
button in the Object Tree. Press the text part to show the editor. Select for example the Noslip, Slip
and Inflow boundary conditions. A coloured sphere is then displayed at the centre of each boundary
cell face.

Automatic grid generation FINE, MEDIUM and COARSE grids


A coarse grid was used in the example above. This type of grids yields a too low grid resolution for
normal purposes. The grid density can easily be increase by using the FINE or MEDIUM options in
the XGRID command SIZE.
In the following we will compute several grids of varying grid density and types. To make the
exercises quicker to execute the configurations are limited to only run XGRID. The results will not
contain any flow solution or boundary conditions in this case and thus only the visualization tools
for displaying grids can be used.

Close any projects in the GUI.

Import configuration file kcs_import_offset from the shipflow examples directory


Change the configuration to just run XGRID with the selected grid density
Select only xgrid in xflow | program
Remove the xpan configuration section
Add a configuration for XGRID
Add the size command and set xgdens to coarse
Add a configuration for XPOST
Add the control command and set onoff to off
Save the project and run SHIPFLOW
Toggle the Object Tree | Connections | Computations & Results | comp | XCHAP |
Component Grids | Xgrid_1 | XCHAP_ComponentOutline tool active

103(128)

Create also a GridSlice visualizer as describe in the previous section

Next we will compute a finer grid for comparison. The easiest way to do this is to first create a new
Design and then change the grid density. The grids can be compared afterwards using for example
the GridSlice tools.

First create a design variant from menu Optimization > Create New Design From
Current Design and name it e.g. zonal_fine
Next change to fine grid on the size command for XGRID
Select the comp object and run SHIPFLOW
Afterwards you should be able to compare the grid surfaces on the hull side by side with the
GridSlice tool

Automatic grid generation Global approach


XGRID can generate a grid starting upstream and ending downstream of the ship. This is simply
104(128)

done by adding the keyword GLOBAL in the XGRID command SIZE.


We start out by importing the same configuration file as in the previous example. Changes are then
applied to run only XGRID with necessary modifications.

Close any projects in the GUI.

Import configuration file kcs_import_offset from the shipflow examples directory


Change the configuration to just run XGRID with the selected grid density
Select only xgrid in xflow | program
Remove the xpan configuration section
Add a configuration for XGRID
Add the size command and set xgdens to coarse
Add the keyword global to the size command
Add a configuration for XPOST
Add the control command and set onoff to off
Save the project and run SHIPFLOW
Toggle the Object Tree | Connections | Computations & Results | comp | XCHAP |
Component Grids | Xgrid_1 | XCHAP_ComponentOutline tool active

Create also a GridSlice visualizer as describe in the previous section

Automatic grid generation One and two sides


Both side of the ship must be gridded when the flow is asymmetric. This is the case in for example
single screw propeller or manoeuvring simulations. XGRID will mirror the grid when asymmetry is
specified in the XFLOW section of the configuration.
We start out by importing the same configuration file as in the previous example. Changes are then
applied to run only XGRID with necessary modifications. Alternatively, you can continue working
with the previous example and apply the modification to the current configuration.

Close any projects in the GUI.

Import configuration file kcs_import_offset from the shipflow examples directory


Change the configuration to just run XGRID with the selected grid density
Select only xgrid in xflow | program
Add the symmetry command in the xflow section and add the symmetry list from which

105(128)

the nosym option can be selected


Remove the xpan configuration section
Add a configuration for XGRID
Add the size command and set xgdens to coarse
Add a configuration for XPOST
Add the control command and set onoff to off
Save the project and run SHIPFLOW
Toggle the Object Tree | Connections | Computations & Results | comp | XCHAP |
Component Grids | Xgrid_1 | XCHAP_ComponentOutline tool active

Create also a GridSlice visualizer as describe in the previous section

Optional exercise: Boundary conditions on the folder surface.


The purpose with this optional exercise is to demonstrate how the boundary conditions are set when
the grid is mirrored. The part below the singularity line in the y=0 plane will become an internal
grid surface and needs no boundary conditions. However, the part above the singularity line is a
folded boundary surface. Two neighbouring cells on each side of the y=0 plane have a common cell
face where the flow should pass through as if it was an internal cell face. XCHAP will mark these
faces as internal.
XCHAP computes the boundary conditions and needs to be run for at least zero iterations before it
can be visualized. XPAN and XBOUND must also be run when we use the zonal approach. We will
import the same configuration as above and modify it so all modules will be run with coarse grids.

Import configuration file kcs_import_offset from the shipflow examples directory.


(Alternatively you can continue from the project Tutorial_7_1.)
Save the project e.g. Tutorial_7_1_zonal_2sides by selecting File > Save as or click
the icon

on

The configuration is set up to run free surface computation with XPAN on a coarse mesh. Change
the configuration to run all modules with a coarse XGRID grid and zero XCHAP iterations.

106(128)

Rename the configuration kcs_import_offset to kcs_zonal_2sides


Select all in Object Tree | Connections | Configurations | kcs_zonal_offset | xflow |
program. This will make all modules XMESH, XPAN, XBOUND, XGRID, XCHAP run
Add the symmetry command in the xflow section and add the symmetry list from which the
nosym option can be selected
Add xgrid in Object Tree | Connections | Configurations | kcs_zonal_offset
Add the size command
Add Xgdens in the size command and select coarse. XGRID will generate a coarse grid
for the zonal approach
Add xchap in Object Tree | Connections | Configurations | kcs_zonal_offset
Add maxit in the control command and make sure it is set to 0
Add the parallel command
Add nthreads in the parallel command and set it to a suitable number of threads for your
computer, for example 2 on a dual core processor
Save the project and run the computation

Use for example a GridSlice tool to display the surface grid and the folded surface. Show noslip and
interior boundary conditions with the XCHAP_BoundaryCondition tool.
Note that XPAN and XBOUND ignores the nosym command in Automatic Mode. This is indicated
by the warning message:
*** XFLOW WARNING: XZ-SYMMETRY IS ENFORCED FOR STANDARD CASES
Unsymmetric cases must be set up in Manual Mode for XPAN and XBOUND. The flow at the inlet
that is needed by XCHAP in the zonal approached is mirrored.

Automatic grid generation Wet transom grid


Hulls with a large submerged transom needs special treatment to avoid poor grid quality. The
normal XGRID grid would make a sudden large jump from the hull to the free surface which leads
to a poor quality of the grid. A special component grid can be made that fills the domain from the
transom and downstream of the ship. The hull grid will leave the hull surface and follow the outer
boundary of the transom grid.

107(128)

To illustrate this we will create a new configuration of the container ship with the draft is increased
to 14.0 meters to create a large submerged transom.

Import configuration file kcs_import_offset from the shipflow examples directory


Change the configuration to just run XGRID with the selected grid density
Select only xgrid in xflow | program
Add the keyword wtransom in the xflow hull command
Remove the xpan configuration section
Add a configuration for XGRID
Add the size command and set xgdens to coarse
Add a configuration for XPOST
Add the control command and set onoff to off
Save the project and run SHIPFLOW

Note that two grids were created in XGRID, the Xgrid_1 and the Xgrid_transom_1. You can see
this under XCHAP | Components Grids in the Object tree. Two GridSlice tools have created in the
picture above to visualize the grids.

108(128)

Tutorial 7 part 2 Automatic grid generation for Twin-skeg hulls


This tutorial requires basic knowledge of the xchap and xgrid as well as post-processing features of
SHIPFLOW.
This tutorial can be continued from the Tutorial 4 part 2 or started from the T_7_2_start.fdb project
file.
The first task is to add default coarse grid setup for xgrid and start the case with zero iterations.

ZONAL

Change the program to all in xflow

Change number of XPAN iterations to 1.

Add XGRID module configuration and set the grid size to coarse

Add XCHAP module configuration and set number of iterations to zero in control command

Start the computations and display TaskMonitor window.

109(128)

The XPAN results can be visualised in 3DView window and the XCHAP results can be
visualised in 3DOverView window by default.

GLOBAL

Create a new variant in your project from menu Optimization > Create New Design from
Current Design and name it global

The global calculations of twinskeg hulls can be executed by adding the global keyword
to the size command in XGRID module.

110(128)

Run the case

When the calculation is finished display the component grid outlines to see the flow domain.
Note that there are aft-body and fore-body grids.

Save the project.

111(128)

Tutorial 7 part 3 Viscous free-surface


This tutorial requires basic knowledge of the xchap and xgrid as well as post-processing features of
SHIPFLOW.
Import configuration file ath_dm_tut from ..\BasicTraining\Tutorial_7\T_7_3\source and save
the project.

Run this case without any changes to the configuration. This is a regular double model case.
When the computation is finished go to 3DOverView and display the grid outline.

Create a new design variant and name it VOF.

112(128)

Add VOF keyword in the hull command in xflow module to trigger vof computations.

Run this case.


In the 3DOverView one should see the hull and free-surface contours for the initial guess, note that
the free-surface contour levels are set to min and max values by default therefore nearly flat surface
will appear as below.

113(128)

Now display both grids from baseline and vof variants, notice the difference. The vof case
grid was create also above the free-surface level.

114(128)

Running a very coarse vof example


Now it would be good to try running the solver for several hundred iterations to actually see the
wave pattern that develops around the hull. Since even coarse default grids may be too large for
running on a laptop it is advised to coarsen the grid further following the settings given below.
Change grid size according the the below data

115(128)

Set maximum number of xchap iterations to 500 and run the case. It should take about 15-20
minutes to finish this computation.
Display the free-surface and mirror the data set. The wave pattern should be now clearly visible. For
commercial work it is advised however to use grid size set to at least medium.

116(128)

Tutorial 7 part 4 XGRID manual control


The following part of the tutorial will show how the number of cells and the distribution can be
controlled in XGRID. The KCS container ship will be used in this exercise. First we will create a
global grid and after that a grid for the zonal approach.
Create a global grid with 153x31x65 cells in the longitudinal, circumferential and normal
directions, respectively. Place the inlet at x=-0.5 and the outlet at x=1.5. Concentrate cells in the
regions around the stem (-0.1 < x < 0.2) and in the stern (0.8 < x < 1.0). The exact distribution of
cells in the x-direction is left to the user, but use approximately one third of the cells for the
midship, one tenth upstream and one tenth downstream the ship. The remaining 50% of the cells are

used to resolve the fore and aftbody.

Import configuration file kcs_import_offset from the shipflow examples directory


Change the configuration to just run XGRID with the selected grid density
Select only xgrid in xflow | program
Remove the xpan configuration section
Add a configuration for XGRID
Add the size command and set etamax=32 and zetamax=66
Add the xdistribution command and set the values for xtart, xend, nu, nf, nm, na, nw,
xfpu, xfpd, xapu and xapd according to the recommendations above
Add a configuration for XPOST
Add the control command and set onoff to off
Save the project and run SHIPFLOW

117(128)

Toggle the Object Tree | Connections | Computations & Results | comp | XCHAP |
Component Grids | Xgrid_1 | XCHAP_ComponentOutline tool active
Create also a GridSlice visualizer as describe in the previous section

In the next exercise we create a grid of the same grid density but for the zonal approach. Let the
grid start at midship.

Create a new design variant in the current project


Modify the xdistribution command to create the zonal grid. Move the xstart to 0.5 and
remove the nf, nf, xfpu and xfpd parameters. Change nm about half of its previous value
Save the project and run SHIPFLOW

118(128)

Tutorial 7 part 5 XGRID manual control VOF cases


Import kcs_vof_def example SHIPFLOW configuration from /SHIPLFOW5.x.x/examples directory
and thereafter save the project.

In the Object Tree in Connections | Configurations | kcs_vof_def | xflow | hull you can see the
vof keyword which will trigger the vof computations. For many cases this is sufficient input for
SHIPFLOW to run this type of cases. However, there is more input that should be known to the user
in order to perform vof computations for various types of hulls.

119(128)

Run it for 0 iterations and display surface mesh on the hull and transom

Looking on the surface mesh from a side one can see that there is a band of finer cells in vertical
direction around the air-water interface. The number of cells in the girthwise direction can be set
under the lower face of the refined region, in the refined region and above it using UETAMAX,
AETAMAX, JMAXF and ETAMAX. The refinement dimension can be set using HUND and
HABO to give non-dimensional distances from the still water plane in vertical direction.

ETAMAX

Deck level

UETAMAX

HUND

120(128)

AETAMAX

Still water plane

JMAXF

HABO

HUND

The non-dimensional z-coordinate of the lower grid plane of the refined free
surface interface. Default value is -0.005.

HABO

The non-dimensional z-coordinate of the higher grid plane of the refined free
surface interface. Default value is 0.015.

UETAMAX

Number of planes in the circumferential direction up to HUND location. See


section XDISTR for more information.

AETAMAX

Number of planes in the circumferential direction up to HABO location. See


section XDISTR for more information.

JMAXF

Number of planes in the circumferential direction up to the deck location. See


section XDISTR for more information.

The bow singularity has to be located below the HUND. For hulls without bulbous bow the
singularity line may need to be specified manually e.g.: singul( bow, xyzfwd = [0.025,0,-0.0263] ),
see ath_vof_def example.

Deck level

HABO
Still water plane
HUND

Bow singularity line

Now try to set the HABO and number of cells in girthwise direction to cover waves that are higher
and keep similar cell size in the free-surface refinement band.

121(128)

Tutorial 7 part 6: XCHAP post-processing


The purpose of this tutorial is to show some visualizations for XCHAP. Precomputed data sets are
used throughout the tutorial. These can be found on the course DVD.

Cutting plane, contour and vector plots.

Import CGNS file kcs_import_IGES_zonal from the course DVD. You find the import
option in the menu File | Import | Results (SHIPFLOW)
Save as a project when you are asked. (It's not mandatory for post-processing purposes)

Depending on the content in the CGNS file XCHAP results are displayed in the 3DOverView
window and XPAN/XBOUND results in the 3dView window by default. The command file and
output file are read when available. The force logs will also be imported when the log file is found.
We will start looking at the visualizations of the XCHAP results. Contours of Cp on the hull surface
and wake fraction in the propeller disk are displayed by default when available.
Display a legend:
Select Body | XCHAP_BodyContours
Open General
Add a color map, press the +
Cut the grid and show contours
Open Combined Grids | XCHAP_CombinedCut | XCHAP_CombinedCutContours
Activate visualization
Select mapped data VelocityX
(Add a legend, move it in the y-direction to Y=0)

Move the cutting plane to the propeller location


Add one cutting plane at 0.1*230
Add one more plane at 0.2*230
Switch to Colored Isolines
Choose isolines from -1.0 to 0.0 with 0.1 increments

Display velocity vectors


Hide the propeller contours
Keep the cut in the propeller plane and remove the other two
Change view so the hull is shown from behind (-x)
Choose Black Isolines on Colored Surface for the CombinedCutContours
Select XCHAP_CombinedCut and add a VectorVisualization
Change the following in the VectorVIsualization editor:
Vector Field Type: Tangential to Surface
Minimum Vaector Distance to 0.2
Length Scale to 2
Arrow Type to Arrow
Vector Color to Black
Mirror the picture

122(128)

Open Visualization Toolbox and hide the PressureCoefficient legend

Display velocity vectors on the hull surface


Hide all visualizations but Body | XCHAP_Body_Contours
Select Body and create a new VectorVisualization tool
Change the Length Scale to 20, the Arrow Type to Arrow and set the Vector Color to Black
Zoom in close to the stern

Try also to use a Constant Length for the vectors and apply a suitable Length Scale
123(128)

Trace and display streamlines

Turn off XCHAP_VectorVisualization


Activate XCHAP_PropellerContours and XCHAP_BodyContours
Select Component Grids | XGRID_1 and create a Streamlines tool
Set Seed Points to [4.1,-1,-6] and the Number of Streamlines Per Point to 25 and the
Distribution Radius to 2

Set the Scale Factor to 0.5 in the Display Options

Visualize the convergence history of XCHAP.

First open the PlotViewer from the View | Windows |menu.

Next open the Computations & Results | kcs_import_IGES_zonal | XCHAP | Iteration


History | Fx_p and toggle it on. This quantity is the integrated pressure force in the xdirection and is the most suitable quantity to judge the convergence of the computation. The
notations of the integrated forces and moments are F=force, M=moment, p=pressure,
f=friction and x,y,z are the directions.

124(128)

Visualization VOF
This tutorial will show how to visualize the free surface and wave cuts for a viscous free surface
solution from XCHAP. The result files are call named kcs_vof_def and can be found on the course
DVD. This computation is made with a very coarse grid (xchap|size(VCOARSE)).
Wave contours
Open a new session or close the current.
Import the solution by selecting File | Import | Results (SHIPFLOW) in the menu. Open
the kcs_vof_def from the coarse DVD.
The wave pattern is displayed by default in the 3DOverview window. Select a top view
Select the Computations & Results | kcs_vof_def | XCHAP | Free Surface |
XCHAP_FreeContours in the object tree and change the number of Divisions to 25.

Create also a legend by adding a Color Map in the General section

Wave cuts
Create a PlaneCut in the Free Surface object and set the Y-value to -0.1
Create a 2DPlotCurve in the new PlaneCut object
Create a 2Dplot in the 2DPlotCurve object

125(128)

Open the the PlotViewer window from the Menu View | Windows | PlotViewer which
shows the wave cut at Y=-0.1

Add a series of of Y-positions -0.1,-0.2,-0.3 in the PlaneCut tool

126(128)

Tutorial 7 part 7 XCHAP Rudder


The following part of the tutorial shows a simple example of a set up for a ship with a rudder. The
hull grid is made very coarse to simplify the execution of the tutorial. A real case must be run with a
finer grid.

Import configuration file hamb_rudd from the shipflow examples directory


Change the following in the XCHAP section
Remove the ACTUATOR command
Set the number of iterations to zero
Change the following in the XFLOW section
Add an ID to the RUDDER command and assign it the name Rudder
Study the parameters for the rudder
Check that the SYMMETRY is set to NOSYM

Run XCHAP and observe the output

XCHAP was run with the maximum number of iterations set to zero. The program exited after the
grids, the overlapping grid classification and the initial flow field were computed. The number of
discretization, interpolation and outside cells are printed. We can see that in this case about 28000
cells were used for interpolation between the grids, 8000 cells are located inside the rudder or ship
and the remaining 400000 cells were used for the discretization.
Next we will see how the classification can be visualized in the different component grids.

Select Object Tree | Connections | Computations & Results | comp | XCHAP |


Component Grids | Xgrid_1 | XCHAP_ClassificationPoints and activate first the
interpolation points. Cells in the hull grid close to the rudder are all classified as
interpolation points.
Next activate the outside points and change the view angle so that you can look inside the
rudder from above. Cells in the hull grid inside the rudder are marked as outside cells.
127(128)

This tutorial gives a first impression on overlapping grids and how it is used to set up complexed
geometries. More information on appendages and overlapping grids can be found in the
SHIPFLOW Design Tutorials Advanced.

128(128)

You might also like