Professional Documents
Culture Documents
1
Department of Mechanical and Industrial Engineering, Norwegian University of Science and Technology (NTNU),
N0-7041 Trondheim, Norway. E-mail: {savin.viswanathan,christian.holden,olav.egeland}@ntnu.no
2
Department of Marine Technology, Norwegian University of Science and Technology (NTNU), N0-7491 Trond-
heim, Norway; Institute of Marine Engineering, CNR-INM, Italy. E-mail: marilena.greco@ntnu.no
Abstract
In this paper, a new open-source implementation of the lower-order, 3-D Boundary Element Method
(BEM) of solution to the deep-water, zero Froude-number wave-body interaction problem is described. A
validation case for OMHyD, the new open-source package, is included, where the outputs are compared to
results obtained using the widely used frequency-domain hydrodynamic analysis package ANSYS-AQWA.
The theory behind the solution to the diffraction-radiation problem is re-visited using the Green function
method. The Hess and Smith panel method is then extended to the case of a floating object using the
image-source to impose the wall condition at the free-surface, and a wavy Green function component to
account for presence of free-surface waves. An algorithm for computer implementation of the procedure is
developed and subsequently implemented in PYTHON. The wavy part of the Green function is determined
using a verified and published FORTRAN code by Teleste and Noblesse, wrapped for PYTHON using the
Fortran to Python (F2PY) interface. Results are presented for the various stages of implementation
viz. panelling, body in infinite fluid domain, effect of the free-surface, and effect of surface-waves. The
hydrodynamic coefficients obtained from this preliminary frequency-domain analysis are shown to be in
satisfactory agreement with ANSYS-AQWA results. Conclusions are drawn based on the performance of
the code, followed by suggestions for further improvement by including the removal of irregular-frequencies,
multi-body interactions, and bottom interference, which are not considered in the present implementation.
doi:10.4173/mic.2021.2.2
c 2021 Norwegian Society of Automatic Control
Modeling, Identification and Control
48
Viswanathan et.al., “Pythonic approach to BEM”
2. Theory
Z η
3
In the discussions that follow, ~x represents a vector, η1 X
and x̂ represents a unit vector. u̇ represents the time η6
derivative of u. η4
wave crests
2.1. The Wave-Body Interaction Problem η2 η5 γ ∞
Considering the physical effects of a floating object in- Y
teracting with incident waves, we observe the following
(Wehausen, 1971):
1. The fluid pressure force on the body changes as a
result of the incident waves, and this causes the ∞
body to oscillate about its mean position. direction of
2. The presence of the body scatters the incident wave
∞ propagation
wave in all directions, and these scattered waves
exert associated fluid pressure forces on the body,
Figure 1: Definition sketch
affecting its motion.
3. The motion of the body generates radiation waves −1
moving out in all directions, and these waves in- Here, ζa [m] is the wave amplitude, and k [m ] is the
turn exert associated fluid pressure forces on the wave number, which is related to the wave frequency
body. ω [rad/s] through the dispersion relation
49
Modeling, Identification and Control
and those originating due to the motions of the body, 2.1.2. The diffraction problem: The Froude–Kryloff
must be outgoing, and should have proper amplitude and diffraction loads
behavior at infinity. This imposes an additional radi-
With reference to (12), the diffraction potential at the
ation condition on ϕj , j ∈ {1, . . . , 7}. Details can be
body surface is written as
found in (Wehausen, 1971) and (John, 1949).
In determining ϕj=1,...,7 , we make use of the Green ~ t) = Φ0 (ξ,
ΦD (ξ, ~ t) + Φ7 (ξ,
~ t). (15)
function method as described in Sec. 2.2.
With reference to the first term on the R.H.S. of (14),
the wave-excitation load along the k th DoF is given by
2.1.1. The Bernoulli equation ZZ ~ t)
∂Φ0 (ξ,
The Bernoulli equation relates the fluid pressure and
e
Fk (t) = −ρ ~
nk (ξ)dS
S0 ∂t
the velocity potential in the fluid domain. | {z }
From the linearized form of the Bernoulli equation, Froude–Kryloff loads
(Faltinsen, 1990, (2.4)), we get ZZ
∂Φ7 (ξ,~ t)
−ρ ~
nk (ξ)dS ,
∂Φ(~x, t) S0 ∂t
p(~x, t) = −ρ −ρgz . (10) | {z }
| {z∂t } | {z }
Hydrostatic pressure
Diffraction loads
Hydrodynamic pressure k = 1, . . . , 6. (16)
With reference to (1), the total velocity potential Φ Here, the loads due to the incident wave potential Φ0
is expressed as the sum of the diffraction potential ΦD , are commonly referred to as the Froude–Kryloff loads,
and the radiation potential ΦR . Thus, and those associated with the scattered wave potential
Φ7 , are referred to as the diffraction loads (Faltinsen,
Φ = ΦD + ΦR , (11)
1990, (3.36)).
where,
2.1.3. The radiation problem: Added-mass and
ΦD = [ϕ0 (~x, γ) + ϕ7 (~x, γ)] eiωt (12)
damping
X 6
ΦR = ηj ϕj (~x)eiωt . (13) With reference to (13), the radiation potential at the
j=1 body surface is written as
~ ξ~ = (ξ, η, ζ). 6
Consider the wetted body surface S(ξ), ~ t) =
X
~ j eiωt },
ΦR (ξ, ϕj (ξ){η (17)
Here the ξηζ frame is the body coordinate frame, which
j=1
coincides with the global xyz coordinate frame. At the
mean position, let the wetted body surface be denoted where ηj is the amplitude of motion in mode j, and ϕj
~ To determine the linear terms of the pressure
by S0 (ξ). is the spatial component of the complex potential due
loads, the hydrostatic pressure should be integrated to unit amplitude of motion in the j th DoF.
over the instantaneous position of the body, while the With reference to the first term on the R.H.S. of (14),
hydrodynamic pressure should be integrated along the the wave-radiation load along the k th DoF is given by
mean wetted surface. Thus, from (10) ZZ ~ t)
∂ΦR (ξ,
ZZ r
Fk (t) = −ρ ~
nk (ξ)dS. (18)
~ ~ S0 ∂t
O(1) p(ξ, t)nk (ξ)dS
S The wave-radiation load along the k th DoF due to body
ZZ ~ t) + ΦR (ξ,
∂[ΦD (ξ, ~ t)] oscillation along the j th DoF is now expressed as
= −ρ ~
nk (ξ)dS
S0 ∂t ZZ
F r (t) = −ρ {ηj e˙iωt } R{ϕj (ξ)}
~
k,j
| {z }
Hydrodynamic pressure Load S0
ZZ
~ nk (ξ)dS
~
−ρg ~
ζnk (ξ)dS , k = 1, . . . , 6. (14) + iI{ϕj (ξ)}
ZZ
S ρ
| {z } = − I{ϕj (ξ)}nk (ξ)dS ηj e¨iωt
~ ~
Hydrostatic pressure load ω S0
| {z }
Here nk is defined in (8) and (9). added mass
The hydrostatic pressure loads give the mean buoy-
ZZ
ancy. The component of the hydrodynamic pressure + −ρ R{ϕj (ξ)}nk (ξ)dS ηj e˙iωt .
~ ~
S0
load due to the diffraction potential gives the wave- | {z }
excitation loads and that due to the radiation potential damping
50
Viswanathan et.al., “Pythonic approach to BEM”
Here, R and I represent the real and imaginary com- Determination of such a Green function provides an
ponents, respectively, and the dot and double-dot rep- explicit solution to the potential. However, this type
resent time derivatives. of source potential is not known except for some very
The load component proportional to the acceleration simple body geometries (Newman, 1977, pp. 138–137).
is referred to as the added mass, and that proportional (Wehausen and Laitone, 1960) gives expressions for
to the velocity is referred to as damping. Thus, the finite-depth Green function. Kim (2008) gives a
ρ
ZZ detailed derivation for the deep-water Green function.
Akj = − ~ k (ξ)dS
I{ϕj (ξ)}n ~ (20) (Telste and Noblesse, 1986) gives expressions for
ω S0
ZZ the infinite-depth free-surface Green function and its
Bkj = −ρ ~ k (ξ)dS,
R{ϕj (ξ)}n ~ (21) derivatives, with the velocity potential expressed as
S0 ~ f )e−iωt }. These expressions, modified for a
R{G(~x, ξ;
iωt
where Akj is referred to as the added-mass, and Bkj is temporal component of e of the velocity potential,
th
referred to as the radiation-damping, in the k direc- are given as
tion due to wave radiation in the j th mode of oscilla-
−1 1 1
tion. For details, see (Faltinsen and Michelsen, 1975), ~
G(~x, ξ; f ) = + 0 + G(~ ~ f)
e x, ξ, (24)
4π r r
and (Guha et al., 2016).
where,
2.2. The Green Function Method
G(~ ~ f ) = −1 [2f {R0 (h, v) − iπJ0 (h) exp(v)}]
e x, ξ,
2.2.1. The free-space Green function 4π
(25)
Consider a body placed inside an unbounded fluid do- 2
main. The velocity potential at any field point Q in ω L
f= , L being the reference length (26)
the fluid domain is given by (Lamb, 1879, p. 60) g
ρ = (x − ξ)2 + (y − η)2
(27)
∂ϕ ∂ϕ0 1
ZZ
−1
ϕQ = − dS (22) 1/2
r = ρ + (z − ζ)2
2
4π S ∂n ∂n r (28)
1/2
r0 = ρ2 + (z + ζ)2
i.e., as the resultant potential due to the
distribution (29)
∂ϕ0
of simple sources of strength ∂ϕ ∂n − ∂n on the body h = fρ (30)
surface, and where ϕ and ϕ0 correspond to potentials v = f (z + ζ) (31)
outside and inside the closed body surface S, respec-
tively. Here, r is the distance between the field point
~ on the body sur-
Q(~x), and the source located at P (ξ), Image singular point
face, where ~x = (x, y, z) is the position vector of the (ξ,η,-ζ≥0)
field point, and ξ~ = (ξ, η, ζ) is the position vector of
(x-ξ)2+(y-η)2= h/f
the source point on the body surface.
The next step is to define the free-space Green func-
~ = −1 , which is analogous to the source-
tion G∗ (~x, ξ) r'=d/f z+ζ=v/f
4πr
potential, and the source density σ(ξ)~ = ∂ϕ − ∂ϕ0 .
∂n ∂n
We may then express the potential at any field point
as
ZZ
ϕ(~x) = ~ ∗ (~x; ξ)dS
σ(ξ)G ~ (23) (x,y,z≤0)
S r Field point
2.2.2. The free-surface Green function
In cases where the body may move in a fluid do- (ξ,η,ζ≤0)
main bounded by other boundaries such as the free- Singular point
surface, the fluid bottom, or lateral boundaries, addi-
tional boundary conditions are imposed on the prob- Figure 2: Definition sketch [adapted from (Telste and
lem. Noblesse, 1986)]
The Green function should satisfy the Laplace equa-
tion in the fluid domain, and all boundary conditions Considering the R.H.S. of (24), and the definition
satisfied by ϕ, except the body boundary condition. sketch in Figure 2, we make the interpretations that
51
Modeling, Identification and Control
the first term represents the sum of the source poten- Here, the integral over the body surface is to be in-
tial at a field point ~x = (x, y, z) due to a unit source terpreted in the Cauchy principal value sense, since
at ξ~ = (ξ, η, ζ), and the image-source, having coordi- it is singular when ~x = ξ. ~ The limiting process of
nates (ξ, η, −ζ). This image source (Newman, 1977, p. the Cauchy principal-value gives (Malenica and Chen,
160) accounts for the interaction between the body and 1998):
the linearized free surface which behaves like a rigid ZZ
boundary. The second term G(~ ~ f ) is the oscillat-
e x, ξ, ∂ ~ ~ f )dS
σj (ξ)G(~ x, ξ;
ing potential at the field point due to the oscillation of ∂n(~x) S0
the source strength, to account for the oscillating flow σj (~x)
ZZ ~
= + ~ ∂G(~x, ξ; f ) dS (39)
σj (ξ)
due to the presence of waves, and therefore referred to 2 ∂n(~x)
S0
as the wavy part of the Green function.
The wavy part of the Green function given by (25) Thus, (38) gives
has partial derivatives:
σj (~x)
ZZ ~
∂G
e ∂Ge (x − ξ) + ~ ∂G(~x, ξ; f ) dS
σj (ξ)
= (32) 2 S0 ∂n(~x)
∂x ∂ρ ρ (
∂G ∂Ge (y − η) iωnj (~x), j = 1, . . . 6
= . (40)
e
= (33) ∂ϕ0
− ∂n(~
∂y ∂ρ ρ x) , j=7
x∈S0
~
∂G
e 1 1
= − 2f 2 + R0 (h, v) From this the source density distributions associated
∂z 4π d with the diffraction and radiation problems can be de-
− iπJ0 (h)ev (34) termined, provided we have knowledge about the in-
cident potential, the generalized normals to the body
where, surface, and the normal derivative of the associated
Green function.
∂G
e 1 2 The numerical procedure for the determination of
2f {R1 (h, v) + iJ1 (h)ev }
= (35)
∂ρ 4π the source density distribution is presented in the fol-
d = (h2 + v 2 )1/2 = f r0 . (36) lowing section.
Here, J0 (h) and J1 (h) are usual Bessel functions of
the first kind, and R0 (h, v) and R1 (h, v) are real func- 2.3. Numerical Solution to the
tions, which are evaluated by the FORTRAN subrou- Diffraction–Radiation Problem
tine GRADIF, the printout of which, is available in the 2.3.1. The Hess and Smith panel-method
appendix of (Telste and Noblesse, 1986).
Numerous works cite this method and it has been We refer to (Hess and Smith, 1967), and consider a
validated in (Chakrabarti, 2001). body of arbitrary shape in an infinite fluid domain,
where the body surface is approximated as being built
2.2.3. Determination of the source density up of N flat panels, each with an associated constant
distribution source density distribution σp .
This would allow for the representation of the field
Once the Green function is determined, the solution point velocity potential as
for ϕj , j ∈ {1, . . . , 7} can be expressed as given in
(Faltinsen and Michelsen, 1975) by XN ZZ
ZZ ϕ(~x) = ~
σp (ξp ) G∗p (~x; ξ~p )dS, (41)
ϕj (~x) = ~ ~
σj (ξ)G(~x, ξ; f )dS, (37) p=1 S p
S0
where G is the deep-water Green Function given by where, ξ~p is the position vector of the centroid of the
(24). pth panel with surface Sp , and G∗p is the associated
The application of the body boundary condition free-space Green function.
given by (7) to the above gives
∂
ZZ 2.3.2. Extending the Hess and Smith panel-method
~
σj (ξ)G(~ ~ f )dS
x, ξ;
∂n(~x) to the free-surface problem
S0
(
iωnj (~x), j = 1, . . . 6 Extending the panelling philosophy to the case of a
= ∂ϕ0 . (38) body in the presence of a free surface with waves,
− ∂n(~
x) , j=7
x∈S0
~ the free-space Green function, is now replaced by the
52
Viswanathan et.al., “Pythonic approach to BEM”
ZZ
deep-water, free-surface Green function given by (24), ∂Gp
dS
where, r and r0 represent the distance of the field point Sp ∂x
from the source panel and the image panel, as shown " #
−1
ZZ
∂ 1 1
in Figure 3. = + +G
e p dS, (47)
4π x, ξ~p ) r0 (~x, ξ~p0 )
Sp ∂x r(~
r'
Z ∞ ZZ
Y ∂Gp
X dS
Sp ∂z
" #
−1
ZZ
source body ∂ 1 1
= + +G
e p dS. (49)
4π x, ξ~p ) r0 (~x, ξ~p0 )
Sp ∂z r(~
p(ξ,η,ζ) ∞
r Applying the body-boundary condition given by (38)
q(x,y,z) to the body-surface, now approximated by N panels,
each having respective constant source-densities, for
wave induced each mode j of the body, where j ∈ {1, . . . , 6} cor-
oscillatory flow ∞
responds to the six radiation modes, and j = 7 corre-
sponds to the diffraction mode,
Figure 3: Boundary Panels.
N
∂Gp (~x, ξ~p ; f )
X ZZ
σjp (ξ~p ) dS
The field point velocity potential is then given by p=1 Sp ∂n(~x)
(
N
iωnj (~x), j = 1, . . . 6
ZZ = ∂ϕ0
− ∂n(~
X
ϕ(~x) = σp (ξ~p ) Gp (~x; ξ~p )dS, (42) x) , j=7
x∈ξ~p
~
p=1 Sp
where p ∈ {1, . . . , N }. (50)
and the component velocities are given by Thus, the Hess and Smith panel-method transforms
the body-integral equation (38) to a set of linear alge-
N
∂Gp (~x; ξ~p ) braic equations, which can be solved to determine the
ZZ
∂ϕ(~x) X
u= = σp (ξ~p ) dS, (43) source densities σjp associated with each mode j, and
∂x p=1 Sp ∂x
for each panel p.
N
∂Gp (~x; ξ~p ) The integral of the normal derivative of the Green
ZZ
∂ϕ(~x) X
v= = σp (ξ~p ) dS, (44) function in (50) can be determined from the derivatives
∂y p=1 Sp ∂y
along the x, y, z directions as given by (63)–(65), and
N
∂Gp (~x; ξ~p ) the velocity potential φj associated with each mode
ZZ
∂ϕ(~x) X
w= = σp (ξ~p ) dS. (45) can be determined from equations of the form of (42).
∂z p=1 Sp ∂z
Once the velocity potentials associated with each mode
is known, the hydrodynamic parameters can be deter-
In view of (24), the double integrals in (42)–(45) can mined.
be written as In determining the integrals of the Green function,
ZZ and its derivatives, at any field point ~x, due to a con-
stant source distribution over a flat panel p with cen-
Gp (~x; ξ~p )dS
Sp troid at ξ~p , as indicated in (46)–(49), we need to solve
integrals of the form Sp 1r dS,
RR RR
" # GdS,
e and their
−1 Sp
ZZ
1 1
= + +G
e p dS, (46) derivatives. The method for evaluation of such inte-
4π Sp r(~x, ξ~p ) r0 (~x, ξ~p0 ) grals follow.
53
Modeling, Identification and Control
r2 r3 + r4 + d34
r1 r4 × ln
r3 + r4 − d34
r r3
V2(x2,y2,0) d2
3 +
(x − x4 )(y1 − y4 ) − (y − y4 )(x1 − x4 )
dS Z d41
V3(x3,y3,0)
d 34
r4 + r1 + d41
d 12
× ln
Y r4 + r1 − d41
X
V1(x1,y1,0)
m12 e1 − h1
d4
1 V4(x4,y4,0) − z tan−1
zr1
Figure 4: The panel co-ordinate system. m12 e2 − h2
− tan−1
zr2
The following are defined
−1 m23 e2 − h2
1/2 + tan
d12 = (x2 − x1 )2 + (y2 − y1 )2
(51) zr2
1/2 −1 m23 e3 − h3
d23 = (x3 − x2 )2 + (y3 − y2 )2
(52) − tan
zr3
1/2
d34 = (x4 − x3 )2 + (y4 − y3 )2
(53)
m34 e3 − h3
1/2 + tan−1
d41 = (x1 − x4 )2 + (y1 − y4 )2
(54) zr3
m34 e4 − h4
− tan−1
y2 − y1 zr4
m12 = (55)
x2 − x1
−1 m41 e4 − h4
y3 − y2 + tan
m23 = (56) zr4
x3 − x2
y4 − y3 −1 m41 e1 − h1
m34 = (57) − tan (62)
x4 − x3 zr1
y1 − y4
m41 = (58)
x1 − x4 We note that direct use of the expression for S 1r dS
RR
54
Viswanathan et.al., “Pythonic approach to BEM”
55
Modeling, Identification and Control
2.3.5. Determination of the source densities – The j ∈ 1, . . . , 7, for each incident wave frequency ω, eval-
α matrix uated at the centroid of each panel p.
When the expressions for the Green function have been
computed, the next step is to compute the source den- 2.3.7. Determination of the Froude–Kryloff and
sities. To this end, let α be an N × N matrix where diffraction loads
each term αps represents the induced normal velocity Having determined the diffraction potentials ϕω 7p from
at the centroid of body panel p, p ∈ {1, . . . , N }, due (69), the excitation force along any DoF k, for any inci-
to unit source density distributions on source panel s, dent frequency ω may now be expressed with reference
s ∈ {1, . . . , N }. In the presence of a free surface, this to (16) as
term would also include the induced normal velocity at " #
N n
the body panel centroids due to the image of the source e
X o
panels about the free surface. In addition, if there is a Fk (ω, t) = −iωρ ϕ0p + ϕ7p nkp ∆Sp eiωt .
ω ω
p=1
wave present on the free surface, then this term would
also include the integral of the normal derivative of the (70)
wavy part of the Green function due to an oscillating
Here, nkp is the k th component of the generalized unit
source of unit magnitude on the source panel s, oscil-
normal vector given by (8), and (9), evaluated at the
lating at a frequency equal to the wave frequency ω.
centroid of body panel p, and ∆Sp is the area of body
Application of the body boundary condition (7) yields
panel p.
ω ω ω
ω n,ω
α11 α12 . . . α1N σj 1 vj 1
ω ω ω σω n,ω 2.3.8. Determination of the radiation loads
vj2
α21 α 22 . . . α 2N j2
.. .. = .. (68)
.. .. ..
. . . . . . Having determined the radiation potentials ϕωjp from
αNω ω
1 αN 2 . . . αN N
ω
σjωN vjn,ω
N
(69), the added-mass and damping loads along the k th
DoF due to body oscillation along the j th DoF with
where, with reference to (7), vjn,ω
p
, p ∈ {1, . . . , N } is frequency ω, can now be expressed with reference to
−∂ϕω (19) as
given by iωnj for j ∈ {1, . . . , 6} and ∂n 0 for j = 7,
evaluated at the centroid (xp , yp , zp ) of panel p. Here N
nj is given by (8), and (9). ρX n ωo
Aω
kj = − I ϕjp nkp ∆Sp (71)
Thus, (68) is the integral equation (40) expressed as ω p=1
a set of algebraic equations in the matrix form. The N n o
source density distribution associated with each panel
X
ω
Bkj = −ρ R ϕω
jp nkp ∆Sp . (72)
s for the j th mode, corresponding to the frequency ω, p=1
σjωs , may now be determined from (68).
Here, j, k ∈ {1, . . . , 6}, nkp is the k th component of
2.3.6. Determination of the velocity potentials – the generalized unit normal vector given by (8), and
The β matrix (9), evaluated at the centroid of body panel p, j is the
radiation mode of the body, and ∆Sp is the area of
Next, the velocity potentials are computed. Let β body panel p.
ω
be an N × N matrix where each term βps repre-
sents the velocity potential at the centroid of panel
p, p ∈ {1, . . . , N }, due to unit source distributions on 3. Computer Implementation
each panel s, s ∈ {1, . . . , N }, subject to the same con-
ditions as above for the presence of a free surface, and 3.1. The aims
waves on the free surface. Then, we have
To develop a methodology for computer implementa-
ω ω ω
ϕj1 β11 β12 ω
. . . β1Nω σj1 tion of the panel method, we list out the desired results
ϕω β ω
β ω
. . . β ω σω from the implementation:
j2 21 22 2N j2
.. = .. .. .. .. .. . (69)
. . . . . . • body visualization.
ω ω ω ω
ϕjN βN 1 βN 2 . . . β N N σjωN • mean free surface visualization.
We note that (69) is the matrix equivalent of the set • image body visualization in case of the presence
of algebraic equations representing the integral equa- of a free surface.
tion (37) when evaluated at the panel centroids. The • visualization of panel diagonals and normals to
solution of (69) gives the velocity potentials ϕω jp for check correct orientation of panels.
56
Viswanathan et.al., “Pythonic approach to BEM”
• field point velocities along the xy and xz planes plt file.csv : The comma separated value file
for visualization of the effects of the source part, for easy plotting of hydrody-
image part, and wavy part of the Green function. namic parameters in LATEX or
similar package.
• graphical representation of the source density dis-
tribution associated with each panel. The description of the implementation is given be-
• determine added-mass, damping and excitation low.
forces for specified degrees of freedom.
• output storage as a .txt file with simulation pa- 3.2.1. Plotting the body, free surface, image
rameters specified for identification. body,determination of panel parameters, and
calculation of hydrostatics
• graphical representation of specific hydrodynamic
results from the results stored in the .txt file, and The environment, body, panel, DoF, and plot param-
generation of .csv files to enable presentation of eters are to be specified in the 3D Diffraction.py,
results in a LATEX document or similar environ- which is the front-end of the code. Details of inputs
ment. are indicated by comments in the code.
The above parameters are passed on as arguments to
the function Hyd mstr.py, which is present inside the
3.2. The implementation file diff 3d obj func.py, and a message is displayed
From the flow-chart shown in Figure 6, we note that in the shell indicating this transfer.
the implementation has the following structure: The unit conversion of the user-defined data to units
for use during computations is performed, e.g., the
SFI OMHyD V0R1 : The file containing the below wave direction is specified in degrees by the user, and
listed code components. this is converted to radians for use in the code.
The next step is to check if the type of body specified
3D Diffraction.py : The front end PYTHON code by the user is defined in the code. An error message is
where the analysis parameters displayed if the body type is not defined, and the pro-
and options are specified. gram execution is terminated. This step is not shown
in the flow-chart.
diff 3d obj func.py : The PYTHON code containing If the body type is defined, then the next step is to
the various functions used in set the plot definitions for displaying the body and the
carrying out the analysis. free surface, if any.
This is followed by a block of code to mitigate con-
Hyd mstr( ): The master function which in- flicting scenarios, as described by the comments in the
terfaces the other miscellaneous code. This step is not shown in the flow chart.
functions and solves the various The next step is to determine the parameters for
sub-problems. plotting the body, image, and free surface as required.
It is effected by calling the function cube param. De-
gradif... .pyd : A dynamic link library that
tails of the arguments passed, and values returned can
contains a PYTHON module,
be found in the code comments. To summarize, this
or set of modules, to be called
function takes the passed arguments and generates pa-
by other PYTHON code. In
rameters for plotting (i) the body, and the complete
this case, the wrapped FOR-
image body, in the case of a submerged body, in the
TRAN code for the infinite
presence of a free surface, (ii) the body surface, exclud-
depth Green function.
ing the top surface, and image of all surfaces except the
libgradif... .dll : Additional .dll files generated top surface, for a floating body, and (iii) only the body,
during the wrapping of FOR- if there is no free-surface.
TRAN code. The next step is the plotting of the body/image/free
surface based on the return values from the previous
am.txt : The text file that contains the step. This is effected by a call to the plt cube func-
results of the analysis. tion which contains the PYTHON code for plotting the
required surfaces.
Plotter.py : PYTHON code for generating Once this stage of execution is reached, a progress
plots of the outputs stored in message is displayed in the shell window. This is not
the generated text file. depicted in the flow chart.
57
Modeling, Identification and Control
3D_Diffraction.py
Start Specify environmental, body, panel, DoF, plot parameters Call Hydrodynamics master-function Stop
YES
Plot panel normals? Fn. : plt_norm
Determine corresponding
added mass and damping values NO
YES
Plot collocation points? Fn. : plt_src
Determine corresponding
wave number NO
Determine panel-based
Determine corrresponding incident hydrostatics Fn. : hydrostatics
potential
Plotter.py
Plot the required dimensional
Start Open data file or non dimensional values and Stop .csv
write the .csv file
58
Viswanathan et.al., “Pythonic approach to BEM”
The next step is to determine the panel vertices of The postion vector of the centroid of the panel is
the source and image body. The order of storage of the ~ = cx ı̂ + cy ̂ + cz k̂,
C (81)
panel vertices is important in the view of determining
the diagonals and the surface normals. This is effected where
by calling the function pan vert cub. The process is cx d1 + cx2 d2 + cx3 d3 + cx4 d4
easily understood from the code comments. The re- cx = 1 ,
d1 + d2 + d3 + d4
turn values are vectors ‘vert’, ‘verti’, ‘z bp’, and ‘z tp’,
cy d1 + cy2 d2 + cy3 d3 + cy4 d4
which contains the vertex coordinates of the body pan- cy = 1 ,
els, the image panels, the z-coordinate of the bottom d1 + d2 + d3 + d4
surface, and the z-coordinate of the top surface, respec- cz d1 + cz2 d2 + cz3 d3 + cz4 d4
cz = 1 . (82)
tively. d1 + d2 + d3 + d4
The next step is the determination and storage of
panel parameters as described below. x1 + x2 x x2 + x3 x x3 + x4 x x4 + x1
cx1 = , c2 = , c3 = , c4 = ,
If the coordinates of the four vertices of a quadri- 2 2 2 2
lateral panel are Vi (xi , yi , zi ), i ∈ {1, . . . , 4}, then the cy = 1y + y2 y 2 + y 3 y 3 + y 4 y 4 + y1
1 , cy2 = , cy3 = , cy4 = ,
~ ~
diagonals D1 and D2 are given as 2 2 2 2
z1 + z2 z2 + z3 z3 + z4 z4 + z1
1 cz = 2 , cz =3 , cz =
4 , cz = .
~1 = V~3 − V~1 = (x3 − x1 )ı̂ + (y3 − y1 )̂ + (z3 − z1 )k̂
D 2 2 2 2
(83)
(73)
~2 = V~4 − V~2 = (x4 − x2 )ı̂ + (y4 − y2 )̂ + (z4 − z2 )k̂. and
D p
(74) d1 = (x2 − x1 )2 + (y2 − y1 )2 + (z2 − z1 )2 ,
p
Here, ı̂, ̂, k̂ are unit vectors along x, y and z directions. d2 = (x3 − x2 )2 + (y3 − y2 )2 + (z3 − z2 )2 ,
p
The normal ~n and the unit normal n̂ to the panel d3 = (x4 − x3 )2 + (y4 − y3 )2 + (z4 − z3 )2 ,
are then given as p
d4 = (x1 − x4 )2 + (y1 − y4 )2 + (z1 − z4 )2 . (84)
~n = D ~1 × D
~2 (75)
The panel coordinates (xi , yi , zi ), i ∈ {1, . . . , 4}, can
~n be transformed from the body coordinate system de-
n̂ = = n1 ı̂ + n2 ̂ + n3 k̂, (76)
|n| fined by (ı̂, ̂, k̂) to the local coordinate system defined
ˆ l l
where n , n , and n are the x, y and z components of by (l, p̂, n̂) as (xi , yi , 0), i ∈ {1, . . . , 4}, using
1 2 3
the unit surface normal. xli = (xi − cx )l1 + (yi − cy )l2 + (zi − cz )l3 ,
Similarly, defining L ~ lying on the surface of the panel
as yil = (xi − cx )p1 + (yi − cy )p2 + (zi − cz )p3 . (85)
The centroid of the source panel (cxp , cyp , czp ), lying
~ x4 + x3 x1 + x2
L= − ı̂ at a distance specified by parameter cp from the body
2 2
panel, is given by
y4 + y3 y1 + y2
+ − ̂
2 2 cxp = cx − cp · n1 , cyp = cy − cp · n2 , czp = cz − cp · n3
(86)
z4 + z3 z1 + z2
+ − k̂. (77)
2 2 The panel parameters calculated above for each
~ is source and image panel are stored as a vector of vectors
The unit vector along L
for use in later calculations. Details of the storage can
~ be understood from the code.
ˆl = L = l1 ı̂ + l2 ̂ + l3 k̂. (78) If the diagonals, normals and centroids of the source
~
|L|
panels are required to be plotted, functions plt diag,
Another vector lying on the surface of the panel and plt norm, and plt src are called.
perpendicular to both ˆl and n̂ would then be given by The function hydrostatics determines the hydro-
static parameters of the body as described below.
P~ = n̂ × ˆl. (79) The area of a quadrilateral panel, given its four ver-
tices, is
The unit vector along P~ is given as,
1
A = (x1 y2 + x2 y3 + x3 y4 + x4 y1 )
P~ 2
p̂ = = p1 î + p2 ĵ + p3 k̂. (80)
|P~ | − (x2 y1 + x3 y2 + x4 y3 + x1 y4 ) . (87)
59
Modeling, Identification and Control
Thus, the volume bounded by N panels is given by where Lnd is the characteristic length. This is simi-
N
lar to the non-dimensionalization in WAMIT (Newman
(88) and Lee, 2013, Sec. 3.1).
X
∇= Aj n3,j zj .
j=1
Once the hydrostatics are determined, they are dis-
played in the shell output along with a progress mes-
Here, n3,j is the z component of the unit normal to sage.
panel j, and zj is the z-coordinate of the centroid of
panel j.
The vertical and longitudinal centres of buoyancy are 3.2.2. The source, and image-source Green
given by functions
1
PN 2 The next step is to determine the non-wavy part(s)
2 j=1 Aj n3,j zj
zCB = , (89) of the Green function at the body panel centroids
∇ due to unit source distribution on the source pan-
1
PN
j=1 A j n 3,j zj x j els/image panels. This is effected by calling the func-
xCB = 2 . (90)
∇ tion non wav green func, which returns the follow-
ing:
Here, xj is the x -coordinate of the centroid of panel j.
The longitudinal centre of flotation is given as The IV matrix: An N × N matrix, each element of
PN
− j=1 Aj n3,j xj which represents the induced velocity at the cen-
xWP = , (91) troid of panel p, by unit source density distribu-
AWP
tion on source panel s. Each element ivps is itself
where AWP is the waterplane area given by x y z
a vector [vps , vps , vps ], which represents the x, y, z
N
components of the induced velocity.
X
AWP = − Aj n3,j . (92)
The IVI matrix: An N × N matrix, each element of
j=1
which represents the induced velocity at the cen-
The moment of the waterplane about the x and y troid of panel p by unit source density distribu-
axes are given by tion on image of source panel s, referred to as
N
panel s0 . Each element ivips0 is itself a vector
x y z
[vps 0 , vps0 , vps0 ], which represents the x, y, z com-
X
xx
IWP =− Aj n3,j yj2 , (93)
j=1
ponents of the induced velocity.
N
yy
X The DNR matrix: An N × N matrix, each element of
IWP =− Aj n3,j x2j . (94)
which represents the normal component of the in-
j=1
duced velocity at the centroid of panel p by unit
The hydrostatic stiffness terms are then given by source density distribution on source panel s.
C33 = ρgAWP (95) The DNRI matrix: An N × N matrix, each element
C35 = −ρgAWP xWP (96) of which represents the normal component of the
xx
C44 = ρg {∇zCB − ∇zCG + IWP } (97) induced velocity at the centroid of panel p by
unit source density distribution on image of source
C53 = C35 (98)
yy
panel s, referred to as panel s0 .
C55 = ρg {∇zCB − ∇zCG + IWP }. (99)
The R INV matrix an N × N matrix, each element
They may be non-dimensionalized as
of which represents the induced velocity potential
nd C33 at the centroid of panel p by unit source density
C33 = , (100)
ρgL2nd distribution on source panel s.
nd C35
C35 = , (101) The RI INV matrix an N × N matrix, each element
ρgL3nd of which represents the induced velocity potential
nd C44 at the centroid of panel p by unit source density
C44 = , (102)
ρgL4nd distribution on image of source panel s, referred
nd
C53 nd
= C35 , (103) to as panel s0 .
nd C 55 In determining the IV and IVI matrices, we make
C55 = , (104)
ρgL4nd use of (63), (64), and (65).
60
Viswanathan et.al., “Pythonic approach to BEM”
In determining the DNR and DNRI matrices, we 3.2.4. Body in the presence of free-surface waves
make use of the relation
n
If waves are present, and the body is free to move along
vps = ~vps · n̂p , (105) the specified DoFs, then the diffraction-radiation prob-
n
where vps is the induced normal velocity at the cen- lem is to be solved.
troid of panel p due to source density distribution on We start by determining the generalized normals
x y z
panel s. ~vps = vps ı̂ + vps ̂ + vps k̂ is the induced velocity given by (8) and (9).
vector at the centroid of panel p due to source den- The presence of waves necessitates the
sity distribution on panel s, and n̂p is the unit positive evaluation of the integral of the wavy part
surface normal at the centroid of panel p given by (76). of the Green function and its derivatives.
In determining the R INV and RI INV matrices, This is accomplished by calling the function
we make use of (62). wav green func, which returns, for each wave
frequency specified in the input:
3.2.3. Body in steady, uniform incident flow
In the presence of an incident flow, assuming the body The SG0 matrix: An N × N matrix, each element of
to be fixed, the problem to be solved is a diffraction which represents the integral of the wavy part of
problem, and hence the mode j = 7 for (68). Each the Green function at the centroid of panel p due
term αps of the α matrix represents the induced normal to an oscillating unit density source distribution
th
velocity at the centroid of the p body panel due to on panel s, calculated based on (25) and (66).
th
unit source density distribution on the s source panel,
and on the s0 th image-source panel in addition, if there The SDG0 N matrix: An N × N matrix, each ele-
is a free surface . Thus, each term αps is given as ment of which represents the integral of the normal
ZZ ( ) derivative of the wavy part of the Green function
−1 ∂ 1 at the centroid of panel p due to an oscillating unit
αps = dS
4π S ∂n(ξ ~p ) r(ξ~p , ξ~s ) density source distribution on panel s, calculated
ZZ ( ) based on (32)–(34), (67), and (105).
∂ 1
+ dS . (106)
S 0 ∂n(ξ ~p ) r0 (ξ~p , ξ~s0 )
In determining the R0 (h, v) and R1 (h, v) in (32)–
Here, p, s, s0 ∈ {1, . . . , N }. (34), we make use of the gradif function which is orig-
With reference to the definition of the DNR, and inally written in FORTRAN, the printout of which, is
DNRI matrices, the α matrix can be expressed as given as an appendix to (Telste and Noblesse, 1986).
We use F2PY (Peterson, 2005) to wrap the FOR-
α = DNR + DNRI (107) TRAN code for PYTHON. This wrapping generates
Once the α matrix is determined, the source density the gradif... .pyd and the libgradif... .dll
distribution associated with each panel may now be files in Windows OS. Instead of .dll files, .so files are
determined as generated by F2PY on Linux/Mac OS. The gradif
T −1 n T function may now be called into PYTHON, as any
[σ7s ] = [αps ] [v7p ] ; p, s ∈ {1, . . . , N } (108)
other regular PYTHON function.
Here, in the sole presence of an incident flow defined With reference to (68), the α matrix corresponding
x y z
by ~v∞ = [v∞ , v∞ , v∞ ], v7np is the negative of the com- to wave frequency ω is now defined as matrix αω , where
ponent of the incident flow velocity in the direction of each element αps ω
represents the normal component of
th
the positive surface normal of the p panel, as given the induced velocity at the centroid of body panel p
in the description of (68), and is expressed as due to
v7np = −~v∞ · n̂p . (109)
1. unit source density distribution on source panel s,
Here, ~v∞ is specified in the inputs, and n̂p is deter- and,
mined using (76).
Once the density distribution associated with each
source panel is determined, the null point velocities at 2. unit source density distribution on the image of
the panel centroids may be determined as source panel s, referred to as s0 , in case of the
presence of a free surface, and,
[Vp ]T = [IVps ][σ7s ]T + [IVIps0 ][σ7s ]T . (110)
These are then summed up with the incident flow at 3. oscillating source density distribution of unit mag-
the centroid of each panel and plotted as a quiver plot. nitude on panel s.
61
Modeling, Identification and Control
Thus, the elements of the αω matrix are given by With reference to the definitions of the R INV,
ZZ ! RI INV, and the SG0 matrices, we see that
ω −1 ∂ 1
αps = dS β ω = R INV + RI INV + SG0ω . (115)
4π S ∂n(ξ ~p ) r(ξ~p , ξ~s )
ZZ !
∂ 1 The complex spatial component of the velocity po-
+ dS
S 0 ∂n(ξ ~p ) r0 (ξ~p , ξ~s0 ) tential at the centroid of body panel p, corresponding
to the j th mode, with frequency ω, can now be ex-
ZZ e ξ~p , ξ~s ; f )
∂ G(
+ dS, (111) pressed, with reference to (69), as
S ∂n(ξ~p )
[ϕω T ω ω T
jp ] = [βps ][σjs ] . (116)
0
where p, s, s ∈ {1, . . . , N }.
With reference to the definitions of the DNR, Once the radiation potentials are known, the corre-
DNRI, and the SDG0 N matrices, we see that sponding added mass and damping components in the
k th DoF, due to body motion along the j th DoF, can
ω ω
α = DNR + DNRI + SDG0 N (112) be determined by using (71) and (72).
Mode j = 7 in this case, is the diffraction problem
Again, in determining the normal components from with the body held fixed at its mean position in inci-
the (x, y, z) components given by (43), (44), (45), and dent waves of specified frequencies.
(67), we make use of (105). With reference to (68),
Once the α matrix is determined, we may determine
the source density distribution σjωs associated with each
n,ω ∂ ω
source panel s, for a given frequency of oscillation ω, v 7p = − (ϕ )
0 (117)
∂n ξ~p
for a given mode of oscillation j from equations of the
form of (108), with vjn,ω p
’s corresponding to the nor- Where ϕω is the velocity potential given by (2),
0
mal velocity at the panel centroids due to oscillations ~
ξp (ξp , ηp , ζp ) is the centroid of submerged body panel
with unit amplitude corresponding to each mode j, as
p.
indicated by (7), (8), and (9). Thus,
The wave induced water-particle velocity at the cen-
ω T ω −1 n,ω T
[σjs ] = [αps ] [vjp ] (113) troid of the pth panel is indicated by ~u0p (u0p , v0p , w0p ),
where
With reference to (69), the β matrix correspond- ∂ ω
ω u0p = ϕ0p
ing to wave frequency ω, is now defined as matrix β
ω ∂x ξ~p
where each element βps represents the induced velocity
−ik(ξp cos γ−ηp sin γ) kζp
potential at the centroid of body panel p due to = Za ω cos γe e (118)
1. unit source density distribution on source panel s, ∂
ϕω
v0p = 0p
and, ∂y ξ~p
2. unit source density distribution on image of source = Za ω sin γe−ik(ξp cos γ−yηp sin γ) ekζp (119)
panel s, referred to as s0 , in case of the presence ∂ ω
w0p == ϕ0p
of a free surface, and, ∂z ~ξp
−ik(ξp cos γ−ηp sin γ) kζp
3. oscillating source density distribution of unit mag- = iZa ωe e . (120)
nitude on panel s.
Here, γ [rad] is the wave direction, and Za = 1 m is
Thus, the elements of the β ω matrix are given by the wave amplitude. See, (Guha, 2012, pp. 31–32).
ZZ ! Also, with reference to (105),
ω −1 1
βps = dS
4π S r(ξ~p , ξ~s ) v7n,w
p
= −~u0p · n̂p , (121)
ZZ !
1 where n̂p is the unit outward normal to the pth body
+ dS
S0 r0 (ξ~p , ξ~s0 ) panel given by (76).
The α matrix being given by (112), an equation
ZZ
+ e ξ~p , ξ~s ; f )dS,
G( (114) of the form (108) may now be solved to determine
S
the source densities σ7ωs corresponding to each incident
0
where p, s, s ∈ {1, . . . , N }. wave frequency ω.
62
Viswanathan et.al., “Pythonic approach to BEM”
h i
The matrix of diffraction potentials ϕω
7p associated
the figure number in this paper. Thus, for each case
with each body panel p, for each incident wave fre- presented, there is a different front-end file available
quency ω, is obtained from a relation similar to (116). in the download, but they all use the same functions
The excitation force along any DoF, k, may now be contained inside the file named diff 3d obj func.py.
determined with reference to (16) as More instructions on how to run the different scenarios
are given in the README.txt file of the download.
N
X For better comprehension of some of the scenarios,
Fke
= −iωρ ϕ0p + ϕ7p nkp ∆Sp . (122) it is recommended to run the corresponding front-end
p=1 code to get the three-dimensional graphical output.
63
Modeling, Identification and Control
6 10.0
7.5
4
5.0
2
z [m]
2.5
0
z [m]
0.0
2
2.5
4
5.0
6
7.5
6
4 10.0
10.0
2 10.0 7.5
7.5 5.0
6 0 5.0 2.5
4 2.5 0.0
m]
0.0
2 2
x [m] 2.5 ]
2.5
y [m
y[
0 5.0 5.0
x [m] 2 4 7.5 7.5
4 6 10.0 10.0
6
4
7.5
2
5.0
z [m]
0 2.5
z [m]
2 0.0
2.5
4
5.0
6
7.5
6
4
2 7.5
0 5.0
y [m]
2.5
2 7.5 0.0
5.0
m]
6 4
4 2.5
0.0
2.5
y[
2 0 x [m] 2.5 5.0
2 4 6 5.0
x [m] 6
7.5
7.5
Figure 7: Body in infinite fluid domain. Figure 8: Body in semi-infinite fluid domain.
64
Viswanathan et.al., “Pythonic approach to BEM”
z [m]
are positive since an outward flow from the panel is re- 0.0
quired to oppose the incident flow and bring the total 2.5
5.0
z [m]
Effect of the image-source Green 0.0
function 2.5
5.0
Consider a cuboidal body of dimensions 15 × 10 × 10
7.5
m, submerged such that the top surface is 2.5 m be-
low the free surface. Consider a steady, uniform flow 10.0
10.0
along the positive X axis given by vf = [1, 0, 0] m/s 7.5
5.0
in the fluid domain. Since a free-surface is present, 10.0 2.5
7.5 0.0
the effect of the image-body is also to be considered, 5.0
m]
2.5
0.0 5.0
2.5
y[
and the free-surface Green function is now given by x [m] 2.5
5.0 7.5
G = −1 1 1
7.5
4π r + r 0 . The field and null point velocities 10.0 10.0
are shown in Figure 12a.
When the immersion is such that top surface is 0.5 m (b) Field point velocities in the XZ plane.
below the water surface, the field point and null point
velocities are as shown in Figure 12b. Figure 9: Fully submerged body in infinite fluid do-
When the top surface immersion depth is 2.5 m, the main, and in the presence of a steady uniform
incident flow deviates almost symmetrically. However, flow vf = [1, 0, 0] [m/s].
when the immersion depth is 0.5 m, the flow deviation
is not symmetric. This can be observed from the null
point velocities of the top and bottom starboard panels
bordering the aft panels, and the second and third row
65
Modeling, Identification and Control
10.0
7.5
5.0 15
2.5
10
z [m]
0.0
2.5 5
5.0
z [m]
7.5 0
10.0
5
10.0
7.5
5.0 10
2.5
10.0 0.0
7.5
5.0
m]
2.5 15
2.5
y[
0.0 5.0 15 10
x [m] 2.5
7.5
5 0
5.0
7.5 y [m] 5 10
15 15 10 5 0 5 10 15
10.0
10.0 x [m]
15
10
5
z [m]
0
10.0
7.5 2 5
5.0
1
2.5 10
Source strength
z [m]
0.0
0
2.5 15
15 10
5
5.0 1 y [m]0 5 10
15 15 10 5 0 5 10 15
7.5 x [m]
10.0 2
10.0
7.5 10.0
5.0 7.5
2.5 5.0
2.5
y [m0.0 2.5 0.0
] 2.5 ]
5.0
7.5 7.5
5.0 x [m (b) Top surface 0.5 [m] below the free surface
10.010.0
66
Viswanathan et.al., “Pythonic approach to BEM”
z [m]
when the body is floating at a draft of 5 m. Again, we 0
observe that the flow near the surface does not deviate
5
in the XZ plane but deviates in the XY plane to pass
around the body.
10
15
4.4. Body in semi-infinite fluid domain in 15 10 5 10 15
0 5 5 0 5
the presence of a free surface and y [m] 10 15 15 10
x [m]
waves: Effect of the wavy part of the
Green function
We consider a cuboidal body of dimensions 15×10×10 (a) Flow along the XZ plane.
m floating at a draft of 5 m. To illustrate the effect of
radiation waves, we consider the induced velocities at
the field points, due to the wavy part of the Green func-
tion alone, as given by (25). The incident wave frequen-
cies [rad/s] to be considered are specified by the user
15
against the vector ‘omega’ in the 3D Diffraction.py
file. We can select a particular frequency and plot the 10
10
the fluid pressure forward of the body, and a decrease
]
5 5
0
in the fluid pressure aft of the body. The fluid now ]
10 5 x [m
circulates around the body, from the high pressure zone 10
15 15
to the low pressure zone, as shown by the plots for the
field point velocities in the XY plane. Considering (b) Flow along the XY plane.
the XZ plane, we observe that low- and high-pressure
zones also develop along the bottom surface. Figure 13: Floating body in semi-infinite fluid, and in
Considering the sway motion of the body, the field the presence of a steady uniform flow vf =
point velocities are shown in Figure 15. Again, we [1, 0, 0] [m/s].
observe similar behaviour of the field velocities as in
the surge case.
Considering the heave motion of the body, the field
point velocities are shown in Figure 16. We observe
67
Modeling, Identification and Control
15
10
15
5
10
z [m]
0
5
5
z [m]
0
10
5
15
15 10
15
15
10 10 15
15
10 5 5 10
5 5
0 0
x[
m]
0
x [m0 ]
m]
y[
y [m
5 5
] 5 5
10 10
10 10
15 15 15 15
(a) Field point velocities in the XY plane. (a) Field point velocities in the XY plane.
15
15
10
10
5
z [m]
5
0
5 0 z [m]
10 5
15 10
15
10 15
5 10
5
0
x[ 0 15
y [m
5
10 10 15 m] 5
5 10 15
0 5 10 0
]
15 15 10 5 10 5
x [m]
15 15
y [m]
(b) Field point velocities in the XZ plane. (b) Field point velocities in the Y Z plane.
Figure 14: Radiation waves due to surge of floating Figure 15: Radiation waves due to sway of floating
body. body.
68
Viswanathan et.al., “Pythonic approach to BEM”
z [m]
0
moves down, and a low pressure zone is created on the
port side of the bottom surface as it moves up. These 5
pushes the fluid on the top while pulling the fluid at the 15
10
5 15
bottom. Looking at Figures 20b and 20c, we observe x [m 0 5 10 15
5
that this causes a wave crest to form on top of the body. ] 10 5
0
15 15 10 y [m]
The field velocities oscillate in time, with a frequency
corresponding to the radiation frequency of the body,
and after half a cycle, the velocities would point in the
(b) Field point velocities in the Y Z plane.
downward direction with the same magnitude, causing
a trough formation above the top surface of the body.
Figure 16: Radiation waves due to heave of floating
The crest/trough formation in both longitudinal body.
and transverse cross-sections indicate that the wave is
three-dimensional.
Another inference drawn is that the wave is a prop-
agating wave and not a stationary one. Had it been
a stationary wave, the velocities of the water particles
69
Modeling, Identification and Control
15
10
z [m]
0
15
5
10 15
10 10
5 5
0 15
z [m]
15
0 5
x [m]
15
10 10
10
5 15 5
15 5
10
y[ 0
0
5 m]
10 0 5 5 x [m]
10
5
y [m] 10
15 10
15
15 15
15
15
10
10 5
z [m]
5 0
z [m]
0 5
10
5
15
10 15
10
15 5
10
x[
5
0 15 y [m 0 5 10 15
m] 5
10 5 10 15 ] 10 0 5
10 5 0 5
15 15
y [m] 15 15 10
x [m]
70
Viswanathan et.al., “Pythonic approach to BEM”
z [m]
0
These radiation waves cause a change in the hydro-
5 dynamic pressure distribution on the body surface, and
10 as a result, the body experiences a force which is ex-
pressed mathematically by (19). The component of the
15 15
10
15 force proportional to the acceleration of the body is
10 referred to as the added mass, and the component pro-
5
5
x [m 0
0
portional to the velocity of the body is termed as the
] ]
5 5 y [m damping. Since both velocity and acceleration of the
10 10 body are frequency-dependent, the radiation added-
15 15
mass and damping are also frequency-dependent.
Figure 19: Yaw induced velocities at field points lying
on the XY plane. 4.5. The hydrodynamic coefficients of a
deeply submerged cube.
Considering a deeply submerged object, we hypothe-
size:
20 20 15 10 5 0 5 10 15 20
m]
15
10
015515
0 20
20
20
15
(Sarpkaya and Isaacson, 1981) gives the analytical
15
expression for the translational added mass of a deeply
(a) Field point velocities in the10XZ
10 plane.
submerged cube as 0.7ρa3 [kg]. Here ρ [kg/m3 ] is the
5 5 density of water, and a [m] is the side of the cube.
Table 1 compares the added masses calculated by the
z [m]
z [m]
0 0
5 5
code to results obtained by Guha using MDLHydroD
10
frequency domain solver, as given in (Guha, 2012, p.
10
60).
15
(b) Free surface field point ve-(c) 15Free surface field point ve- The results in OMHyD are for a cube of side 1 m,
20
20
15
10
5
105020
15
locities when viewed from 20locities when viewed from sea water of density 1025 kg/m3 , panel size of 0.125 m
20 15aft.10 5 0 5 10 15 20 port.
m]
71
Modeling, Identification and Control
·106
while no details are given for the immersion depth and
a33 [kg]
frequencies. 6
The added mass, damping and excitation forces ob- 5.5
5
tained from the code are plotted in Figure 21. 4.5
b33 [Ns/m]
1
b33 [kg/s]
f3e [N]
250 0.8
0.6
0.4
0.2
0 0.2 0.4 0.6 0.8
0.5 1 1.5 2 2.5 3
ω [rad/s]
ω [rad/s]
(b) Heave radiation damping.
4
Currently, only square panels can be used in 3
OMHyD. Use of exactly 864 panels gives erroneous re- 2
sults. However, we see that Guha’s results with 864
0.2 0.4 0.6 0.8
panels lie between our results using 384 and 1536 pan-
els. We also notice that as the mesh becomes finer, the ω [rad/s]
results are diverging from the analytical value, contrary (c) Heave excitation force.
to what one would normally expect.
Sec. 2.2.1 General Modelling Requirements of the Figure 22: Panel Convergence.
ANSYS-AQWA user manual Release 14.5, 2012, re-
quires the surface to be split at the water plane, and
hence such an analysis seems implausible in AQWA. 4.7. The hydrodynamic coefficients of a
Further, there is no indication of the results of a panel
convergence study in (Guha, 2012), for this case.
cuboidal barge.
Notwithstanding the above deficiencies, the results Results from MDLHydroD and WAMIT, for a cuboidal
presented confirm our hypothesis above. We also ar- barge of dimensions 80 × 20 × 20 m, floating at a draft
rive at the conclusion that our implementation of the of 10 m, in sea water with density 1025 kg/m3 , are
surface panelization, and evaluation of the integrals of given in (Guha, 2012). We model the same barge in
the wavy Green function and its derivatives, are not both OMHyD and ANSYS-AQWA for incident waves
wrong. Further proof of correctness of our procedure is with periods that lie in the time range [5.45,251.32]
presented in sections that follow. s, with a time interval of 5.45 s, corresponding to the
72
Viswanathan et.al., “Pythonic approach to BEM”
0.023 rad/s.
In OMHyD, the submerged body surface is dis- ·10−2
cretized into 576 square panels of side 2.5 m, and the 6
hydrodynamic coefficients are non-dimensionalized for
5
A11 /ρL3
a characteristic length of 40.0 m. In ANSYS-AQWA,
the water depth of 10, 000 m is specified to simulate 4
deep water conditions. ANSYS-AQWA gives dimen-
sional hydrodynamic coefficients, and these are non- 3
dimensionalized using (123) and (124), in the Excel
sheet available in the download. 2
0.5 1 1.5 2
The non-dimensionalization follows (Newman and p
Lee, 2013), where, the non-dimensional added-mass ω L/g
and damping terms are expressed as: (a) Non-dimensional added mass (a11 ).
73
Modeling, Identification and Control
·10−2 ·10−2
40
40
30
A22 /ρL3
A33 /ρL3
30
20 20
10 10
0 0
0.5 1 1.5 2 0.5 1 1.5 2
p p
ω L/g ω L/g
(a) Non-dimensional added mass (a22 ). (a) Non-dimensional added mass (a33 ).
·10−2 ·10−2
15
30
B22 /ρL3 ω
B33 /ρL3 ω
10
20
10 5
0 0
0.5 1 1.5 2 0.5 1 1.5 2
p p
ω L/g ω L/g
(b) Non-dimensional damping (b22 ). (b) Non-dimensional damping (b33 ).
·10−2 ·10−2
3 3
A24 /ρL4
A42 /ρL4
2 2
1 1
0 0
0.5 1 1.5 2 0.5 1 1.5 2
p p
ω L/g ω L/g
(c) Non-dimensional added mass (a24 ). (c) Non-dimensional added mass (a42 ).
·10−2 ·10−2
3 3
B24 /ρL4 ω
B42 /ρL4 ω
2 2
1 1
0 0
0.5 1 1.5 2 0.5 1 1.5 2
p p
ω L/g ω L/g
(d) Non-dimensional damping (b24 ). (d) Non-dimensional damping (b42 ).
Figure 24: Cuboidal barge a22 , b22 , a24 , and b24 Figure 25: Cuboidal barge a33 , b33 , a42 , and b42
74
Viswanathan et.al., “Pythonic approach to BEM”
·10−2 ·10−2
0.5 10
0.4
A44 /ρL5
A55 /ρL5
0.3
5
0.2
0.1
0 0
0.5 1 1.5 2 0.5 1 1.5 2
p p
ω L/g ω L/g
(a) Non-dimensional added mass (a44 ). (a) Non-dimensional added mass (a55 ).
·10−2 ·10−2
0.2 1.5
B44 /ρL5 ω
B55 /ρL5 ω
1
0.1
0.5
0 0
0.5 1 1.5 2 0.5 1 1.5 2
p p
ω L/g ω L/g
(b) Non-dimensional damping (b44 ). (b) Non-dimensional damping (b55 ).
·10−2 ·10−2
2 15
10
A51 /ρL4
A66 /ρL5
0 5
−1 0
0.5 1 1.5 2 0.5 1 1.5 2
p p
ω L/g ω L/g
(c) Non-dimensional added mass (a51 ). (c) Non-dimensional added mass (a66 ).
·10−2 ·10−2
2 10
1.5
B51 /ρL4 ω
B66 /ρL5 ω
1
5
0.5
0
−0.5 0
0.5 1 1.5 2 0.5 1 1.5 2
p p
ω L/g ω L/g
(d) Non-dimensional damping (b51 ). (d) Non-dimensional damping (b66 ).
Figure 26: Cuboidal barge a44 , b44 , a51 , and b51 Figure 27: Cuboidal barge a55 , b55 , a66 , and b66
75
Modeling, Identification and Control
5. Conclusions
The theory behind the linearized, infinite water-depth,
0 zero forward-speed wave-body interaction problem is
0.5 1 1.5 2
p refreshed to demonstrate that the determination of the
ω L/g diffraction and radiation potentials enable the evalua-
(a) Non-dimensional surge excitation force (f1e ). tion of the first order wave excitation, added-mass, and
potential-damping loads.
1 Lamb’s use of the free-space Green function method
to represent the field point velocity potential in the in-
finite fluid domain as the effect of a source distribution
on the surface of the submerged body, and its exten-
sion to the wave-body interaction problem through the
|F3e |/ρgAL2
76
Viswanathan et.al., “Pythonic approach to BEM”
sented, and the code for the frequency domain hydro- 2017), and is much simpler than the approxima-
dynamic analysis package OMHyD is made available tions given in (Telste and Noblesse, 1986). Replac-
for public access. ing the wav green func function with the global
A comprehensive discussion of the outputs from approximation is expected to reduce the associ-
OMHyD is presented, to demonstrate the effects of the ated computation time.
source, image-source, and pulsating-source part of the
2. The panel parameters in OMHyD are computed
Green function, in order to gain better perspectives
solely based on the vertex coordinates of the
on the effect of a submerged/floating body on incident
quadrilateral panels discretizing the body surface.
fluid flow, the effect of the free surface, and of radiation
All subsequent computations are thereafter based
loads.
on these panel parameters. Noting that triangu-
The hydrodynamic analysis results for a cuboidal
lar panels are special cases of quadrilateral pan-
barge, obtained using OMHyD, is then benchmarked
els, with two coincident vertices, as mentioned in
with results obtained using the commercial software
(Newman and Sclavounos, 1988, p. 5), extending
ANSYS-AQWA. From other sources discussed, it was
the present capabilities of OMHyD to accommo-
noticed that there is satisfactory agreement between
date arbitrary shapes is relatively easy. One may
OMHyD results, and results from WAMIT, MDLHy-
develop a customized panelling procedure, or im-
droD, and ANSYS-AQWA.
port panel vertex co-ordinates generated using ex-
A shortcoming of the present implementation lies
ternal software.
in the presence of irregular frequencies. Such effects
are observed in MDLHydroD and NeMOH implemen- 3. For objects with a symmetric submerged surface,
tations also. The ability to remove irregular frequency one can take advantage of the reflection rela-
effects is one major feature that sets apart commer- tionship as described in (Hess and Smith, 1967,
cial software like ANSYS-AQWA and WAMIT from p. 25), (Hess and Smith, 1962, p. 65), and p.
the other software discussed above. 30 of the lecture notes about sink-source meth-
It is thus concluded that the work succeeded in: ods and wave induced loads by O.M Faltinsen,
prescribed as course material for course MR8300
1. Building up a compendium on the source formu-
(Hydrodynamic Aspects of Marine Structures-1),
lation of three dimensional, lower-order boundary
Department of Marine Technology, NTNU. Most
element method of solution, for the first order, infi-
commercial software take advantage of symmetry
nite water-depth, zero-Froude number wave-body
(Newman and Lee, 2013, Sec. 6.1). The advan-
interaction problem, using the free-surface Green
tage is that only the non-redundant portion of the
function.
body needs to be discretized, effecting a significant
2. Demonstrating the computer implementation of reduction in computation time, as can be inferred
the theory discussed in the item above, using from (Newman, 1992).
PYTHON, to develop the open-source frequency 4. The induced velocity potential at a point lying far
domain hydrodynamic analysis software, OMHyD. from the quadrilateral source panel of area A, of
3. Demonstrating satisfactory agreement between given source density distribution σ, approximates
OMHyD results, and results from other commonly the velocity potential due to a point source of
used commercial and proprietary software. strength Aσ placed at the centroid of the panel, as
can be inferred from (Garrison, 1978, p. 106). One
The simplicity of the PYTHON syntax is particu- may make use of this fact to reduce the associated
larly advantageous for those interested in gaining a computational load.
better understanding of the working of panel meth-
ods. Further, the comprehension of the implementa- 5. Use of compiled languages like FORTRAN or C
tion algorithm would enable code development using can improve computation time. OMHyD may
compiled software like C or FORTRAN. entirely be implemented in FORTRAN, wrapped
for PYTHON using F2PY (Peterson, 2005), and
called into MODELICA taking advantage of inter-
6. Considerations for improvement operability, as described in (OpenModelica, 2020).
Or, OMHyD may also be coded in C, and called
The following may be considered for improving the directly into MODELICA using the interoperabil-
present work: ity features.
1. A global approximation to the deep-water free- 6. Lau and Hearn (1989) present a review of different
surface Green function is given in (Wu et al., methods for removal or irregular frequencies. In
77
Modeling, Identification and Control
the ‘extended boundary condition method’ formu- −1 m12 e1 − h1
− |z| tan
lated by Ohmatsu (1975), and Kleinman (1982), zr1
a rigid lid is placed on the interior free surface to
m12 e2 − h2
suppress the internal sloshing modes. Guha (2012) − tan−1
zr2
refers to the results of the numerical implemen-
tation of this method presented in (Zhu, 1994), −1 m23 e2 − h2
+ tan
including the algorithm for automatic lid genera- zr2
tion, and opines that this method is, by far, the
m23 e3 − h3
most efficient method. − tan−1
zr3
7. The theoretical basis of the evaluation of the fi-
m34 e3 − h3
−1
nite water-depth Green function is discussed in + tan
zr3
(John, 1949), (John, 1950), (Thorne, 1953), (We-
hausen and Laitone, 1960), (Chiang, 1983, Ch. 7), m34 e4 − h4
− tan−1
and (Linton and McIver, 2001, Appendix B. 4). zr4
Numerical evaluations are discussed in (Newman,
m41 e4 − h4
1985), (Newman, 1992), (Pidcock, 1985), (Linton, + tan−1
zr4
1999), and (Liu, 2015). Implementation of such
methods will enable extension of OMHyD capa- −1 m41 e1 − h1
− tan . (126)
bilities to handle shallow water problems. zr1
78
Viswanathan et.al., “Pythonic approach to BEM”
Faltinsen, O. M. Sea Loads on Ships and Offshore Hess, J. L. and Smith, A. M. O. Calcula-
Structures. Cambridge University Press, 1990. tion of potential flow about arbitrary bodies.
URL https://www.cambridge.org/no/academic/ Progress in Aerospace Sciences, 1967. 8:1 – 138.
subjects/engineering/engineering-design- doi:10.1016/0376-0421(67)90003-6.
kinematics-and-robotics/sea-loads-ships-
and-offshore-structures?format=PB&isbn= Hess, J. L. and Wilcox, D. C. Progress in the solution of
9780521458702. the problem of a three-dimensional body oscillating
in the presence of a free surface. Technical report,
Faltinsen, O. M. and Michelsen, F. C. Mo- McDonnell Douglas Corp., Long Beach, CA Douglas
tions of large structures in waves at zero Aircraft Div., 1969. URL https://apps.dtic.mil/
Froude number. Technical report, 1975. URL dtic/tr/fulltext/u2/690203.pdf.
https://www.studocu.com/no/document/norges-
teknisk-naturvitenskaplige-universitet/ John, F. On the motion of floating bodies I. Commu-
akademisk-skriving/essay/motions-of- nications on Pure and Applied Mathematics, 1949.
large-structures-in-waves-at-zero-froude- 2(1):13–57. doi:10.1002/cpa.3160020102.
number/6109623/view.
John, F. On the motion of floating bod-
Fossen, T. I. Handbook of Marine Craft Hydrodynamics ies II. Simple harmonic motions. Communica-
and Motion Control. Wiley, 2011. tions on Pure and Applied Mathematics, 1950.
doi:10.1002/cpa.3160030106.
Garrison, C. Hydrodynamic loading of large offshore
structures: Three dimensional source distribution Katz, J. and Plotkin, A. Low-Speed Aerodynamics.
method. In O. Zienkicwicz, R. Lewis, and K. Stagg, 2001. doi:10.1017/cbo9780511810329.
79
Modeling, Identification and Control
Kim, C. H. Nonlinear Waves and Offshore Structures, Newman, J. N. Marine Hydrodynamics. MIT Press,
volume 27 of Advanced Series on Ocean Engineering. 1977. URL https://mitpress.mit.edu/books/
World Scientific, 2008. doi:10.1142/4906. marine-hydrodynamics-40th-anniversary-
edition.
Kleinman, R. E. On the mathematical theory of
the motion of floating bodies-An Update. Tech- Newman, J. N. Algorithms for the free-surface Green
nical report, David W Taylor Naval Ship Re- function. Journal of Engineering Mathematics, 1985.
search and Development Center, Bethsada MD, doi:10.1007/BF00055041.
1982. URL https://apps.dtic.mil/dtic/tr/
fulltext/u2/a121433.pdf. Newman, J. N. Panel methods in marine hydrody-
namics. In 11th Australasian Fluid Mechanics Con-
Lamb, S. H. Hydrodynamics. Cam- ference. 1992. URL https://people.eng.unimelb.
bridge University Press, 1879. URL edu.au/imarusic/proceedings/11/Newman.pdf.
https://www.cambridge.org/no/academic/
Newman, J. N. and Lee, C. WAMIT User Manual
subjects/mathematics/fluid-dynamics-
Version 7.0. Technical report, 2013.
and-solid-mechanics/hydrodynamics-6th-
edition?format=PB&isbn=9780521458689. Ohmatsu, S. On the irregular frequencies in
the theory of oscillating bodies in a free sur-
Lau, S. M. and Hearn, G. E. Suppression of irregular
face. Paper 48 of the Ship Research Insti-
frequency effects in fluidstructure interaction prob-
tute, Ship Dynamics Division, Tokyo, Japan,
lems using a combined boundary integral equation
1975. URL http://resolver.tudelft.nl/uuid:
method. International Journal for Numerical Meth-
cf6d35d4-d22c-4eed-b4ba-8dd9d79c6fbe.
ods in Fluids, 1989. doi:10.1002/fld.1650090703.
OpenModelica. User guide. Open Source
Linton, C. M. Rapidly convergent representa-
Modelica Consortium, 2020. URL
tions for Green’s functions for Laplace’s equa-
https://www.openmodelica.org/doc/
tion. Proceedings of the Royal Society A: Mathe-
OpenModelicaUsersGuide/latest/.
matical, Physical and Engineering Sciences, 1999.
doi:10.1098/rspa.1999.0379. Penalba, M., Kelly, T., and Ringwood, J. Using nemoh
for modelling wave energy converters: A compara-
Linton, C. M. and McIver, P. Handbook of mathemati-
tive study with wamit. In Proc. of the 12th European
cal techniques for wave/structure interactions. 2001.
Wave and Tidal Energy Conference (EWTEC2017),
doi:10.1201/9781420036060.
Cork, Ireland, volume 27. pages 631–1, 2017. URL
Malenica, Š. and Chen, X. B. On the Irregular Frequen- http://mural.maynoothuniversity.ie/12466/.
cies Appearing in Wave Diffraction-Radiation Solu-
Peterson, P. F2PY user guide and reference man-
tions. International Journal of Offshore and Polar
ual. 2005. URL http://pds8.egloos.com/pds/
Engineering, 1998. URL https://www.onepetro.
200802/20/11/f2py_usersguide.pdf.
org/journal-paper/ISOPE-98-08-2-110.
Pidcock, M. K. The calculation of Green’s functions in
McTaggart, K. A. Three dimensional ship hydrody-
three dimensional hydrodynamic gravity wave prob-
namic coefficients using the zero forward speed green
lems. International Journal for Numerical Methods
function. Defence R & D Canada-Atlantic, 2002.
in Fluids, 1985. doi:10.1002/fld.1650051004.
URL https://pdfs.semanticscholar.org/77f1/
889f836a37df015c2fdae599804d0b40da6c.pdf. Sarpkaya, T. and Isaacson, M. Mechanics of
wave forces on offshore structures. 1981.
Milgram, J. H. Lecture notes on numerical ma- doi:10.1016/0261-7277(82)90028-6.
rine hydrodynamics: Numerical methods in
incompressible fluid mechanics. 2003. URL Telste, J. G. and Noblesse, F. Numerical evalua-
https://ocw.mit.edu/courses/mechanical- tion of the green function of water-wave radiation
engineering/2-29-numerical-marine- and diffraction. Journal of Ship Research, 1986.
hydrodynamics-13-024-spring-2003/lecture- 30(02):69–84. URL https://www.onepetro.org/
notes/. journal-paper/SNAME-JSR-1986-30-2-69.
Newman, J. and Sclavounos, P. The computation of Thorne, R. C. Multipole expansions in the theory
wave loads on large offshore structures. In BOSS’88. of surface waves. Mathematical Proceedings of the
pages 605–622, 1988. URL https://www.wamit. Cambridge Philosophical Society, 1953. 49(04):707—
com/Publications/boss88.pdf. -716. doi:10.1017/S0305004100028905.
80
Viswanathan et.al., “Pythonic approach to BEM”
Viswanathan, S. and Holden, C. Towards the devel- Wu, H., Zhang, C., Zhu, Y., Li, W., Wan, D., and
opment of an ocean engineering library for open- Noblesse, F. A global approximation to the Green
modelica. In Proc. ASME/OMAE Conf., volume function for diffraction radiation of water waves.
7B: Ocean Engineering, OMAE2019-95054. Glas- European Journal of Mechanics, B/Fluids, 2017.
gow, Scotland, UK, 2019. doi:10.1115/OMAE2019- doi:10.1016/j.euromechflu.2017.02.008.
95054.
81