Tutorial 3: Automatic Generation of Offset Files — Twin-Skeg Example¶
Overview¶
In this tutorial you run XPAN directly on the IGES geometry of a twin-skeg container ship. Before it computes the flow, SHIPFLOW converts the geometry into an offset file automatically. You then look at the files that the run creates and at how the generated offset file can be reused.
Time required: 15 minutes
Difficulty: Intermediate
Prerequisites: Complete Tutorial 1 first
SHIPFLOW modules used: XPAN
Learning Objectives¶
By completing this tutorial, you will be able to:
- Import an IGES geometry that consists of many surfaces and collect the surfaces in a surface group
- Set up XPAN for a twin-skeg hull
- Let SHIPFLOW generate the offset file from the IGES geometry
- Find your way in the project directory that SHIPFLOW creates
- Distinguish the configuration written by the GUI from the final configuration used in the run
- Reuse the generated offset file in later computations
Case Data¶
The hull is a twin-skeg container ship: instead of a single skeg on the centreline, it has two skegs at the stern. The computation uses the following values:
| Quantity | Value | Set with |
|---|---|---|
| Reference length (Lpp) | 260 m | lpp in offset |
| Draught | 15 m | zori in offset |
| Speed | 23 knots | vknot in vship |
| Scale factor | 1 (full scale, the default) | scale in vship (not set) |
Tutorial Files¶
The geometry file is part of your SHIPFLOW installation:
Part 1: Import and Prepare the Geometry¶
1.1 Import the IGES File¶
- Launch SHIPFLOW Design5.
- Go to Import → IGES, navigate to
C:\FLOWTECH\SHIPFLOW<version>-x86_64\examples\geometry\, selecttkcs.igsand click Open. - Press F10 (Zoom Extent) to fit the geometry in the view.
The file describes the port side of the hull, including the port skeg, with many surfaces. All of them are imported together.
1.2 Save the Project¶
Click Save and name the project tut3.
SHIPFLOW Design5 saves the project database tut3.cdb and creates the project folder tut3 next to it. The folder receives all configurations and results of the project (see Part 4).
1.3 Create a Surface Group¶
In Part 2 the offset command exports the geometry to SHIPFLOW as one IGES file. A surface group makes this possible: it collects a set of surfaces so that they can be exported at once.
- Select all imported surfaces: press Ctrl+A in the 3DView, or drag a selection rectangle around the whole hull.
-
In the CAD ribbon, go to Surfaces → Surface Based and click Surface Group.
-
The group is created with the default name
grp1.
Part 2: Configure XPAN for the Twin-Skeg Hull¶
2.1 Create a SHIPFLOW Setup¶
- Switch to the Connect workspace (left sidebar).
-
In the Connection tab, click Shipflow (group Computations).
The Object Tree now contains the configuration configurationShf1 (under Configurations) and the computation shfComputation1 (under Computations). You make all of the following settings in configurationShf1.
2.2 Offset: Link the Geometry¶
- In the Object Tree, select Configurations → configurationShf1 → xflow.
- In the Object Editor, find
offsetand click + to add the command. - Under
offset, add the parameterslppandzoriand set them to260and15. - Add the parameter
iges. - Switch to Model (left sidebar) and drag the name
grp1from the Object Tree into theigesfield ofoffset. -
Complete the value so that it reads:
-
Click Evaluate (checkmark icon).
| Parameter | Value | Meaning |
|---|---|---|
lpp |
260 |
Reference length in metres, normally the length between perpendiculars. The geometry is made non-dimensional with it. |
zori |
15 |
Draught in metres: the height at which the undisturbed free surface lies in the coordinate system of the geometry |
iges |
grp1.exportIGES("tw.igs") |
Exports grp1 to the IGES file tw.igs, which SHIPFLOW converts into an offset file |
When the geometry is given as an IGES file, SHIPFLOW also sets the hull groups of the hull command automatically. See OFFSETFILE for all keywords of offset.
2.3 Speed¶
- Select configurationShf1 → xflow → vship.
- Add the parameter
vknotand set it to23(ship speed in knots).
No scale factor needed
Unlike Tutorial 1, this tutorial does not set scale. SHIPFLOW then uses the default scale = 1, so the computation is made at full scale (VSHIP).
2.4 Hull Type, Panel Density and Free Surface¶
- Select configurationShf1 → xflow → hull.
-
Add the following parameters:
Parameter Value Meaning shiptypetwinTwin-skeg hull (keyword TWINSKEGin the user manual)xmdenscoarseCoarse panel density ( BDENS=FDENS= 0.5), for a quick runfsflowfsflowInclude the free surface, and so the waves, in the potential flow computation
See HULLTYPE for all keywords of hull.
Set the ship type
Without shiptype = twin, SHIPFLOW treats the hull as a mono hull, the default ship type. The offset file of a twin-skeg hull is split into inner and outer offset groups (see 4.3 and Offset file format for twin skeg hulls).
2.5 Program¶
- Select configurationShf1 → xflow → program.
- Choose
xpanin the drop-down list and click +.
With xpan in program, SHIPFLOW runs XMESH first to create the panel mesh and then XPAN (PROGRAM).
2.6 Check the Configuration¶
-
In the Object Tree, right-click Configurations → configurationShf1 and select Show Preview of Input File.
-
The preview opens in the Configuration_Preview tab. It should read:
xflow title( title = "shipflow" ) program( xpan ) vship( vknot = 23 ) hull( twin,fsflow,coarse ) offset( iges = "tw.igs",lpp = 260,zori = 15 ) endFor
iges, the preview shows the file nametw.igsthat the expressiongrp1.exportIGES("tw.igs")produces. -
Save the project (Ctrl+S).
Part 3: Run the Computation¶
3.1 Start the Run¶
- Select Computations → shfComputation1.
- Click the Run button
. -
Follow the progress in the TaskMonitor. SHIPFLOW first generates the offset file and then starts the XPAN iterations:
3.2 What Happens during the Run¶
The conversion is automatic, but it helps to know what goes on behind the scenes:
- The surface group
grp1is exported to the IGES filetw.igs. - SHIPFLOW translates the IGES file into an STL file (a triangulated surface).
- From the STL file, SHIPFLOW creates the offset file
off_tw: the hull described by sections (stations), arranged in offset groups. - The offset file is handed over to the flow computation: XMESH creates the panel mesh from it and XPAN computes the potential flow with the free surface.
3.3 View the Results¶
-
Open the TableViewer (if it is not visible: View → New → Viewer → Table Viewer) to see the computed values. With the coarse panel mesh, this case gives:
Result Value Description Wave resistance coefficient, CW 0.289E-03 Trim angle (degrees) -0.278E-01 Negative value: bow down Sinkage -0.160E-02 At Lpp/2 -
The wave pattern is shown in the 3DView. To change the visualisation, go to Connect → Post-Processing → Results → shfComputation1 → XPAN. There you can also display the pressure distribution on the hull and the skegs.
- Save the project (Ctrl+S).
Part 4: Files Created by the Run¶
4.1 Project Directory¶
SHIPFLOW stores everything that belongs to a computation in the project folder. For the project tut3, saved in a folder tutorial_3, the folders after the run are:
The main items are:
| Folder or file | Contents |
|---|---|
tut3.cdb |
The project database, next to the folder tut3. You need it to reopen the project in SHIPFLOW Design5, so keep it together with the project folder. |
baseline |
Results of the design baseline, in tut3\manual_results |
shfComputation1 |
Computation folder, tut3\manual_results\baseline\shfComputation1. It holds the configuration file configurationShf1 written by SHIPFLOW Design5 and the offset file off_tw generated from the IGES geometry. |
configurationShf1_RUN_DIR |
Run directory, inside the computation folder. The SHIPFLOW solver runs here and stores temporary solutions here. It also holds the final configuration (see 4.3). |
configurationShf1_REPORT |
The automatic report generated by XPOST, inside the computation folder |
The folder names come from the names in the project: the design (baseline), the computation (shfComputation1) and the configuration (configurationShf1). If you use other names, the folders are named accordingly.
4.2 GUI Configuration¶
After the run, there are two configuration files named configurationShf1. The first one, shfComputation1\configurationShf1, is the configuration as written by SHIPFLOW Design5. It contains exactly the settings you made in the GUI, as shown in the preview in 2.6: the geometry is given as the IGES file tw.igs, and hull contains no offset groups.
4.3 Final Configuration¶
The second file, shfComputation1\configurationShf1_RUN_DIR\configurationShf1, is the final configuration used in the calculation. Most commands appear abbreviated to their first four letters (for example offs for offset), and SHIPFLOW has added the information it generated or computed. In the listing below, ... marks paths and long numbers that are shortened here; they depend on your computer.
xflo
titl(titl="shipflow")
prog(xpan)
hull(twin,fsfl,coar,h1go="f_main",h2go="o_main",h2gi="i_main",fbgo="bulb",abgo="o_boss",abgi="i_boss",ogro="aft")
offs(lpp=260,zori=15,ysig=1,xaxd=-1,xori=260.0,file="../off_tw")
flui(sea,temp=15.0,dens=1026.02...,visc=1.1892e-06,grav=9.8066...)
vshi(rn=2.586930522853833e09,fn=0.234325366963336,refl=260.0)
control(exepath="...",runid="configurationShf1_RUN_DIR",rundir="...")
end
xpan
para(nthr=7)
end
xchap
kryl(eqsc=100)
xgri(stre)
control(ahr=100,rmod=4,ks=7.692307692307693e-08)
end
xgri
yplu(ytar=200)
offs(h1go="o_main",h1gi="i_main",h1gr="f_g_main",h2gr="main",fbgr="bulb",abgo="o_boss",abgi="i_boss",ogro="o_aft",ogri="i_aft")
end
offsnow refers to the generated offset file (file="../off_tw", one folder above the run directory) instead of the IGES file.hulllists the offset groups. Most importantly, this shows which offset station group corresponds to which XMESH panel group. The keywords ending ingoandginame the outer and inner parts of the hull (see HULLTYPE).fluiandvshicontain the fluid properties (here the default, sea water at 15 °C) and the Reynolds and Froude numbers that SHIPFLOW computed from your input.- The
xgrisection contains a different set of offset groups, for XGRID.
Different offset groups for XMESH and XGRID
XFLOW (XMESH and XPAN) and XGRID use different offset groups, because XMESH and XGRID have different requirements on the arrangement of the offset stations.
4.4 Reusing Generated Offset Files¶
Every run from an IGES file starts by generating the offset file again. If you plan several computations for the same hull, it pays off to generate the offset file once and reuse it. There are two ways to do this.
Import the final configuration. Go to Import → Configuration (SHIPFLOW) and select the file configurationShf1 in the run directory configurationShf1_RUN_DIR (inside tut3\manual_results\baseline\shfComputation1). This configuration already uses the generated offset file and contains the offset group names. It also contains some commands that the GUI does not recognise; ignore the error message about them. Tutorial 1, Part 3, shows how a configuration is imported.
Reference the offset file in your own configuration. Import the offset file off_tw from the folder shfComputation1 with Import → Offset File. Then link it to the parameter file of offset, instead of iges, as in Tutorial 1, Part 4. The value then reads:
When the geometry is given as an offset file, SHIPFLOW does not set the hull groups automatically. Copy the offset group names from the hull command of the final configuration into your hull command.
Summary¶
- You ran XPAN directly on an IGES geometry. SHIPFLOW exported the surface group, translated it into an STL file and generated the offset file
off_twbefore it computed the flow. - A twin-skeg hull needs
shiptype = twininhull. Its offset file is split into inner and outer offset groups. - The computation folder holds the configuration written by the GUI and the generated offset file. The
_RUN_DIRfolder holds the final configuration, which shows the offset groups used for each panel group. - For further computations on the same hull, reuse the generated offset file instead of converting the IGES geometry again.
Troubleshooting¶
Poor Offsets or Panels around the Skegs¶
- Check that
shiptype = twinis set inhull. - Check the geometry for degenerate surfaces (zero area) between the skegs.
General troubleshooting
Problems that can occur in any SHIPFLOW case are collected on one page: Troubleshooting.
Directly relevant to this tutorial:
Next Steps¶
- Tutorial 4: Boundary Layer Calculations with XBOUND adds a boundary layer computation to the potential flow.
- Tutorial 5: Grid Generation for the Viscous Flow Solver XCHAP, Part 2, generates XGRID grids and runs XCHAP for a twin-skeg hull.
- Reference: OFFSETFILE, HULLTYPE and Offset file format for twin skeg hulls in the user manual.
Getting help: send questions to [email protected]. More about SHIPFLOW: https://shipflow.se.
Tutorial updated: May 2026
SHIPFLOW version: 8.0.37
Document version: 2.0




