Hydrodynamics#
Main command block - hydro#
In this command block hydrodynamic forces calculated using Morison’s formula is set up.
Sub command block – water_properties#
Obl. |
Command name |
Explanation |
|---|---|---|
* |
gravity |
1. Gravity acceleration (used for calculation of buoyancy forces). Default = 9.81 m/s^2 |
* |
mudlevel |
1. Mud level [m] in global z coordinates. |
* |
mwl |
1. Mean water level [m] in global z coordinates. |
* |
rho |
1. Density of the water [kg/m3]. Default=1000 |
wave_direction |
1. Wave direction [deg]. Direction is positive when the waves come forward from the right when looking towards the wind at default conditions. |
|
current |
1. Current type (0=none (default), 1=constant, 2=power law \(U(z)=U_0((mudlevel-mwl-z)/(mudlevel-mwl))^{\alpha}\) where \(\alpha \geq 0\), and \(z\) refers to the water depth ranging from 0 at the surface to \(mudlevel-mwl\) at the mudlevel. See also figure 1. |
|
2. Current velocity at mwl, \(u_0\) |
||
3. type parameter. If type=2 then parameter is \(\alpha\). |
||
4. Current direction relative to wave direction [deg]. Positive direction if current comes from the right looking towards the incoming waves. |
||
water_kinematics_dll |
1. Filename incl. relative path to file containing water kinematics dll (example ./hydro/water_kin.dll) |
|
2. String sent to initialization of dll. This is typical the name of a local inputfile of the dll. |
Hydrodynamic water current power law velocity profile for various values of \(\alpha\) with \(mwl=0\) and \(mudlevel=100\).#
Sub command block – hydro_element#
Command block that can be repeated as many times as needed. This command block set up hydrodynamic calculation points and link them to a main_body.
Obl. |
Command name |
Explanation |
|---|---|---|
* |
body_name or mbdy_name |
1. Main_body name to which the hydrodynamic calculation points are linked. |
* |
hydrosections |
1. Distribution method of hydrodynamic calculation points. Options are: |
“uniform” nnodes. Where uniform ensures equal distance of the calculation points. nnodes are number of calculation points. |
||
“auto” nint. Here calculations points are chosen as the positions of the structural nodes and the hydro dynamic input section given by the sec command. The parameter nint is a refinement parameter given nint extra calculation points in between the other points. |
||
* |
sec_type |
Type of cross section (1=circular, 2=general). Please note that sec_type should always appear before the nsec and sec commands. |
sec_length_normalized |
Switch to let the hydrodynamic coordinates be read as normalized coordinates (from 0.0 to 1.0). Valid inputs are 0 to use absolute coordinates, and 1 to use normalized coordinates. By default, absolute coordinates are used. Please note that sec_length_normalized should always appear before the sec command. |
|
* |
nsec |
This command must be present before the sec commands |
1. Number of sections given below |
||
* |
sec |
This command must be repeated nsec times and is different for each section type. |
Section type 1 – circular: |
||
1. Coordinate along the main_body c2_def line. Positive directed from node 1 to node “last”. |
||
2. \(C_{a}\) added mass coefficient (default=1.0) |
||
3. \(C_{d}\) drag coefficient (default=1.0) |
||
4. Cross sectional area [m2] |
||
5. Cross sectional area to which \(C_{a}\) is related. (default=area for circular sections) [m2] |
||
6. Width of construction perpendicular to flow direction [m] |
||
7. drdz gradient(optional). For calculating the buoyancy also for conical sections the gradient expressing the change in radius with change of distance along the main_body c2_def line. Only important when buoyancy forces are included. |
||
8. Axial drag \(C_{d}\) coefficient for concentrated force contribution (optional). Drag area is circular area defined by the local width. Contribution is quadratic regarding water velocity. |
||
9. Axial added mass \(C_{a, axial}\) coefficient for concentrated force contribution (optional). Force is computed (in each hydro element section with \(C_{a, axial}\) different than 0) as: \(\rho V_{ref} C_{a,axial} (water\_acc - body\_acc)\), with \(V_{ref}\) taken as half volume of sphere defined by the local width as diameter. |
||
10. Axial drag \(C_{d}\) coefficient for concentrated force contribution (optional). Drag area is circular area defined by the local width. Contribution is linear regarding water velocity. |
||
11. Internal cross sectional area for flooded members [m2] (optional). 0=member is not flooded. |
||
12. Torque friction coefficient Cf (optional). For rotating cylinders around local z-direction. |
||
\({{M}_{z}}=\frac{1}{16}\rho \pi {{D}^{4}}{{\omega }^{2}}{{\text{C}}_{\text{f}}}\) |
||
13. Magnus coefficient (optional). |
||
\(F_{Magnus} = C_{Magnus} {\rho} V_{current} 2 \pi r^2 {\omega}\) |
||
and where \(r\) is the corresponding radius for the given cross sectional area (input 4), and \(C_{magnus}\) is the Magnus coefficient that depends on parameters such as shape, material and flow regime (for example ratio between rotational and current velocity). |
||
Section type 2 – general: |
||
1. Distance from node 1 to 2 |
||
2. Cross sectional area [m2] |
||
3. Area radius of gyration [m] around x-axis \(Ri_{x}\) |
||
4. Area radius of gyration [m] around y-axis \(Ri_{y}\) |
||
5. Hydro mass coefficient in x-direction \(C_{a,x}\) |
||
6. Hydro mass coefficient in y-direction \(C_{a,y}\) |
||
7. Drag coefficient in x-direction \(C_{d,x}\) |
||
8. Drag coefficient in y-direction \(C_{d,y}\) |
||
9. Volume per length in x-direction |
||
10. Volume per length in y-direction |
||
11. Reference volume to which \(C_a\) is referenced |
||
12. Reference width for \(C_d\) and \(C_{a,axial}\) |
||
13. axial drag coefficient (quadratic) \(C_{d,axial,quad}\) |
||
14. axial hydro mass coefficient \(C_{a,axial}\) |
||
15. axial drag coefficient (linear) \(C_{d,axial}\) |
||
buoyancy |
1. Specification whether buoyancy forces are included or not. 0=off (default), 1=on (remember to define the 7th parameter in the sec input line. |
|
update_states |
1. Specification whether the hydrodynamic sections are updated in time with respect to pos, vel, acc and orientations, or simply considered to remain fixed. 0=not updated, 1=updated (default) |
|
update_kinematics |
1. Specification whether the water kinematics are updated during iterations or only once per time step. 0=only updated once per time step, 1=full update (default). |
Here is an example of this written into the htc-input file.
begin HYDRO_ELEMENT ;
mbdy_name cylinder ;
buoyancy 1 ;
update_states 1 ; (0: no dynamic interaction, 1: fully coupled solution
hydrosections auto 4 ; dist, of hydro calculation points from 1 to nsec
nsec 2; z Ca Cd A Aref width dr/dz Cd_a_(quad) Ca_a Cd_a_lin Aif
sec 0.0 1 1 3.404 3.404 2.082 0.0 0.0 0.0 0.0 3.023;
sec 5.0 1 1 3.404 3.404 2.082 0.0 0.0 0.0 0.0 3.023;
end HYDRO_ELEMENT ;
This example shows a flooded cylindrical element (l=5 m, d= 2,082 m and t=60mm).
Description of the water_kinematics_dll format.#
subroutine init(inputfile,t0,t1,dt) implicit none
!DEC$ ATTRIBUTES DLLEXPORT, ALIAS:'init'::init
character*(*) :: inputfile
real*8 :: t0 ! start time for simulation
real*8 :: t1 ! stop time for simulation
real*8 :: dt ! time increment
end subroutine init
!---------------------------------------------------------------------------
subroutine set_new_time(time)
!DEC$ ATTRIBUTES DLLEXPORT, ALIAS:'set_new_time'::set_new_time
real*8 :: time
end subroutine set_new_time
!---------------------------------------------------------------------------
subroutine get_sea_elevation(posxy_h,elevation)
!DEC$ ATTRIBUTES DLLEXPORT, ALIAS:'get_sea_elevation'::get_sea_elevation
real*8,dimension(2) :: posxy_h ! horizontal position coordinates
real*8 :: elevation ! water height above mean water level, positive upwards
end subroutine get_sea_elevation
!---------------------------------------------------------------------------
subroutine get_kinematics(pos_h,vel_h,acc_h,pres)
!DEC$ ATTRIBUTES DLLEXPORT, ALIAS:'get_kinematics'::get_kinematics
real*8,dimension(3) :: pos_h ! look-up location (input)
real*8,dimension(3) :: vel_h, acc_h ! velocity and acceleration (output)
real*8 :: pres ! dynamic wave pressure (output)
end subroutine get_kinematics
User manual to the standard wkin.dll version 2.8.3#
The wkin.dll which is delivered along with the HAWC2 code needs a separate inputfile. The format for these inputs are the same as the HAWC2 main inputfile with usage of begin..end clauses, semi colon separators, exit command etc. Command words are described below.
All command words written below has to be included in an begin .. end clause called wkin_input:
begin wkin_input;
...
end wkin_input;
exit;
Version info:
1.0 TJUL Basic edition by TJUL
1.1 ANMH Wave field can be read by file and used directly through fft
conversion
1.2 TJUL Directional spreading included
1.3 ANMH Bug corrected regarding read on seed number using iregular
waves
1.4 TJUL Pierson-Moscowitz spectrum added as option
Stream function wave added
Possible pre processing of wave field to speed up simulation
time and enable many more coeffients
1.5 TJUL Bug in stream function wave. Static pressure was included –
now removed
1.6 TJUL Bug in stream fuction wave. lateral position was applied
instead of vertical in kinematics look-up!!!
1.7 TKIM New wave format for precalculated (high order) wave fields
1.8 ANMH Update in deterministic iregular waves+bugfix
1.9 TJUL New option for white noise wave exitation
2.0 TJUL Bug fix of version 1-9. Version 1-9 had some debug
statements included that could meas up the time.
2.1 ANMH Ported to intel
ANMH Correction for high wave numbers in deterministic irregular
waves
TJUL Embedded stream function wave, phase velocity used insted
of group velocity with respect to pregenerated waves
2.2 TJUL Bug fix. Tightended criteria for jonswap spectrup min-max.
Use of real*8 in all internal memory related variables
2.3 TJUL Bug fix. PM spectrum ireg waves
2.4 TJUL Update so embedded stream function wave is ensured to be inside the requested time interval
2.5 TJUL Bugfix in randomnumber generator. Problem occured in version 2.1 until 2.4
SHFE Bugfix in embedded steam function wave
2.6 TJUL Embedded stream function wave updated for manual input of Tp
2.7 ANMH Bugfix regarding embedded stream function wave
SHFE Bugfix (stretching first, then embed stream function wave)
2.8 SHFE New feature to write out the pregenerated wave field
SHFE Change PM spectra from Tz type to Tp type
SHFE Solve the memory issue when pregenerate large scale wave field
SHFE Fix issue with long filenames
2.8.3 SHFE McCamy Fuchs correction is applied on water particle acceleration
Main commands in the wkin.dll#
Obl. |
Command name |
Explanation |
|---|---|---|
* |
wavetype |
1. Type of wave used. (0=regular airy, 1=irregular airy, 2=deterministic irregular airy, 3=regular stream function, 4=general wavemode format) |
* |
wdepth |
1. Water depth [m]. Positive value. |
Sub command reg_airy#
Command that need to be present if the wavetype equals 0 in the main command.
Obl. |
Command name |
Explanation |
|---|---|---|
* |
stretching |
1. Wheeler stretching of waves. (0=off, 1=on) |
* |
wave |
1. Wave height H [m] |
2. Wave period T [s] |
||
3. Wave phase shift [deg] (optional) |
||
ignore_water_surface |
Allow the lookup of the wave kinematics above the waterline if requested in the output. |
Sub command ireg_airy#
Command that need to be present if the wavetype equals 1 in the main command.
Obl. |
Command name |
Explanation |
|---|---|---|
* |
stretching |
1. Wheeler stretching of waves. (0=off, 1=on) |
* |
spectrum |
1. Base spectrum used. (1=jonswap, 2= Pierson Moscowitz) |
mccamyfuchs |
1. McCamy Fuchs correction on water particle acceleration. (0=off, 1=on) |
|
2. Representative radius [m] |
||
jonswap |
Jonswap spectrum formulation |
|
1. Significant wave height \(H_{s}\) [m] |
||
2. Wave period \(T_{p}\) [s] |
||
3. \(\gamma\) parameter [-]. A typical value is 3.3 |
||
pm |
Pierson-Moscowitz spectrum |
|
1. Significant wave height \(H_{s}\) [m] |
||
2. Wave period \(T_{p}\) [s] |
||
wn |
White noise. |
|
1. Target variance level [\(m^2\)] |
||
2. \(f_{0}\), minimum frequency |
||
3. \(f_{1}\), maximum frequency |
||
* |
coef |
1. Number of coefficients. Normally 200 are used even though higher values are recommended in general. A speed issue… |
2. Seed number. A positive integer value. |
||
3. Phase shift for all wave components [deg] (optional). |
||
spreading |
1. Spreading model. (0=none, 1=\(K_{2s}\) model also referred to as \(K_{n}\) model) |
|
2. Spreading parameter. If model=1 the parameter is s, a positive integer. The higher value, the less spreading. |
||
pregen |
Pre-generation of a wave field (default is on). Using this option the irregular wave field is calculated during initialization phase and only table look-up is done during the time simulation phase. Very fast and still accurate. |
|
1. Pregen option. (0=traditional approach (slow), 1=pregenerated wave field used (default)) |
||
embed_sf |
Embed stream function wave in time series at the time when the otherwise largest wave occurs. The wave kinematics is blended into the iregular waves before and after. |
|
1. Wave height H [m] |
||
2. Wave period T [s]. Default = Peak wave period \(T_{p}\). (optional) |
||
3. Truncated transition period T0 [s]. Default = 0. (optional) |
Sub sub command pregen_field#
Command that used to define the resolution of the pregenerated wave field if this feature is activated where the pregen equals to 1 (default). The whole command block is optional.
Obl. |
Command name |
Explanation |
|---|---|---|
wave_filename |
1. File name for writing (if file does not exist) or reading (if file exists) pregenerated wave field. |
|
y_resolution |
1. Field dimensions in lateral direction. Default is 1. |
|
2. Lateral grid length. Default is 0. |
||
t_resolution |
1. The time step used for the pregenerated wave field. Default = 1/10 of maximum wave period. |
|
z_resolution |
1. Field dimensions in vertical direction. Default is 10 points in z direction. |
|
x_range |
1. extra simulated wave train in meters before and after requested time interval. Default is 100 m. |
Sub command det_airy#
Command that need to be present if the wavetype equals 2 in the main command. This command is used when water kinematics needs to be calculated based on a predetermined surface elevation time series. In the calculation of the waterkinematics, the datapoints in the input file must be equidistant in time, i.e. with a constant time-step.
Obl. |
Command name |
Explanation |
|---|---|---|
* |
file |
1. File name for measured wave elevation. |
* |
nsamples |
1. Number of lines present in wave elevation file |
* |
nskip |
1. Number of lines to skip before reading of wave elevation file |
* |
columns |
1. Column number for time sensor in file. |
2. Column number for wave elevation in file. |
||
stretching |
1. Wheeler stretching of waves. (0=off, 1=on (default)) |
|
* |
cutoff_frac |
1. Fraction of total energy which is discarded in the low and high frequency ranges. Default 1E-5 |
pregen |
Pre-generation of a wave field (default is on). Using this option the irregular wave field is calculated during initialization phase and only table look-up is done during the time simulation phase. Very fast and still accurate. |
|
1. Pregen option. (0=traditional approach (slow), 1=pregenerated wave field used (default)) |
||
x_range |
1. extra simulated wave train in meters before and after requested time interval. Default is 100 m. |
|
wave_filename |
1. File name for writing (if file does not exist) or reading (if file exists) the pregenerated wave field. |
Sub command strf#
Stream function wave input.
Obl. |
Command name |
Explanation |
|---|---|---|
* |
wave |
1. Significant wave height \(H_{s}\) [m] |
2. Wave period T [s] |
||
3. Current speed U [m/s] |
Sub command wavemods#
Command that need to be present if the wavetype equals 4 in the main command. This command is used when water kinematics are supplied directly to HAWC2 from input files.
Obl. |
Command name |
Explanation |
|---|---|---|
* |
datafile_y |
1. Name of datafile where wave kinematic data is present for the horizontal (wave) direction |
* |
datafile_z |
1. Name of datafile where wave kinematic data is present for the vertical direction |
* |
datafile_nd |
1. Number of depth locations |
* |
datafile_depth |
1. Maximum water depth (m) |
* |
datafile_nt |
1. Number of time steps in datafile |
* |
datafile_t0 |
1. Time for when wave data is extracted in the datafiles |
* |
ncol_y |
1. Number of columns in datafile1 (time + eta + nd*(vel+acc)) |
* |
ncol_z |
2. Number of columns in datafile2 (time + nd*(vel+acc)) |
An example of input files with wave kinematics data for the wavemods option is given below. Please note the following:
The first 9 lines are general comment lines
Line 10 lists the position at which the velocities and accelerations are applied in non-dimensional coordinate \(gma\). \(gma\) is 0 at the mudlevel, and 1 at the instantaneous free surface (mwl + eta). The number of coordinates must match datafile_Nd in the wavemods subcommand. The coordinates must be given in ascending order, i.e. from 0 to 1.
Each row starting at Line 12 corresponds to a single time step, and there should be at least datafile_Nt rows before the end of the file
The datafile columns correspond to time, eta (the distance between the wave height and the MSL; not present in the vertical-component input file), datafile_Nd velocities, and then datafile_Nd accelerations
Example of datafile_y (horizontal wave component):
Wave kinematics input to Flex5 Monopile ver. 2.1
General comment line
Wave load program "WaveKin" ver. 1.0
Echo file : Outfile.dat
Name of Case
Wave Description
slope 1:25
50 water depth
3 No rel. depths N
0.000 0.500 1.000
T eta u[1]..u[N] a[1]..a[N]
0.000 -0.645 -0.022 -0.027 -0.047 -0.018 -0.022 -0.035
0.063 -0.659 -0.023 -0.029 -0.049 -0.017 -0.021 -0.032
0.126 -0.671 -0.025 -0.030 -0.051 -0.016 -0.020 -0.030
...
Example of datafile_z (vertical wave component):
Wave kinematics input to Flex5 Monopile ver. 2.1
General comment line
Wave load program "WaveKin" ver. 1.0
Echo file : Outfile.dat
Name of Case
Wave Description
slope 1:25
50 water depth
3 No rel. depths N
0.000 0.500 1.000
T u[1]..u[N] a[1]..a[N]
0.000 -0.022 -0.027 -0.047 -0.018 -0.022 -0.035
0.063 -0.023 -0.029 -0.049 -0.017 -0.021 -0.032
0.126 -0.025 -0.030 -0.051 -0.016 -0.020 -0.030
...
Wkin.dll example file#
begin wkin_input ;
wavetype 1 ; 0=regular, 1=irregular, 2=deterministic
wdepth 220.0 ;
;
begin reg_airy ;
stretching 0; 0=none, 1=wheeler
wave 9 12.6; Hs,T
end;
;
begin ireg_airy ;
stretching 0; 0=none, 1=wheeler
spectrum 1; (1=jonswap)
jonswap 9 12.6 3.3 ; (Hs, Tp, gamma)
coef 200 1 ; (coefnr, seed)
spreading 1 2; (type(0=off 1=on), s parameter (pos. integer min 1)
end;
;
begin det_airy ;
stretching 0; 0=none, 1=wheeler
file ..\waves\elevation.dat ;
nsamples 32768 ;
nskip 1 ;
columns 1 5 ; time column, elevation column
end;
;
begin wavemods;
datafile_y ./wavedata/wavekin_y.dat;
datafile_z ./wavedata/wavekin_z.dat;
datafile_nt 900; number of time steps in file
datafile_nd 3; number of relative water depths
datafile_t0 50; start time for data extraction
datafile_depth 50 ; minimum water depth
ncol_y 8; Number of data columns in file
ncol_z 7; Number of data columns in file
end;
end;
;
exit ;