KCS in Calm Sea¶
This tutorial runs the KCS container vessel in calm water and reads the resulting resistance from the
OUTPUT file. It is the baseline for the KCS in Waves tutorial — added resistance is
obtained by running both and subtracting.
SHIPFLOW modules used: MOTIONS
Configuration¶
Two example configuration files are given below which do the same thing. The only difference is that the first starts from an IGES geometry and the second starts from an offset geometry. Use either one.
kcs_calm_from_iges
xflow
titl( titl="KCS" )
prog( motions )
hull( mono )
offs( iges="kcs.igs", lpp=230, zori=10.8 )
mass( zcg=14.3, kyy=57.87 )
vshi( vknot=24, reflen=230 )
fixe( surge )
end
xptd
para( nthr=6 )
end
kcs_calm_from_offset
xflow
titl( titl="KCS" )
prog( motions )
hull( mono )
offs( file="off_kcs", lpp=230, zori=10.8 )
mass( zcg=14.3, kyy=57.87 )
vshi( vknot=24, reflen=230 )
fixe( surge )
end
xmtd
body( name="main", main )
body( name="bulb", bulb )
body( name="boss", boss )
body( name="aft", aft )
body( name="tran", tran )
end
xptd
para( nthr=6 )
end
The setup¶
XFLOW:TITL contains the title of the configuration. XFLOW:PROG:MOTIONS specifies that the SHIPFLOW
module MOTIONS should be run. Since KCS is a monohull, XFLOW:HULL:MONO is set.
If you are starting from the KCS geometry described by the offset file off_kcs, you should set
XFLOW:OFFS:FILE to "off_kcs". If you are starting from the KCS geometry described by the IGES file
kcs.igs, you should set XFLOW:OFFS:IGES to "kcs.igs".
The origin of the geometry for the hull should always be at the intersection between AP and the keel
line, with the x-axis pointing forward and the z-axis pointing upwards. XFLOW:OFFS:ZORI=10.8 means
that z is shifted 10.8 m in the computation and hence the draught is 10.8 m. LPP is 230 m so
XFLOW:OFFS:LPP is set to that.
XFLOW:MASS:ZCG=14.3 specifies the vertical center of gravity to 14.3 m above the keel. Since we do
not specify the longitudinal CG or the mass, MOTIONS will assume that the hull is at equilibrium at
zero speed and compute them from hydrostatic force balance.
This is a symmetric setup, which means that the hull is fixed in sway, roll and yaw (and that just
half the hull is used in the simulation). In addition XFLOW:FIXED:SURGE also prohibits the hull from
surge motions. Hence, only heave and pitch are allowed. XFLOW:MASS:KYY is set to 57.87 m.
The offset file off_kcs contains the groups main, bulb, boss, aft and tran, which describe
the entire hull. These groups are imported by name via the keyword XMTD:BODY:NAME. The other keyword
in XMTD:BODY tells the program what kind of offset group it is, so that a good panelization can be
created. If instead you are using an IGES file, there is no need to set up anything in the XMTD module
since it is handled automatically.
Since XFLOW:HULL:XMMANU is not present, MOTIONS tries to optimize the panelization for both the hull
and the free surface automatically. For instance, on the hull the panelization is refined around the
free surface, bow and stern and in regions with large surface curvature. In addition, criteria to
refine the free surface panels are set up so that waves are resolved near the hull without wasting
panels in the far field.
Adjust XPTD:PARA:NTHR to the number of cores on your computer and you are ready to start this
simulation.
Computation time
The computational time is a couple of hours on a good workstation.
Description of the computation¶
When the computation starts, the hull panelization is created and the hull is placed in water at rest. A hydrostatic computation is done to determine the hull's LCG and mass if it isn't already specified in the configuration file. The hull panelization is henceforth kept the same throughout the rest of the computation.
A free surface mesh is then created by starting out from a Cartesian mesh and removing free surface panels completely inside the hull, and splitting up free surface panels which intersect the hull into four panels. When the panels have reached a certain size, the splitting stops and the free surface panels closest to the hull are skewed to close the gap between the free surface and the hull.
The hull is then towed up to the specified speed and after that the speed is kept constant, since
surge is fixed in the configuration file. As the computation progresses the waves will start to
appear, and in order to resolve these waves the free surface panels will now also be refined based on
the local curvature of the free surface.
The free surface mesh is regenerated each time step and, depending on where the hull is and the waves are, the mesh will be different.
Since no simulation time is specified in this configuration, the hull will be run about 10 ship-lengths.
Terminal output — beginning and end of the run
Reading offset files...
Configuration: kcs_calm
Offset file name:../off_kcs
Parsing offset file...
Offset group found: MAIN
Offset group found: BULB
Offset group found: AFT
Offset group found: BOSS
Offset group found: BOW
Offset group found: TRAN
Preparing body groups...
Configuration: kcs_calm
Setting up body group MAIN
Offsets found
Setting up body group BULB
Offsets found
Setting up body group BOSS
Offsets found
Setting up body group AFT
Offsets found
Setting up body group TRAN
Offsets found
Number of transoms: 1
Removing any existing PVD- and VTU-files...
Initializing...
Time step size based on nominal Courant number.
Max simulation time set to correspond to
a sailed distance of approximately 10*LPP.
Max. time [s] : 186.2851
Time step size [-] : 0.0120
Time step size [s] : 0.0582
Max. Courant number [-] : 0.5000
Rigid body number: 1
Configuration: kcs_calm
Checking hydrostatic x-,y-force imbalance
Imbalance in x-direction [N] : 75.184
Imbalance in y-direction [N] : 0.000
Zeroing x-,y-forces with force imbalance
Reference length [m]: 230.000
Computed displacement [m3]: 51930.503
Computed mass [kg]: 53281787.126
Computed LCG% (fwd +): -1.503
Computed XCG [m]: 111.542
Computed YCG [m]: 0.000
User defined VCG [m]: 14.300
Water density [kg/m3]: 1026.021
******************************************
Beginning time step number : 1
Time step size [-] : 0.0120
Time step size [s] : 0.0582
Transom ID : 1
- Emerged
- Clearance factor : 1.000
Total number of active panels : 3903
- Free surface : 823
- Body surface : 3080
Distance sailed [m] : 0.000
Current speed [m/s] : 0.003
Current speed [kn] : 0.006
Current speed [Fn] : 0.000
Elapsed simulation time [s] : 0.058
Iteration wall-clock time [s] : 1.636
******************************************
.....
******************************************
Beginning time step number : 3199
Time step size [-] : 0.0120
Time step size [s] : 0.0582
Transom ID : 1
- Fully ventilated
- Clearance factor : 1.000
Total number of active panels : 5064
- Free surface : 1836
- Body surface : 3228
Distance sailed [m] : 2268.214
Current speed [m/s] : 12.347
Current speed [kn] : 24.000
Current speed [Fn] : 0.260
Elapsed simulation time [s] : 186.227
Iteration wall-clock time [s] : 1.691
************* Saving state... ************
SHIPFLOW started: 2022-02-12 at 20:02:30, ended: 2022-02-12 at 21:25:26
Post-processing¶
When the computation is done, you can start to post-process your results. In the file
kcs_calm_OUTPUT you can find the settings the configuration was run with (both the default values
and your own settings), hull data, and integrated values such as the resistance and the RAOs.
Below is some of the content in the OUTPUT file.
Hull data:
#######################################################################
HULL DATA
#######################################################################
+++++++++++++++++++++++++++
RIGID BODY NO. 1 (MASTER)
+++++++++++++++++++++++++++
LPP ( reference length [m] ) : 230.000
B ( breadth [m] ) : 32.229
V ( volume displacement [m^3] ) : 51930.503
S ( wetted surface area [m^2] ) : 9565.233
m ( mass [kg] ) : 53281787.126
LCG% ( longitudinal CG rel. L/2, fwd+ [%LPP] ) : -1.503
XCG ( longitudinal CG [m] ) : 111.542
YCG ( lateral CG [m] ) : 0.000
ZCG ( vertical CG [m] ) : 14.300
KXX ( roll radius of gyration [m] ) : 11.280
KYY ( pitch radius of gyration ) : 57.870
KZZ ( yaw radius of gyration [m] ) : 57.500
KXY ( sqrt(IXY/m) [m] ) : 0.000
KXZ ( sqrt(IXZ/m) [m] ) : 0.000
KYZ ( sqrt(IYZ/m) [m] ) : 0.000
IXX ( roll moment of inertia [kg m^2] ) : 596712.236
IYY ( pitch moment of inertia [kg m^2] ) : 3061323.000
IZZ ( yaw moment of inertia [kg m^2] ) : 3041750.000
IXY ( XY product of inertia [kg m^2] ) : 0.000
IXZ ( XZ product of inertia [kg m^2] ) : 0.000
IYZ ( YZ product of inertia [kg m^2] ) : 0.000
Post-processing summary:
+++++++++++++++++++++++++++
RIGID BODY NO. 1 (MASTER)
+++++++++++++++++++++++++++
Post-processing mode :Calm water
Time at start of analysis [s] : 75.562
Time at end of analysis [s] : 186.227
Time sailed [s] : 110.665
Distance sailed [m] : 2268.214
Average tow spring extension [m] : N/A
Average tow force [N] : N/A
Number of wave encounters (zero up-crossings) : 0
Resistance summary:
-----------------------------------------------------------------------
RESISTANCE SUMMARY
-----------------------------------------------------------------------
Definitions of resistance components
-----------------------------------
RT = RW + RF : Total resistance
RW : Wave resistance from pressure
integration
RF = RF0 * (1 + k) : Friction resistance
RF0 = 1/2 * rho * Vs^2 * S * CF : Flat plate skin friction
R0 : Calm water reference resistance
RAW = RT - R0 : Added resistance
RW_std (Standard deviation of RW [%]) : 0.260
RT (Total resistance [N]) : 1675107.309
RW (Wave resistance [N]) : 386866.717
RF (Friction resistance [N]) : 1288240.592
RT_AP (Total resistance [N]) : 1743026.810
RW_AP (Wave resistance [N]) : 454786.217
R0 (Calm water resistance [N]) : N/A
RAW (Added resistance [N]) : N/A
S (Wetted surface area [m^2]) : 9565.233
CF*1000 (Friction resistance coefficient [-]) : 1.378
k (Form factor [-]) : 0.250
Notes
R0andRAWare only available if the calm water resistanceR0is given as input inXPTD:POST.- The suffix
_APdenotes the use of acceleration potential when computing the dynamic pressure, as opposed to a backward difference scheme of velocity potential. These components are typically less accurate and should not be considered for normal use.
Output files¶
For each time step there are also .vtu files (one for the hull and one for the free surface) that
can be used to visualize the computation. For instance the free post-processor ParaView can read these
VTU files. In KCS in Waves it is shown how to post-process the VTU files in
ParaView.
There are also two files, kcs_calm_TS.csv and kcs_calm_CNV.csv, which contain time series data. TS
stands for time series, and that file contains for instance positions, velocities, accelerations and
forces of the hull for each time step. CNV stands for convergence, and that file contains for instance
the time integrated resistance for each time step. These files are in CSV format and can be read by
many different programs (for example Excel or ParaView).
The full column listings are in Program Output.