Skip to content

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:

C:\FLOWTECH\SHIPFLOW<version>-x86_64\examples\geometry\tkcs.igs

Part 1: Import and Prepare the Geometry

1.1 Import the IGES File

  1. Launch SHIPFLOW Design5.
  2. Go to Import → IGES, navigate to C:\FLOWTECH\SHIPFLOW<version>-x86_64\examples\geometry\, select tkcs.igs and click Open.
  3. 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.

  1. Select all imported surfaces: press Ctrl+A in the 3DView, or drag a selection rectangle around the whole hull.
  2. In the CAD ribbon, go to Surfaces → Surface Based and click Surface Group.

    CAD ribbon with Surfaces, Surface Based and Surface Group highlighted; the tooltip explains that a surface group can be exported as one set of surfaces

  3. The group is created with the default name grp1.


Part 2: Configure XPAN for the Twin-Skeg Hull

2.1 Create a SHIPFLOW Setup

  1. Switch to the Connect workspace (left sidebar).
  2. In the Connection tab, click Shipflow (group Computations).

    Shipflow button in the Connection tab; the new configurationShf1 and shfComputation1 appear in the Object Tree

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.

  1. In the Object Tree, select Configurations → configurationShf1 → xflow.
  2. In the Object Editor, find offset and click + to add the command.
  3. Under offset, add the parameters lpp and zori and set them to 260 and 15.
  4. Add the parameter iges.
  5. Switch to Model (left sidebar) and drag the name grp1 from the Object Tree into the iges field of offset.
  6. Complete the value so that it reads:

    grp1.exportIGES("tw.igs")
    
  7. 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

  1. Select configurationShf1 → xflow → vship.
  2. Add the parameter vknot and set it to 23 (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

  1. Select configurationShf1 → xflow → hull.
  2. Add the following parameters:

    Parameter Value Meaning
    shiptype twin Twin-skeg hull (keyword TWINSKEG in the user manual)
    xmdens coarse Coarse panel density (BDENS = FDENS = 0.5), for a quick run
    fsflow fsflow Include 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

  1. Select configurationShf1 → xflow → program.
  2. Choose xpan in 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

  1. In the Object Tree, right-click Configurations → configurationShf1 and select Show Preview of Input File.

    Context menu of configurationShf1 with Show Preview of Input File

  2. 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 )
    end
    

    For iges, the preview shows the file name tw.igs that the expression grp1.exportIGES("tw.igs") produces.

  3. Save the project (Ctrl+S).


Part 3: Run the Computation

3.1 Start the Run

  1. Select Computations → shfComputation1.
  2. Click the Run button Run button.
  3. Follow the progress in the TaskMonitor. SHIPFLOW first generates the offset file and then starts the XPAN iterations:

    TaskMonitor during the run: the offset generator reports the hull type twin and the location of the written offset file, then XPAN starts iterating

3.2 What Happens during the Run

The conversion is automatic, but it helps to know what goes on behind the scenes:

  1. The surface group grp1 is exported to the IGES file tw.igs.
  2. SHIPFLOW translates the IGES file into an STL file (a triangulated surface).
  3. From the STL file, SHIPFLOW creates the offset file off_tw: the hull described by sections (stations), arranged in offset groups.
  4. 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

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

  3. 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:

Project folder after the run: tut3, manual_results, baseline and shfComputation1, which contains configurationShf1_REPORT and configurationShf1_RUN_DIR

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
  • offs now refers to the generated offset file (file="../off_tw", one folder above the run directory) instead of the IGES file.
  • hull lists the offset groups. Most importantly, this shows which offset station group corresponds to which XMESH panel group. The keywords ending in go and gi name the outer and inner parts of the hull (see HULLTYPE).
  • flui and vshi contain the fluid properties (here the default, sea water at 15 °C) and the Reynolds and Froude numbers that SHIPFLOW computed from your input.
  • The xgri section 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:

SHF_Import_off_tw|as_off_tw.exportSHF("off_tw")

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_tw before it computed the flow.
  • A twin-skeg hull needs shiptype = twin in hull. 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_DIR folder 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 = twin is set in hull.
  • 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

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