Skip to content

Tutorial 4: Boundary Layer Calculations with XBOUND

Overview

This tutorial shows how to compute the boundary layer on a hull with XBOUND. You add XBOUND to an XPAN computation, set the Reynolds number through the scale factor and the fluid properties, and look at the friction coefficient and the streamlines. You then control where the streamlines are traced and add limiting streamlines.

Time required: 30 minutes
Difficulty: Intermediate
Prerequisites: Complete Tutorial 1 first
SHIPFLOW modules used: XPAN, XBOUND


Learning Objectives

By completing this tutorial, you will be able to:

  • Add a boundary layer computation with XBOUND to an XPAN computation
  • Set the Reynolds number through the scale factor and the fluid properties
  • Read the friction coefficient and the related results
  • Control where the streamlines start and how they are distributed around the girth
  • Trace and display limiting streamlines

About XBOUND

XBOUND computes the thin turbulent boundary layer on the hull. It solves the momentum integral equations of the boundary layer along streamlines traced in the potential flow computed by XPAN. For simpler cases with a well-defined stagnation point or line, XBOUND can also compute the laminar boundary layer and the transition to turbulent flow. The surface can be smooth or have a specified roughness.

Among the quantities XBOUND computes are the boundary layer thickness, the displacement and momentum thickness, the shape factor, the cross-flow angle, the skin friction coefficient and limiting streamlines. The skin friction is integrated over the hull, or over a specified region of it, to the friction coefficient CF.

XPAN and XBOUND work together: XPAN computes the potential flow and saves the results that XBOUND needs in a database file (id_XPDB, where id is the name of the configuration). XBOUND reads this file.

Where the thin boundary layer approximation applies

XBOUND assumes that the boundary layer is thin compared with the hull. This holds over the forward and middle part of most hulls. Towards the stern the boundary layer grows quickly, which limits the accuracy of XBOUND there: do not rely on XBOUND results aft of the aft shoulder. The flow at the stern is computed with the RANS solver XCHAP, see Tutorial 5.

All commands and keywords are described in XBOUND commands in the user manual.


Tutorial Files

The configuration file for this tutorial is in your SHIPFLOW installation:

C:\FLOWTECH\SHIPFLOW<version>-x86_64\tutorials\tutorial-files\BasicTraining\Tutorials-v5\Tutorial_4\source\config

Part 1: Boundary Layer Computation with XPAN and XBOUND

1.1 Import the Configuration

  1. Launch SHIPFLOW Design5.
  2. Go to Import → Configuration (SHIPFLOW), navigate to the folder Tutorial_4\source shown under Tutorial Files, select config and click Open.

    Imported configuration config in the Object Tree, with the preview of its input file

  3. Save the project as tut4_part1.

The configuration describes the Hamburg Test Case, a container ship with lpp = 153.68 m, at 18 knots. It is set up to run XPAN. Two of its commands are new compared with the previous tutorials:

  • ipos (IPOSITION) specifies the initial position of the ship. Here it gives the draughts at the forward and aft perpendiculars, tf = 9.2 and ta = 10.3 (m), that is, the trim.
  • prtopt (PRTOPT) requests additional output from XMESH, XPAN and XBOUND. The keyword strlres writes the streamline coordinates and detailed XBOUND results to a separate file (see 3.5).

1.2 Switch Off the Free Surface

This tutorial does not need the free surface, so XPAN computes the flow without it (double-body flow).

  1. Select Configurations → config → xflow → hull.
  2. Add the parameter fsflow and set it to nofsfl.

    hull command with fsflow set to nofsfl

With nofsfl, the water surface is treated as a plane of symmetry: the flow is computed around the hull and its mirror image above the waterline, so there are no waves.

XBOUND and the free surface

By default, XBOUND uses the double-model solution from XPAN. With the keyword freesurface on the control command in the xbound section, it uses the linear free-surface solution instead; use this only in combination with the linear free-surface option in XPAN. See CONTROL.

1.3 Add XBOUND to the Program

  1. Select Configurations → config → xflow → program.
  2. Add xbound from the drop-down list with +. It is listed as xbou, also in the preview.

    xbou added to the program command; the preview shows program( xpan,xbou )

SHIPFLOW runs the modules in a fixed order, whatever their order in program: XMESH, XPAN, then XBOUND (PROGRAM).

1.4 Set the Model Scale

The boundary layer computation needs a Reynolds number. SHIPFLOW computes it from the speed, the scale factor (or the reference length) and the viscosity of the fluid. The speed is already set (vknot = 18). The default scale factor is 1, meaning full scale with the reference length equal to Lpp. This tutorial uses model scale 1:24.

  1. Select Configurations → config → xflow → vship.
  2. Add the parameter scale and set it to 24.

    vship command with scale = 24; the preview shows vship( vknot = 18,scale = 24 )

The geometry and the speed stay at ship scale; scale = 24 makes SHIPFLOW run the case at model scale (VSHIP). For this case, the Reynolds number is of the order of 10⁷ at model scale 1:24, compared with 10⁹ at full scale.

1.5 Set the Fluid Properties

The default fluid is sea water at 15 °C. To simulate the conditions in a towing tank, use fresh water at 20 °C.

  1. Select Configurations → config → xflow, find fluid in the Object Editor and click +.
  2. Under fluid, add type and set it to fresh, and add temp and set it to 20.

    fluid command with type = fresh and temp = 20

Setting Default This tutorial
Water type (type) sea fresh
Temperature in °C (temp) 15 20

SHIPFLOW derives the density and the viscosity from the water type and the temperature. The viscosity converts the speed into the Reynolds number, so it affects the boundary layer and the friction coefficient (FLUID).

1.6 Run the Computation

  1. Select Computations → shfComputation1 and click the Run button Run button.

    shfComputation1 selected in the Object Tree, with the Run button highlighted in the Object Editor

  2. Follow the progress in the TaskMonitor: XMESH creates the panel mesh, XPAN computes the potential flow and XBOUND the boundary layer. The run usually takes less than a minute.

  3. Save the project when the run is complete (Ctrl+S).

1.7 Results and Output File

Open the TableViewer (if it is not visible: View → New → Viewer → Table Viewer):

TableViewer with the XBOUND results, including CW, Sref, CF and AREA, next to the XPAN hydrostatic data

Result Value Meaning
CW 0 Wave resistance coefficient. It is zero because XPAN was run without a free surface (nofsfl).
CF 0.003098 Friction coefficient estimated by XBOUND
Sref 0.229942 Reference area from XPAN. Use it when you rescale coefficients.
AREA 0.107 Area of the part of the hull that is covered by streamlines

The table shows non-dimensional values: lengths are divided by lpp (hence LPP = 1), areas by lpp squared.

The complete configuration used by XBOUND and some results are written to the file config_OUTPUT:

  1. Open the FileViewer (if it is not visible: View → New → Viewer → File Viewer).
  2. Select the tab config_OUTPUT.

    config_OUTPUT opened in the FileViewer

The file lists the commands and keywords that were used, with both the input values and the default values, followed by the results. In the XBOUND section you can see the streamline settings of this run; Part 2 changes some of them.

1.8 Show the Streamlines

  1. Hide the offset sections: in Model → CAD → Object Tree, click the folder icon to the right of FScope, in front of SHF_Import_off_file.

    Model tree with the folder icon of SHF_Import_off_file highlighted; clicking it hides the offset sections

  2. Go to Connect → Post-Processing → Object Tree → Results → shfComputation1 → XPAN & XBOUND to control the visualisation of the results. If the streamlines are not visible, select Potential Flow Streamlines.

    Potential Flow Streamlines selected under XPAN and XBOUND in the results tree; the streamlines are drawn on the hull

These are the potential flow streamlines along which XBOUND integrates the boundary layer equations.

1.9 Run Only XBOUND in Later Runs

XPAN saves its solution in the database file config_XPDB. Once this solution exists, you can remove xpan from program: the next time XBOUND runs, it reads the potential flow solution from the database. This saves time when you change only XBOUND settings, as in Parts 2 and 3.

When to run XPAN again

Keep xpan in program whenever you change something that affects the potential flow, for example the geometry, the position of the ship, the speed or the free-surface setting.


Part 2: Control the Streamline Tracing

This part shows how to control the streamline tracing. First you improve the spacing of the streamlines midships, then you move them away from the waterline.

2.1 Save a Copy of the Project

Save the project as tut4_part2, so that you can compare the streamline set-ups later.

2.2 How the Streamlines Are Placed

In the first run, the configuration had no xbound section. Because the hull is set up in the Standard Case mode (the hull command contains h1gr), XBOUND created streamline group 1 on the main hull automatically (HULLTYPE, note 1). The values it used are listed in the XBOUND section of config_OUTPUT: the tracing started at streamline station istart = 10, near the bow.

The streamline stations are counted from the bow. At the station where the tracing starts, the streamlines are distributed evenly around the girth, and from there they are traced downstream, upstream or in both directions. With the start near the bow, the spacing is even at the bow but not midships.

2.3 Start the Tracing Midships

  1. Add an xbound section: select Configurations → config in the Object Tree, choose xbound in the drop-down list of the Object Editor and click +.

    Adding the xbound section: config selected in the Object Tree and xbound chosen in the drop-down list of the Object Editor

    The new section appears in the tree at the same level as xflow. It already contains an inicon command, which specifies the initial conditions of the boundary layer computation (INICON).

  2. Select xbound, choose trace in the drop-down list and click +.

  3. Under trace, add group and set it to 1, and add istart and set it to 50.

    trace command in the xbound section with group = 1 and istart = 50

    Keyword Value Effect
    group 1 Trace the streamlines on panel group 1, the main hull
    istart 50 Start the tracing at streamline station 50, roughly midships. The streamlines are traced both upstream and downstream from there, and they are evenly spaced midships.
  4. In xflow → program, remove xpan (click the red cross next to it), see 1.9.

  5. Run the computation and look at the streamlines in Connect → Post-Processing:

    Streamlines traced from station 50: evenly spaced midships

Two kinds of xbound entries

xbound in xflow → program makes SHIPFLOW run XBOUND. The xbound section next to xflow holds the XBOUND commands, such as trace and limit.

2.4 Move the Streamlines Away from the Waterline

At the start station, the streamlines lie between p1 (keel-most streamline) and pn (topmost streamline). Both are given as a fraction of the girth of the panel group: 0 at its keel-most edge, 1 at its top edge. In the previous run, the topmost streamline was at pn = 0.95, close to the waterline. Lowering pn pushes all streamlines down.

  1. Select config → xbound → trace, add the parameter pn and set it to 0.85.

    trace command with pn = 0.85 added

  2. Run XBOUND again (still without xpan) and look at the result:

    Streamlines with pn = 0.85: the topmost streamline has moved down, away from the waterline

2.5 Keywords of the Trace Command

The table lists the main keywords of trace; see TRACE for all of them. The limit command in Part 3 has the same keywords, but no default for station.

Keyword Meaning Default
group Panel group on which the streamlines are traced none
stream Number of streamlines in the group none
station Number of streamline stations, that is, points per streamline 100
istart Streamline station where the tracing starts. Stations are counted from the bow: 1 traces downstream, the last station traces upstream, values in between trace in both directions. none
s1, sn Location of the first and the last streamline station, in the computational coordinate system (or in parametric space with the keyword parametric) 0, 1
p1, pn Girthwise location of the keel-most and the topmost streamline at station istart (0 = keel-most edge, 1 = top edge of the panel group) 0, 1

The defaults in the table are those of the trace command. In the Standard Case mode used here, XBOUND creates streamline group 1 with its own values (see 2.2), in this tutorial istart = 10 and pn = 0.95, and a trace command for this group changes the values it specifies. All values used in a run are listed in config_OUTPUT.

Initial conditions for each streamline group

Each trace command produces one streamline group, numbered in the order of the trace commands. XBOUND computes the boundary layer only for groups that have initial conditions, given by an inicon command with sgroup set to the group number. Streamlines without initial conditions contribute a skin friction of zero to CF. See INICON and RESISTANCE.


Part 3: Limiting Streamlines

3.1 Save a Copy of the Project

Save the project as tut4_part3.

3.2 What Limiting Streamlines Are

The streamlines used so far follow the potential flow computed by XPAN. The boundary layer computation, however, keeps track not only of the streamwise velocity in the boundary layer but also of the flow across the streamlines, that is, the velocity component orthogonal to the streamline tangent and to the surface normal. This makes it possible to trace limiting streamlines. They show the direction of the boundary layer flow as the surface is approached, which is also the direction of the skin friction (wall shear stress) on the hull.

XBOUND traces the limiting streamlines immediately after the boundary layer calculation; the velocities close to the hull are turned according to the computed cross-flow angle (LIMIT).

3.3 Add Two Limit Commands

Each limit command produces one group of limiting streamlines. You trace two groups on the forebody, both on panel group 1 and each with 10 limiting streamlines of 10 stations, traced downstream. One group lies between x/L = 0.19 and 0.21, the other between x/L = 0.09 and 0.11.

  1. Select config → xbound, choose limit in the drop-down list and click +.
  2. Under limit, add these parameters:

    Parameter Value Meaning
    group 1 Panel group 1, the main hull
    station 10 10 stations per limiting streamline
    stream 10 10 limiting streamlines
    istart 1 Start at the first station, so the tracing goes downstream
    s1 0.19 Position of the first station, x/L
    sn 0.21 Position of the last station, x/L

    limit command with group = 1, station = 10, stream = 10, istart = 1, s1 = 0.19 and sn = 0.21; the duplicate icon below the parameters is circled

  3. Create a second limit command with the duplicate icon below the parameters (circled in the screenshot). Check that it has group = 1, station = 10, stream = 10 and istart = 1.

  4. In the second limit command, set s1 to 0.09 and sn to 0.11.

3.4 Run and View the Limiting Streamlines

  1. Run the computation (XBOUND only, as before).
  2. In Connect → Post-Processing, the results of shfComputation1 now contain Limiting Streamlines next to Potential Flow Streamlines:

    Two groups of limiting streamlines, framed in red, on the forebody, drawn over the potential flow streamlines

The difference in direction between the limiting streamlines and the potential flow streamlines shows the cross-flow in the boundary layer.

3.5 Detailed Results in the STRLRES File

The imported configuration already contains prtopt( strlres ), so XBOUND also writes the file config_STRLRES with detailed results of the boundary layer integration. It is in the run directory, {project directory}\manual_results\baseline\shfComputation1\config_RUN_DIR.

The first part of the file contains, for each streamline, the coordinates, the arc lengths, the velocities at the outer edge of the boundary layer and the curvatures. The second part contains the boundary layer results along the streamlines.


Summary

  • You added XBOUND to an XPAN computation through program. Once the XPAN solution exists, XBOUND can run on its own.
  • The Reynolds number follows from the speed, the scale factor and the fluid viscosity. Here, scale = 24 and fresh water at 20 °C give towing tank conditions.
  • The TableViewer shows the friction coefficient CF, the reference area Sref and the area covered by streamlines AREA; config_OUTPUT contains all settings used.
  • The trace command in the xbound section controls the streamlines: istart sets where the tracing starts, pn the position of the topmost streamline.
  • The limit command traces limiting streamlines, which show the flow direction at the hull surface. prtopt( strlres ) writes detailed boundary layer results to a file.

Troubleshooting

Limiting Streamlines Look Unexpected

  • Limiting streamlines are expected to differ from the potential flow streamlines, because they include the cross-flow in the boundary layer.
  • Check the XPAN solution and the geometry in the region.
  • Do not trace streamlines all the way to the end of a panel section that ends in a point. The mapping to the girthwise arc-length coordinate becomes singular there, and some of the boundary layer assumptions no longer hold (see LIMIT).

General troubleshooting

Problems that can occur in any SHIPFLOW case are collected on one page: Troubleshooting.

Directly relevant to this tutorial:


Next Steps

  • Tutorial 5: Grid Generation for the Viscous Flow Solver XCHAP continues with XGRID and the RANS solver XCHAP. In the zonal approach, XCHAP uses results from XPAN and XBOUND as inflow conditions.
  • Try other values of stream, istart and pn and compare how well the streamlines cover the hull.
  • XBOUND commands in the user manual also describes roughness, for a rough hull surface, and resistance, which limits the region used for CF.

Getting help: send questions to [email protected]. More about SHIPFLOW: https://shipflow.se.


Tutorial updated: May 2026
SHIPFLOW version: 8.0.37
Document version: 1.0