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¶
- Launch SHIPFLOW Design5.
-
Go to Import → Configuration (SHIPFLOW), navigate to the folder
Tutorial_4\sourceshown under Tutorial Files, selectconfigand click Open. -
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.2andta = 10.3(m), that is, the trim.prtopt(PRTOPT) requests additional output from XMESH, XPAN and XBOUND. The keywordstrlreswrites 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).
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¶
- Select Configurations → config → xflow → program.
-
Add
xboundfrom the drop-down list with +. It is listed asxbou, also in the preview.
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.
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.
- Select Configurations → config → xflow, find
fluidin the Object Editor and click +. -
Under
fluid, addtypeand set it tofresh, and addtempand set it to20.
| 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¶
-
Select Computations → shfComputation1 and click the Run button
. -
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.
- 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):
| 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:
- Open the FileViewer (if it is not visible: View → New → Viewer → File Viewer).
-
Select the tab
config_OUTPUT.
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¶
-
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. -
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.
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¶
-
Add an
xboundsection: select Configurations → config in the Object Tree, choosexboundin the drop-down list of the Object Editor and click +.The new section appears in the tree at the same level as
xflow. It already contains aniniconcommand, which specifies the initial conditions of the boundary layer computation (INICON). -
Select
xbound, choosetracein the drop-down list and click +. -
Under
trace, addgroupand set it to1, and addistartand set it to50.Keyword Value Effect group1Trace the streamlines on panel group 1, the main hull istart50Start the tracing at streamline station 50, roughly midships. The streamlines are traced both upstream and downstream from there, and they are evenly spaced midships. -
In xflow → program, remove
xpan(click the red cross next to it), see 1.9. -
Run the computation and look at the streamlines in Connect → Post-Processing:
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.
-
Select config → xbound → trace, add the parameter
pnand set it to0.85. -
Run XBOUND again (still without
xpan) and look at the result:
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.
- Select config → xbound, choose
limitin the drop-down list and click +. -
Under
limit, add these parameters:Parameter Value Meaning group1Panel group 1, the main hull station1010 stations per limiting streamline stream1010 limiting streamlines istart1Start at the first station, so the tracing goes downstream s10.19Position of the first station, x/L sn0.21Position of the last station, x/L -
Create a second
limitcommand with the duplicate icon below the parameters (circled in the screenshot). Check that it hasgroup = 1,station = 10,stream = 10andistart = 1. - In the second
limitcommand, sets1to0.09andsnto0.11.
3.4 Run and View the Limiting Streamlines¶
- Run the computation (XBOUND only, as before).
-
In Connect → Post-Processing, the results of
shfComputation1now contain Limiting Streamlines next to 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 = 24and fresh water at 20 °C give towing tank conditions. - The TableViewer shows the friction coefficient
CF, the reference areaSrefand the area covered by streamlinesAREA;config_OUTPUTcontains all settings used. - The
tracecommand in thexboundsection controls the streamlines:istartsets where the tracing starts,pnthe position of the topmost streamline. - The
limitcommand 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:
- XBOUND does not start
- Streamlines do not cover the whole hull —
stream,istartandpn - Friction coefficient looks wrong — including the ITTC-1957 comparison
- The computation takes much longer than expected
- Results are unrealistic or differ from expectation
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,istartandpnand compare how well the streamlines cover the hull. - XBOUND commands in the user manual also describes
roughness, for a rough hull surface, andresistance, 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
















