General Functions

A collection of functions and equations from the main body of ITTC

The functions in this module are not specific to any of the ITTC appendices

0.1 Conversion between knots and meters per second

As many of the functions in this library require SI units it can be helpful to have a knots-m/s converter and vice-versa.


source

0.1.1 knots_to_ms

 knots_to_ms (knots:float)

convert knots to m/s

Type Details
knots float the speed in knots
Returns float speed in m/s

source

0.1.2 ms_to_knots

 ms_to_knots (ms:float)

convert knots to m/s

Type Details
ms float the speed in m/s
Returns float speed in knots

Using these simple functions we can easily convert between knots and m/s

#convert knots to m/s
meters_per_second = knots_to_ms(5)
print('speed converted to meters per second '+str(meters_per_second))
#convert back to knots
knots = ms_to_knots(meters_per_second)
print('speed converted back into knots '+str(knots))
speed converted to meters per second 2.572222873852017
speed converted back into knots 5.0

0.2 Corrected Delivered Power

Find the shaft power in ideal conditions considering an external (environmental) force acting on the ship. \[P_{Did} = \frac{1}{2} \left(P_{Dms} - \frac{\Delta RV_s}{\eta_{Did}} + \sqrt{ \left(P_{Dms} - \frac{\Delta RV_s}{\eta_{Did}} \right)^2 + 4P_{Dms} \frac{\Delta RV_s}{\eta_{Did}} \xi_P} \right)\] where:

\(P_{Did}\) is the shaft power in ideal conditions [W],

\(P_{Dms}\) is the measured shaft power [W],

\(\Delta R\) is the resistance increase due to wind, waves and temperature deviations [N]

\(V_S\) is the ship’s speed through water [m/s],

\(\eta_{Did}\) is the propulsion efficiency coefficient in ideal conditions, from the model test,

\(\xi_P\) is the overload factor derived from load variation model test,

ITTC equations: 5


source

0.2.1 power_correction

 power_correction (pd_meas:float, delta_R:float, stw:float, etaD_id:float,
                   shaft_power_overload:float)
Type Details
pd_meas float measured shaft power [W]
delta_R float increase of resistance due to wind, waves and temperature deviation [N]
stw float speed through water [m/s]
etaD_id float propulsion efficiency coefficienct in ideal conditions (from model test) [-]
shaft_power_overload float overload factor from load variation model test [-]
Returns float shaft power in ideal conditions [W]

What is the ideal power given the following inputs:

measured power = 30,000 kW

delta R = 100000 N

STW = 8 m/s

etaD id = 0.75

shaft power overload factor = -0.1

power_correction(pd_meas = 30000000, #measured shaft power [W]
                 delta_R = 100000, #increase of resistance due to wind, waves and temperature deviation [N]
                 stw = 8, #speed through water [m/s]
                 etaD_id = 0.75, #propulsion efficiency coefficienct in ideal conditions (from model test) [-]
                 shaft_power_overload = -0.1 #overload factor from load variation model test [-]
                 )
28822308.221276633

0.3 Corrected Propeller Shaft Revolution Frequency

Find the propeller revolution frequency in ideal conditions considering the measured and ideal shaft power.

\[n_{id} = \frac{n_{ms}}{\xi_n \frac{P_{Dms}-P_{Did}}{P_{Did}}+1}\]

Where

\(n_{id}\) is the propeller shaft revolution frequency in ideal conditions [1/s],

\(n_{ms}\) is the measured propeller shaft revolution frequency [1/s],

\(\xi_n\) is the overload factor derived from load variation model test [-],

\(P_{Dms}\) is the measured shaft power [W],

\(P_{Did}\) is the shaft power in ideal conditions [W],

ITTC equations: 6


source

0.3.1 shaft_speed_correction

 shaft_speed_correction (n_ms:float, shaft_speed_overload:float,
                         pd_meas:float, pd_id:float)
Type Details
n_ms float measured propeller shaft revolution frequency [1/s]
shaft_speed_overload float overload factor derived from load variation model test [-]
pd_meas float measured shaft power [W]
pd_id float shaft power in ideal conditions [W]
Returns float propeller shaft revolution frequency in ideal condition [1/s]

What is the ideal propeller shaft revolution frequency given the following inputs:

measured propeller shaft revolution frequency = 1.1 1/s

overload factor = 0.3

measured shaft power = 30,000 kW

ideal shaft power = 28,822 kW

shaft_speed_correction(n_ms = 1.1, #measured propeller shaft revolution frequency [1/s]
                       shaft_speed_overload = 0.3, #overload factor derived from load variation model test [-]
                       pd_meas = 30000000, #measured shaft power [W]
                       pd_id =  28822000#shaft power in ideal conditions [W]
                       )
1.0866757610863946

0.4 Wind resistance

The resistance experienced by the ship as a result of passing through air.

\[R_{AA} = \frac{1}{2} \rho_A A_{XV} \left ( C_{DA}(\psi_{WREF}) V_{WREF}^2 - C_{DA}(0) V_{G}^2 \right),\] where \(\rho_A\) is the density of air, \(C_{DA}\) is the wind resistance coefficient, \(A_{XV}\) is the area of maximum transverse section exposed to the wind, \(\psi_{WREF}\) relative direction of the wind, \(V_{WREF}\) relative wind speed, and \(V_G\) is the speed over ground.

The formula calculates resistance experienced by the ship when there is no wind and all resistance comes from the movement of the ship itself. This value is then subtracted from the wind resistance experienced by the ship during the trial. Put this way it is clear that the equation finds the difference between the wind resistance on a still day and on the day of the trial.

Note

The ITTC manual notes that values of \(C_{DA}(x)\) from the tables in load_wind_coefficients need to be reversed when enetering into the wind resistance formula, that is \(C_{DA}= -C_x\). For consistancy the same must be done here

ITTC equations: 9


source

0.4.1 wind_resistance

 wind_resistance (air_density:float, wind_resistance_coef_rel:float,
                  wind_resistance_coef_zero:float, area:float,
                  relative_wind_speed:float, sog:float)

Calculates the air resistance. N.B. SI units must be used. Do not use knots

Type Details
air_density float Air density [kg/\(m\^3\)]
wind_resistance_coef_rel float the coefficient of wind resistance using the relative angle of the wind
wind_resistance_coef_zero float the coefficient of wind resistance using angle 0 radians
area float The maximum transverse area of the ship exposed to the wind [m^2]
relative_wind_speed float Relative wind speed [m/s]
sog float speed over ground [m/s]
Returns float Air resistance [N]

What is the air resistance experienced by a cruise ferry with a tranverse area of 500\(m^2\) travelling at 20 knots with a relative wind of 10 knots and a relative wind angle of \(45^\circ\)

sog_ms = knots_to_ms(20)
wind_speed_ms = knots_to_ms(10)

wind_resistance(1.2, 0.34, 0.69, 500, wind_speed_ms, sog_ms)
-19213.8238090769

0.5 Resistance due to water temperature and salinity

The temperature and salt content of the water affect its density. As such, they also affect the ship resistance.

\[R_{AS} = R_{T0} \left( \frac{\rho_S}{\rho_0} -1 \right) - R_F \left( \frac{C_{F0} + \Delta C_{F0}}{C_{F} + \Delta C_{F}} -1\right)\]

and

$R_F = _S S V_S^2 (C_F + C_F) $

$R_{F0} = 0 S V_S^2 (C{F0} + C_{F0}) $

$R_{T0} = 0 S V_S^2 C{T0} $

The below function taken from section 10.3.3 of the ITTC corrects the sea water temperature, and salt content to be that of the appropriate reference values.

variable reference value
temperature \(15^\circ \text{C}\)
Density 1026\(kg/m^3\)

The coefficients of roughness used in the function are derived from ITTC Recommended Procedures 7.5-02-03-01.4

The values of CF and CF0 can be obtained using the CF_fn function. The values of delta_CF and delta_CF0 and be found using the roughness_allowance_fn

ITTC equations: 14 to 17


source

0.5.1 temp_salinity_water_resistance

 temp_salinity_water_resistance (CF:float, CF0:float, delta_CF:float,
                                 delta_CF0:float, CT0:float, S:float,
                                 stw:float, rho_S:float, rho_0:float=1026)

Resistance due to water temperature and salinity corrected relative to the reference values

Type Default Details
CF float frictional resistance coefficient for actual water temperature and salinity
CF0 float frictional resistance coefficient for reference water temperature and salinity
delta_CF float roughness allowance associated with Reynolds number for actual water temperature and salinity
delta_CF0 float roughness allowance associated with Reynolds number for reference water temperature and salinity
CT0 float total resistance coefficient for reference water temperature and salinity
S float wetted surface area [m2]
stw float ship’s speed through the water [m/s]
rho_S float water density for actual water temperature and salt content [kg/m3 ]
rho_0 float 1026 water density for reference water temperature and salt content
Returns float resistance increase due to deviation of water temperature and water density [N]

I have absolutely no idea what sensible values should look like, so this function will need to wait for beta testing, before the documentation can be complete

Also this function will probably need to point to some other functions for calculating the roughness coefficents.

temp_salinity_water_resistance(CF = 1.501e-3, CF0 = 1.5e-3, delta_CF = 2.12e-4, delta_CF0 = 2.1e-4, 
                               CT0 = 1.4e-3, S = 8000, stw = 10, rho_S = 1025, rho_0 = 1026)
669.9999999998915

1 Power correction for displacment

During Sea trials, vessels are usually in Ballast condition and not the laden condition for which they are built. Such a change reduces the amount of power required to propel the vessel. If the vessel displacement during the trial is outside pre-defined limits then the power can be adjusted using the below equation based on the Admiralty formula.

\[P_2 = P_1 \left( \frac{\nabla_2}{\nabla_1} \right)^{2/3}\]

Where \(P_2\) is the corrected power, \(P_1\) is the ideal power during the trial, \(\nabla_1\) is the displacement during the trial, and \(\nabla_2\) is the displacement during tank tests.


source

1.0.1 displacement_correction

 displacement_correction (power:float, trial_displacement:float,
                          reference_displacement:float)

Corrects the power needed by the vessel when trial displacement differs from reference displacement

Type Details
power float The total ideal power during the trial [kWh],
trial_displacement float diplacement of the ship during the trial [m^3]
reference_displacement float diplacement of the ship during the tank test [m^3]
Returns float The power corrected for the difference in displacement between the trial and the tank test

An example of the correction can be seen below

trial_power = 10000.0
trial_displacement = 12000.0

# Displacement of the ship during the tank test [m^3]
reference_displacement = 15000.0

# Calculate the corrected power
corrected_power = displacement_correction(trial_power, trial_displacement, reference_displacement)

print("Corrected power:", corrected_power)
Corrected power: 11603.972084031948

1.1 Load example data

There are some example datasets included in this library to help with understanding the process of evaluating seatrials. Loading the data uses the following function


source

1.1.1 load_datasets

 load_datasets (dataset:str)

Load example datasets to try out the pyseatrials functions

Type Details
dataset str The name of the dataset to load

The propeller advance dataset contains the propeller advance curve for the coefficient of torque and the coefficient of thrust coefficient for an imaginary ship

propeller_advance_df = load_datasets("propeller_advance_lookup")
propeller_advance_df
J K_T K_Q
0 0.30 0.300 0.038
1 0.35 0.270 0.036
2 0.40 0.260 0.034
3 0.45 0.240 0.032
4 0.50 0.210 0.030
5 0.55 0.200 0.028
6 0.60 0.195 0.026
7 0.65 0.170 0.023
8 0.70 0.150 0.021
9 0.75 0.130 0.020
10 0.80 0.090 0.016
11 0.85 0.080 0.013

Plotting the dataset reveals a simple line from experimental data

import matplotlib.pyplot as plt
plt.plot(propeller_advance_df['J'], propeller_advance_df['K_T'],'b-', lw=1, label='Linear')