46
UPTEC F 18001 Examensarbete 30 hp Januari 2018 Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson

Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

UPTEC F 18001

Examensarbete 30 hpJanuari 2018

Evaluation of SPH for hydrodynamic modeling, using DualSPHysics

Jonas Eriksson

Page 2: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

Teknisk- naturvetenskaplig fakultet UTH-enheten Besöksadress: Ångströmlaboratoriet Lägerhyddsvägen 1 Hus 4, Plan 0 Postadress: Box 536 751 21 Uppsala Telefon: 018 – 471 30 03 Telefax: 018 – 471 30 00 Hemsida: http://www.teknat.uu.se/student

Abstract

Evaluation of SPH for hydrodynamic modeling, usingDualSPHysics

Jonas Eriksson

Computational methods are always being invented, improved and adjusted to newkinds of problems, this is a constant process happening all the time. The studyevaluates a method called Smoothed Particle Hydrodynamics (SPH) for modelingon fluid flows around ship hulls. This has been done mainly using a open sourcecode called DualSPHysics. The SPH method has been applied to complex problemsas well as simple problems for comparison to well known phenomena. It is aearly study of the method and aimed at discovering how to proceed when studyingthe method in the future. The results seem promising especially when computationsare made using Graphics Processing Units (GPU) for calculations. The codeDualSPHysics used in the study shows promise but might be in need of some morefunctions before being practically applicable for simulation of ship hulls.

ISSN: 1401-5757, UPTEC F 18001Examinator: Tomas NybergÄmnesgranskare: Murtazo NazarovHandledare: Ulf Sand

Page 3: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

Populärvetenskaplig SammanfattningDatorsimuleringar ger oss möjligheten att se in i framtiden. Det ger en möjlighetatt förutspå hur en specifik situation kommer att utspela sig utan att den faktisktbehöver inträffa. Datorsimuleringar kan idag simulera allt från en krockande bil tillutbredning av sjukdomar i ett samhälle. Att ha tillgång till detta hjälpmedel harsnabbar på utvecklingen av nya produkter genom att korta ner tid som behöverspenderas på verkliga tester samt är oftast också billigare än att testa i verk-ligheten. Ibland kanske inte ens ett verkligt test är praktiskt tillämpbart, t.ex. vidförsta försöket att landa på en ny planet.

För att kunna utföra allt mer komplicerade datorsimuleringar så krävs det alltmer beräkningskraft i våra datorer. Stora kluster av processorer jobbar dagligenför fullt på olika företag och universitet omkring världen. Allt mer fokus läggs påatt beräkna parallellt med många processorer som jobbar samtidigt. Därför har numycket fokus flyttats från vanliga processorer till spelvärldens grafikprocessorer.Dessa grafikprocessorer är anpassade för många parallella beräkningar samtidigtför att kunna uppdatera alla pixlar på en skärm så snabbt som möjligt för att geen högupplöst och snabb upplevelse för den som spelar ett spel. På grund av defördelar som finns med grafikprocessorer så har de använts med stor framgång idetta examensarbete.

Arbetet är utfört för ABB och är kopplat till deras projekt för att optimera far-tygs effektivitet under deras färd mellan olika hamnar i världen. Detta involverarmotståndskrafterna som uppstår när ett fartyg rör sig genom vatten. I det syftetså är det här examensarbetet fokuserat på att undersöka en relativt ny metod föratt simulera vätskor. Denna metod kallas SPH Smoothed Particle Hydrodynamics.Som verktyg har en öppen kodbas kallad DualSPHysics använts och utvärderats isyfte att kanske kunna användas för dessa simuleringar i framtiden. Utvärderingenutförs och jämförs med existerande och väl ansedd metod som jämförelse. Arbetetvisar att SPH metoden och kodbasen DualSPHysics verkar lovande men ännu interiktigt mogen för just detta ändamålet.

1

Page 4: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

Contents

1 Introduction 31.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.2 Objective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2 Theory 52.1 Smoothed Particle Hydrodynamics for fluids . . . . . . . . . . . . . 52.2 Froude number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

3 Simulations 123.1 Calculation hardware . . . . . . . . . . . . . . . . . . . . . . . . . . 123.2 DualSPHysics setup . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

3.2.1 Setting up Simulation . . . . . . . . . . . . . . . . . . . . . 123.2.2 Inlet/outlet . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

3.3 Hull in channel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133.3.1 Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133.3.2 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153.3.3 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

3.4 Cylinder in crossflow . . . . . . . . . . . . . . . . . . . . . . . . . . 213.4.1 Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213.4.2 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223.4.3 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

3.5 Calculation times . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

4 Conclusions & Future work 394.1 Summary discussions and improvements . . . . . . . . . . . . . . . 394.2 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

2

Page 5: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

Chapter 1

Introduction

1.1 BackgroundThe idea of smoothed particle hydrodynamics (SPH) was introduced in 1977 andwas originally for use in astrophysics modeling published at approximately thesame time in [1] and [2]. The Lagrangian nature of SPH gave it the capabilityto handle varying density and unbounded flows. It was not until [3] that SPHwas first used for modeling more everyday fluid problems. For this first attemptMonaghan solved initial issues of imposing rigid boundaries and approximatingconstant density and hence he introduced what is today called weakly compressibleSPH (WCSPH). This early success inspired many to further develop and addfeatures to the original simple model and it is still growing rapidly today. SPHhas now been applied to a wide set of problems, for example waves impacting onshore and the well known dam break test case.

A key feature of SPH is that it simulates movement and properties of individualparticles over time and hence eliminates the need for a complex mesh structuregenerally used for fluid simulations. This makes SPH very useful for complex andmoving free surfaces (fluid-air boundary), complex fluid geometries, fluid-structureinteractions and also for interactions between multiple fluids with different proper-ties. Basic SPH is also quite easily implemented because of the straightforwardnessof its basic equations.

Parts of the SPH algorithm is easy to calculate in parallel, hence the gainfrom using parallel CPU cores is big and has been in use for SPH for quite sometime. But with GPUs becoming more cheap they are becoming more and moreinteresting for parallel computing and SPH is no exception. DualSPHysics hasGPU calculations as one of its biggest advantages. This allows calculation timesto be lowered significantly which can be seen in section 3.5

3

Page 6: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

1.2 ObjectiveThe objective of the current work is to evaluate the use of SPH for hydrodynamicmodeling. The current know-how of usage of the SPH method is limited at ABB.There are a number of aspects not yet investigated and a common best practice isnot established. Some of these aspects are:

• Adequate distance between particles (analogy to mesh resolution in CFD):

– resolving near wall phenomena

– resolving flow dynamics such as vortices etc.

– resolving surface shape of solid object

• Capturing the physics:

– Does the SPH code actually capture the behavior of the flow?

• Speed of simulation:

– How fast is a well resolved SPH simulation running on CPU or GPUcompared to a conventional CFD simulation?

• Evaluation of DualSPHysics

– current features and possibilities of the code

– future features

4

Page 7: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

Chapter 2

Theory

2.1 Smoothed Particle Hydrodynamics for fluidsThis is a brief explanation of the method for a more complete description one canstudy [4] or [5]. This theory is also focused on the SPH implementation used inthe open source code DualSPHysics [6].

Smoothed Particle Hydrodynamics also called SPH can be used for differentkinds of applications like astrophysics and solid mechanics, here we only considerSPH for fluid dynamics. SPH discretises a continuous fluid or structure into points,these points are initiated as material particles each of which has a set of physicalquantities at one certain time-step. For fluid dynamics these properties could beposition, velocity, acceleration, density and also pressure. SPH is considered beinga Lagrangian meshless method. The properties of a single particle is calculatedby integrating the discretised Navier-Stokes equations at the particle position overneighboring particles. Far away neighbors will not give a significant effect on theparticle in question the method determines a set of neighboring particles using adistance based function. This function will have a circular form in two dimensionsand a spherical form in three dimensions and also an associated variable denotedh, describing the characteristic smoothing length. New values of the physicalquantities will be calculated each time-step and the particles position will then beupdated according to the physical quantities.

The conservation laws of continuum fluid dynamics needs to be formed intofunctions usable in the particle based simulation. This is done by using integralequations based on interpolation functions, the function is called the kernel func-tion W . A visual example of a kernel function can be seen in fig. 2.1.

5

Page 8: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

Figure 2.1: Visual representation of how a kernel function could look like.

There are many forms of the kernel function with but we will only cover thecubic and the quintic. The kernel function will always represent a function F (r)defined in r′ by the approximation

F (r) = F (r′)W (r− r′, h)dr′. (2.1.1)

This smoothing kernel has to fulfill certain properties, [7] [8]), like compact sup-port, monotonically decreasing value with distance, normalization and positivityinside a defined zone of interaction. We can approximate the function in Equa-tion (2.1.1) in a discrete non-continuous form using our set of particles, forming aninterpolation at a single particle through a summation over all the particles withinits region of compact support. This gives us

F (ra) ≈∑b

F (rb)W (ra − rb, h)∆vb (2.1.2)

where a is the particle in which we interpolate, b the neighboring particles, δvb thevolume of a neighboring particle b. With m and ρ being the mass and density ofa particle we arrive at

F (ra) ≈∑b

F (rb)mb

ρbW (ra − rb, h) (2.1.3)

6

Page 9: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

where rk and vk are the particle position and particle velocity respectively. Thechoice of smoothing kernel can affect the results of the SPH method quite a lot sinceit determines how big the effect the neighboring particles on the current particle tobe updated. Kernels are presented as functions of q, the non-dimensional distancebetween particle a and b. This is given by q = r/h where r is the distance betweenparticle a and b and h is the smoothing length (mentioned earlier) determines thesize of the area in which neighboring particles are used in calculations for particlea. One possible kernel is a cubic spline given by

W (r, h) = αD

1− 3

2q2 + 3

4q3 0 ≤ q ≤ 1

14(2− q)3 1 ≤ q ≤ 2

0 q ≥ 2(2.1.4)

for which αD is 1/πh3 in 3D and 10/7πh2 in 2D [9]. Another possible kernel is theWendland Quintic given by

W (r, h) = αD

(1− q

2

)4(2q + 1) 0 ≤ q ≤ 2 (2.1.5)

where αD is 21/16πh3 in 3D and 7/4πh2 in 2D [10]. In SPH the momentumconservation equation is used to update the value of the acceleration of a particle.The momentum conservation equation in a continuum is given by

dvdt

= −1

ρ∇P + g + Γ (2.1.6)

where g is the gravity vector and Γ is the dissipative terms of the equation. Thereare different ways to describe the dissipative term for use in SPH. One such methodis called Artificial viscosity, introduced by Monaghan [7]. Equation (2.1.6) can berewritten in SPH notation as

dvadt

= −∑b

mb

(Pbρ2b

+Paρ2a

+ Πab

)(2.1.7)

where ρk is the density, Pk is the pressure of particle k and Πab is the viscosityterm. The viscosity term is in this method given by

Πab =

{−αcabµab vabrab < 0

0 vabrab > 0(2.1.8)

where vab = va − vb and rab = ra − rb. We also have µab = hvab · rab/(r2ab + η2,c̄ab = 0.5(ca + cb) which is the mean speed of sound and η2 = 0.001h2. α is thecoefficient to be tuned in order to achieve the proper dissipation of the fluid. The

7

Page 10: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

DualSPHysics documentation suggests a value of α = 0.01 for the study of wavepropagation [6].

Another method to describe the dissipative terms is a combination of Laminarviscosity and Sub-Particle Scale (SPS) turbulence. In this method the momentumconservation equation is given by

dvdt

= −1

ρ∇P + g + υ0∇2v +

1

ρ∇ · ~τ . (2.1.9)

The laminar term is described in SPH terms by

(υ0∇2v)a =∑b

mb

( 4v0rab · ∇aWab

(ρa + ρb)(r2ab + η2)

)vab (2.1.10)

where υ0 is the kinematic viscosity of the fluid. To represent turbulence the SPSconcept was first presented in [11]. For a more detailed on the SPS one can study[12] and [11]. In [12] one can find a description of SPS used in SPH by the meansof Favre averaging. This gives us

(1

ρ∇~τ)a =

∑b

mb

(~τ bijρ2b

+~τaijρ2a

)∇aWab (2.1.11)

where ~τij is the sub particle stress tensor for a certain particle. Hence Equa-tion (2.1.9) can be rewritten in SPH notation as

dvadt

= −∑b

mb

(Pbρ2b

+Paρ2a

)+g+

∑b

mb

( 4v0rab · ∇aWab

(ρa + ρb)(r2ab + η2)

)vab+

∑b

mb

(~τ bijρ2b

+~τaijρ2a

)∇aWab

(2.1.12)which can be used to calculate the acceleration of a particle.

In the case of weakly-compressible SPH the mass of a single particle will alwaysremain constant though the density of a particle will be subject to change. Thischange is calculated using the continuity equation. The differential form of thecontinuity equation is

δρ

δt= −ρ∇ · v (2.1.13)

where ρ is the density and v is the flow velocity. Interpreting and rewriting thisin SPH terms gives the equation

dρadt

=∑b

mbvab · ∇aWab (2.1.14)

which can be used to calculate the density of a particle. Using Equation (2.1.14)to calculate the density might lead to fluctuations, to solve this issue a method

8

Page 11: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

which introduces a diffusive term called delta-SPH can be used. Using delta-SPHthe density will be calculated by

dρadt

=∑b

mbvab · ∇aWab + 2δh∑b

mb ~cab ×(ρaρb− 1) 1

r2ab + η2· ∇awab (2.1.15)

where η2 = 0.001h2, ~cab = 0.5(ca+cb) is the mean speed of sound and δ is the delta-SPH coefficient. The delta-SPH is designed to reduce the noise in the system ofparticles by filtering out large wave numbers while solving the conservation of massfor each particle. More detailed description can be found in [13]. DualSPHysicsdocumentation recommends using a delta-SPH coefficient of δ = 0.1 [6].

As mentioned earlier the fluid in this implementation of the SPH is treated asweakly compressible and the equation of state is used to determine the pressure ofa particle based on the particle density. The compressibility in this case allows forthe speed of sound to be artificially lowered permitting the size of a time step tobe maintained at reasonable levels since the time step is calculated by a Courantcondition based on the current speed of sound for all particles. The speed of soundis restricted to be at least ten times the speed of the maximum particle velocityto keep density variations low and hence the system weakly compressible. Theequation of state used looks as follows

P = B(( ρ

ρ0

)γ− 1)

(2.1.16)

where ρ0 = 1000kgm−3 is the reference density, c0 = c(ρ0) is the speed of soundat that reference density, B = c20ρ0/γ and γ = 7. This relationship is explained in[14] and [15].

Particle movement can be realized quite intuitively using

dradt

= va (2.1.17)

but in DualSPHysics particle movement is realized according to a method calledXSPH which is introduced in [16]. The concept of this method is to move theparticles using a velocity close to the average velocity of all the particles in theneighborhood. The method aims to make the flow of particles more ordered andprevent particles penetrating each other. The particles are moved according to

dradt

= va + ε∑b

mb

ρabvbawab (2.1.18)

where 0 < ε < 1 determines how much effect we want from neighboring particles,vba = (vb − va) and ρab = 0.5(ρa + ρb).

9

Page 12: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

There are several numerical integration schemes but this will only cover a two-stage (predictor and corrector) Symplectic method. Firstly the momentum, densityand position equations are written as

dvadt

= Fa

dρadt

= Da (2.1.19)

dradt

= Va

where Fa, Da and Va is calculated using Equation (2.1.12), Equation (2.1.15) andEquation (2.1.18) respectively. The Symplectic method used is a second-orderexplicit scheme with time accuracy of O(∆t2). Firstly the predictor stage thedensity and acceleration are estimated for half a time step using

ρn+ 1

2a = ρna +

∆t

2Dna (2.1.20)

rn+12

a = rna +∆t

2V na (2.1.21)

for which the superscript n signifies the time step and t = nδt. This is then usedin the corrector step first to calculate the updated velocity

vn+1a = vn+

12

a +∆t

2Fn+ 1

2a (2.1.22)

from which we then can calculate the updated positions

rn+1a = rn+

12

a +∆t

2Vn+ 1

2a . (2.1.23)

After this is done we can calculated the corrected value of the density using

dρn+1a

dt= Dn+1

a (2.1.24)

using the results of the corrected velocity and positions [4].SPH has one important stability issue called anisotropic particle spacing which

occurs especially in violent flows. The problem is that the particles cannot main-tain a uniform distribution and the result of this is an introduction of noise invelocity and pressure and the creation of voids in the particle distribution. Dual-SPHysics make use of a shifting algorithm to mitigate this problem, the algorithmmoves ("shifts") particles towards areas with fewer particles. This algorithm isfurther explained in the DualSPHsyics documentation [6].

10

Page 13: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

2.2 Froude numberFroude number (Fn) is often used to scale models in hydrodynamic modeling ofships. The Froude number (Fn) is given by

Fn =vM√gLM

=vF√gLF

(2.2.1)

where L is some length of the object in question, v is the velocity of the object,subscriptM denotes the scaled model values and subscript F denotes the full scalevalues. Models with the same Froude number as a full scale object will ensure thatthe gravity forces are correctly scaled. Since surface waves are gravity driven anequality in Fn will ensure that wave forces and wave resistance are also scaledcorrectly. Froude scaling factor λ is given by

vF = vM

√LfLM

= vM√λ

λ = LF/LM (2.2.2)

and can be used to scale physical parameters as seen in fig. 2.2.

Figure 2.2: Multiplication factors used for scaling physical parameters to keep theFroude number constant.

11

Page 14: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

Chapter 3

Simulations

3.1 Calculation hardwareThe simulations in the report are performed using the NVIDIA Tesla k80 GPU.

3.2 DualSPHysics setup

3.2.1 Setting up Simulation

DualSPHysics is a open-source code used to solve free surface flow problems usingSPH. A full documentation can be found in [6]. A .xml file is used to set upsimulations in DualSPHysics and in this file all parameters of the experiment aredefined. Parameters assigned here are for example density, viscosity and polytropicindex (γ) of the fluid to simulate. The polytropic index γ is used in the stateequation seen in eq. (2.1.16). These will for all our simulations be set to values forwater hence ρ = 1000kg/m3, v = 1 · 10−6m2/s and γ = 7.

For our simulations the time stepping is chosen to be the Symplectic methodavailable in DualSPHysics, laminar+SPS version of viscosity is used, the delta SPHseen in eq. (2.1.15) is used and set to δ = 0.1. Shifting algorithm is enabled andset to default values recommended values for 2D by DualSPHysics documentation[6].

Also set here is the speed of sound appearing in eq. (2.1.16), this is set accordingto recommendations from the DualSPHysics documentation to be at least tentimes as high as the highest speed of any particle in the system. this means it isset differently for different simulations in our study. In DualSPHysics the length oftime steps are calculated using this speed of sound value which makes simulationstake longer the higher this speed is set. Hence when possible you want to keep itlow to keep the calculation times lower.

12

Page 15: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

The geometry of the simulation is set up in the .xml file including the geome-try of the fluid particles initial positions out. Also set here are starting conditionslike gravity, initial speed of fluid particles and periodic boundary conditions. Animportant parameter set in the .xml is the dp value. This denotes the distancebetween particles and will together with the geometry decide the number of par-ticles in the system and almost directly translates into calculation time, memoryusage and the resolution.

3.2.2 Inlet/outlet

DualSPHysics does not have any function for inlet and outlet implemented yet atthe time of this study and hence a modification of the code has been made. Themodification of the code makes use of the periodic boundaries already availablein DualSPHysics. With the periodic boundaries particles ending up outside theboundary will be moved to the other side of the simulation area as if the twosides were connected. To modify this into a approximate inlet/outlet an area atthe inlet boundary has been set where the velocity of the particles are forced tobe a certain value and direction. This is by far not a perfect implementation ofan inlet/outlet but seem to be sufficient for 2D implementations with no gravityapplied. Gravity is not needed since the area simulated is fully filled up with waterhence no free surfaces to the model. However when applied to 3D simulation withgravity present the results were flying particles weird waves appearing and gener-ally unpredictable behavior. Hence the focus has been set on the 2D simulationsin section 3.4. Some 3D simulation and analysis has been made using another ap-proach in section 3.3, here instead of using inlet and outlet a long channel wherethe object moves through the channel was used.

3.3 Hull in channel

3.3.1 Method

The goal of this work is to assess the use of SPH for calculating flow resistanceand squat of a cargo ship hull. Since there is no real inlet/outlet function imple-mented in DualSPHysics other solutions have been considered. In section 3.2.2 itis explained that our own approximation of inlet/outlet does not work well for 3Dapplications. The chosen method of simulation is instead having the ship movingthrough a channel of fluid. This means that the ship is locked at a certain velocityfor forward motion. Also locked are the roll angle, yaw angle and sideways move-ment. Hence the only freedoms of the ship are moving up/down and the pitchangle. This is achieved using the floating object in DualSPHysics and modify-

13

Page 16: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

ing the code so that the floating object properties mentioned as locked above arealways set to the value needed (zero for all but forward motion).

KCS hull

The ship hull investigated in this simulation is called KCS container ship. All theproperties of this hull can be found at [17]. The hull is used without any rudder orpropeller and is also scaled down with the help of the Froude number explained insection 2.2. For comparison purposes the hull is scaled to certain size so as to bethe same size as an earlier study done internally at ABB for comparison purposes.Hence the scaling factor λ = 31.3486 is used for all values. The model values canbe seen compared to the full scale hull in table 3.1.

Value Full scale ModelHull Length L 230m 7.35

v1 (Fn1 = 0.2599) 12.3466 m/s (24 knots) 2.2052 m/sv2 (Fn2 = 0.1949) 9.2599 m/s (18 knots) 1.6539 m/s

Mass M 51936346 kg 1685.8375 kgWetted surface area S0 9424 m2 9.5895 m2

Time 5.5990 s 1 s

Table 3.1: The full scale physical values as compared to the model physical valuesfor scaling factor λ = 31.3486

Note that only values with units will get affected by the scaling, unitless valueslike the drag coefficient is not affected by scaling. All values in the results will bescaled to the model sizes.

Test cases

Vel Fn dp Depth under keel Channel width Simulated timeCase 1 2.2052 m/s 0.2599 0.05 0.5238 m 50 m 40 sCase 2 2.2052 m/s 0.2599 0.1 0.5238 m 50 m 40 sCase 3 2.2052 m/s 0.2599 0.05 0.5238 m 5 m 40 sCase 4 2.2052 m/s 0.2599 0.05 0.2562 m 5 m 40 sCase 5 2.2052 m/s 0.2599 0.05 0.2562 m 10 m 40 s

Table 3.2: The full scale physical values as compared to the model physical valuesfor scaling factor λ = 31.3486

14

Page 17: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

3.3.2 Results

An example of a visualization can be seen in fig. 3.1, visualized her is Case 5.This figure shows the color of the fluid as z-position in meters. The wakes behindthe ship looks realistic and when reaching the walls they are reflected back againbehind the moving hull.

Figure 3.1: Simulation of hull moving through channel showing fluid z-position inmeters as color of the fluid. The simulation shown has parameters of Case 5.

A comparison of the drag coefficient for Case 1 and Case 2 can be seen infig. 3.2. There are no significant differences to note.

15

Page 18: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

Figure 3.2: Comparison of drag coefficient for Case 1 and Case 2.

A comparison of the depth under the keel for Case 3 and Case 4 can be seenin fig. 3.3. It can be seen that the drag is higher when the channel is less deep.

Figure 3.3: Comparison of drag coefficient for Case 3 and Case 4.

16

Page 19: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

A comparison of the width of the channel for Case 1 and Case 3 can be seenin fig. 3.4. It can be seen that the drag is higher when the channel is less wide.

Figure 3.4: Comparison of drag coefficient for Case 1 and Case 3.

3.3.3 Discussion

When running these simulations the calculation times and memory usage is abig limitation to how many particles can be used. This is a big limitation tothe channel approach we have used since the channel is a big area meaning thenumber of particles will be high even for a low resolution (high dp values). Thishas limited us to using a minimum of dp = 0.05m for these experiments which isbig considering the model length is approx 7m. Possible solutions to this problemare discussed in chapter 4.

Comparing fig. 3.1 with fig. 3.5 there are some similarities in the shape of thewaves forming around the ship. But the one seen in fig. 3.5 has more details tothe shape of the waves. This might be because of the limited resolution we have.

17

Page 20: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

Figure 3.5: Simulated zpos in Fluent internally at ABB.

The values of the drag coefficient seen in fig. 3.2, fig. 3.3 and fig. 3.4 are situatedin a range of approximately 0.02− 0.05. The slight variations seem to be becausechanges in the geometry of the simulated area. Comparing these values to thevalues seen in fig. 3.6 we can see that our simulated values are not at all followingthe values of the measured or the simulated values used for reference. The resultsfrom our simulations are too large and this might also be because of the resolutionlimit for our cases.

18

Page 21: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

Figure 3.6: Measured and simulated drag coefficient values for KCS hull. Simula-tions made in fluent internally at ABB.

Looking closer at the KCS hull when imported into DualSPHysics we can seein fig. 3.7 that the shape is quite rough even when using a particle distance dp =0.05m. For visualization DualSPHysics draws flat plates between particles but inthe simulations the hull is represented by particles with same particle distance asthe whole system. This representation seem especially rough when compared tothe original shape of the model seen in fig. 3.8.

19

Page 22: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

Figure 3.7: The shape of the KCS hull DualSPHysics creates when using dp =0.05m. DualSPHysics creates the hull using points but this visualization showssquares and triangles between the particles.

Figure 3.8: The original shape of the KCS hull.

Because of the limitations encountered here the study refocused on evaluatingthe SPH method in 2D for a cylinder in a crossflow which can be seen in section 3.4

20

Page 23: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

3.4 Cylinder in crossflowBecause of the limitations in particle numbers because of time and memory of ourhardware the study shifted to evaluation of the SPH method in 2D to reduce thenumber of particles and calculation time. The setup using a cylinder in a crossflowwas chosen because the behavior of this is well documented. The flow structuresvaries with Reynolds numbers and the flow ins not trivial to simulate hence a goodtest of correctness.

3.4.1 Method

Figure 3.9: simulation experimental setup, the diameter of the cylinder is D andit is set to be 6mm.

This simulation experiment is set up as a cylinder in a crossflow of water as canbe seen in fig. 3.9 though it is only set up to be 2 dimensions and hence the depth(z-axis) is not considered. The value of D denotes the diameter of the cylinder,the value of D is set to be 6mm. This means the height of the tank is set to16D = 16 · 6mm = 96mm, the length set to 35D = 35 · 6mm = 210mm. Thecenter of the cylinder is set at half the height and at 10D = 10 · 6mm = 60mmfrom the left wall. The left wall of the tank is designated as an inlet and the rightside of the tank is the outlet of the system. The Reynolds number is calculatedusing

Re =ρvD

µ(3.4.1)

21

Page 24: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

and this is used to set the velocity v of the inlet to achieve different values ofReynolds number for the simulation. The Reynolds numbers investigated in thisreport are presented in table 3.3 together with their respective inlet velocity.

Re v c01 0.00017 0.00810 0.0017 0.02102 0.017 0.21020 0.17 4

Table 3.3: Reynolds numbers investigated in this report, the corresponding inletvelocities and chosen values of c0 for the DualSPHysics simulation. The variablec0 is the speed of sound used in calculations seen in eq. (2.1.16)

The simulations are tested for different values of the dp which denotes thedistance between particles. The values tested are 0.001m, 0.0005m, 0.00025m,0.0002m, 0.0001m and 0.00005m though because of limited time all values werenot considered for every Reynolds numbers. In these simulations the inlet/outletis implemented as described in section 3.2.2 and hence there will be a small inletregion where the velocity is forced to certain values. Note that in the visualizationof the simulations in section 3.4.2 this region is clearly visible.

3.4.2 Results

A visualization of the simulation for Re = 1 can be seen in fig. 3.10. Note that theflow seems to be staying laminar around the cylinder for this Reynolds number.One can also notice the inlet region created from the forced inlet velocity mentionedin section 3.2.2 on the left side of the figure. The flow is moving in positive xdirection which is seen here as left to right.

22

Page 25: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

Figure 3.10: Velocity magnitude visualization of simulation using Re = 1.

The drag coefficient over time for Re = 1 can be seen in fig. 3.11. The coefficientseems to stabilize and end up close to the value 16 at the end of the simulationfor both particle distances. Though the simulation using less distance betweenparticles seem to produce less noisy values.

Figure 3.11: Simulated drag coefficient over time for Re = 1.

23

Page 26: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

The lift coefficient over time for Re = 1 can be seen in fig. 3.12. As expectedthe value of the lift seem to be quite symmetric around zero and the lift valuesare considerably smaller than the values of the drag coefficient. The dp = 0.00005simulation seems most symmetric as compared to the dp = 0.00025 one, also haslower values of lift.

Figure 3.12: Simulated lift coefficient over time for Re = 1.

24

Page 27: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

A visualization of the simulation for Re = 10 can be seen in fig. 3.13. Notethat the flow behind the cylinder here seem to have started to separate from thecylinder but still behaves quite laminar. The shape is still very symmetrical.

Figure 3.13: Velocity magnitude visualization of simulation using Re = 10.

The drag coefficient over time for Re = 10 can be seen in fig. 3.14. Thecoefficient seems to lie close to the value of 2.5 but varies quite a lot even towardsthe end for both particle distances. Though the simulation using less distancebetween particles seem to produce a lower value at most time steps.

25

Page 28: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

Figure 3.14: Simulated drag coefficient drag over time for Re = 10.

The lift coefficient over time for Re = 10 can be seen in fig. 3.15. As expectedthe value of the lift seem to be quite symmetric around zero. The lift coefficientvalues are considerably smaller than the values of the drag coefficient. The dp =0.0001 simulation seems most symmetric as compared to the dp = 0.00025 one,also has lower values of lift.

Figure 3.15: Simulated lift coefficient over time for Re = 10.

26

Page 29: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

A visualization of the simulation for Re = 100 can be seen in fig. 3.16. Notethat the flow behind the cylinder here seem to have separated and vortices aremoving downstream in an oscillating pattern.

Figure 3.16: Velocity magnitude visualization of simulation using Re = 100.

The drag coefficient over time for Re = 100 can be seen in fig. 3.17. Thecoefficient seems to lie close to the value of 1.1 for dp = 0.00025 and is very stableat the end. The value is slightly higher for the dp = 0.00005 which is also stillvarying in value at the end of the simulation.

27

Page 30: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

Figure 3.17: Simulated drag coefficient over time for Re = 100.

The lift coefficient over time for Re = 100 can be seen in fig. 3.18. Thelift coefficient is symmetric around zero for both resolutions. A periodicity canbe seen and though it is out of sync it seems to be the same for both. Thedp = 0.00005 simulation seem a lot more smooth similar to what could be seen forthe drag coefficient in fig. 3.17 The same oscillations which can be spotted in thevisualization fig. 3.17 are also visible here for the lift coefficient.

Figure 3.18: Simulated lift coefficient over time for Re = 100.

28

Page 31: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

A visualization of the simulation for Re = 1000 can be seen in fig. 3.19. Sep-aration can be seen and the wake seem to be oscillating similar to the Re = 100case. The velocity (coloring) values appears to be a bit noisy which also is thecase of the drag and lift coefficients. There also seem to be some problem withthe simulation since the boundary layer on the top and bottom surfaces of theexperiment are not as distinct as for the lower Reynolds numbers. This can beseen more closely in fig. 3.20. It can also be seen that the boundary layer of thecylinder still seem to behave like a no slip surface.

Figure 3.19: Velocity magnitude visualization of simulation using Re = 1000.

29

Page 32: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

Figure 3.20: Velocity magnitude visualization of simulation using Re = 1000.Zoomed in version of fig. 3.21.

The drag coefficient over time for Re = 1000 can be seen in fig. 3.21. Thevalues are very noisy but most of the time somewhere the values are between 1-1.5for the dp = 0.0001 simulation.

30

Page 33: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

Figure 3.21: Simulated drag coefficient over time for Re = 1000.

The lift coefficient over time for Re = 1000 can be seen in fig. 3.22. The liftcoefficient is quite symmetric but the values are very noisy. The dp = 0.0001 caseis less noisy and also seem to stabilize a bit towards the end of the figure.

A periodicity can be seen and though it is out of sync it seems to be the samefor both. The dp = 0.00005 simulation seem a lot more smooth similar to whatcould be seen for the drag coefficient in fig. 3.17 The same oscillations which canbe spotted in the visualization fig. 3.17 are also visible here for the lift coefficient.

Figure 3.22: Simulated lift coefficient over time for Re = 1000.

31

Page 34: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

The mean drag coefficient values for different resolutions can be seen for differ-ent Reynolds numbers in fig. 3.23. The simulation values follow the general shapeof the reference line but do not match perfectly. Values for the same Reynolds num-ber closely together even though they differ in resolution. It is important to notethat these are mean values and that the variance decrease for higher resolutionswhich can be seen for the individual Reynolds numbers above in this section 3.4.2.The reference values plotted in fig. 3.23 are taken at certain points from the fullplot seen in fig. 3.24.

Reynolds number

100

101

102

103

Co

eff

icie

nt

of

dra

g (

CD

)

1

2

3

5

10

20

40dp=0.001

dp=0.0005

dp=0.00025

dp=0.0002

dp=0.0001

dp=0.00005

Reference

Figure 3.23: Simulation mean drag coefficient over Reynolds number for differentresolution values. Mean calculated from last part of simulations when drag coef-ficient values mostly converged. The reference is plotted using values extractedfrom fig. 3.24.

32

Page 35: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

Figure 3.24: Drag coefficient for cylinder in crossflow over Reynolds number, pic-ture from [18].

3.4.3 Discussion

In fig. 3.25 the separation behavior of a cylinder in crossflow can be seen fordifferent intervals of Reynolds number which will be used as a comparison withresults.

Figure 3.25: Re-intervals for certain behavior considering a cylinder in crossflow[19].

For Re = 1 it can be seen that the visualization in fig. 3.10 seem to representa laminar flow as expected when considering fig. 3.25. Which makes it seem this

33

Page 36: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

simulation is a pretty good representation. Also notable is that the drag coefficientfor the different resolutions seem to end up at similar values as seen in fig. 3.23.The value is quite far off from the reference line but this might be explained by thesteepness of the curve close to Re = 1 which might cause small variations in speed(and hence Reynolds number) to cause larger differences in the drag coefficient.In fig. 3.12 it an be seen that the resolution has a large effect on the varianceof the lift coefficient. In a laminar and symmetric flow this value should be asclose to zero as possible all the time, hence the resolution plays a large part in thecorrectness of this value.

In the visualization of Re = 10 seen in fig. 3.13 there are a pair of holes withno particles present in the wake of the cylinder. These correspond quite wellwith where we expect to see some vortices for this Reynolds number according tofig. 3.25. The vortices have not separated for this Reynolds number but the wakeis elongated compared to Re = 1 and might be getting close to separating. Thedrag coefficient are similar for all resolution values as seen in fig. 3.23 and theyare very close to the reference line, some are even on top of it. The lift coefficientin this case is expected to be close to zero because of the symmetry of the flowfor this Reynolds number as well. As seen in fig. 3.15 the values are small butan offset is present in the low resolution one. The better resolution one also hassmaller values which is considered more correct in this symmetric case.

For Re = 100 separation can be seen in the visualization fig. 3.16 and vorticesseparated from behind the cylinder are being created in an oscillating patternbefore moving downstream. This corresponds with what is described in fig. 3.25for this Reynolds number. The drag coefficient seen in fig. 3.17 seems a bit shaky atfirst but stabilizes very well after approx 10 seconds though the higher resolutionvalue stabilizes the most. The resolution seem to matter quite a lot to get ridof noisy results even when the mean value results end up quite similar. The liftcoefficient is expected to oscillate in this case because of the oscillating vortices forthis Reynolds number. It can be seen in fig. 3.18 that the resulting lift coefficientis indeed oscillating as expected. Especially smooth oscillation can be seen in thehigh resolution simulation for Re = 100. The solutions oscillations are not in phasebut this might be explained by them reaching their initial oscillation at differentpoints in time.

The visualization for Re = 1000 can be seen in fig. 3.19. Separation andoscillations can be seen here as well but the visualization also seem slightly differentto Re = 100 where vortices are distinctly visible moving down the stream behindthe cylinder. In this case there is more of a tail behind the cylinder. According tofig. 3.25 this Reynolds number should give a fully turbulent vortex street. It is abit hard to tell from the visualization but there seems to be a vortex street but thevortices moving downstream are not as clear as they were in the Re = 100 case.

34

Page 37: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

This could be because the stream behind the cylinder is turbulent resulting in thevortices not being as clear. As can be seen more clearly in fig. 3.20 the boundarylayers of the top and bottom walls of the channel seem to not behave correctlyaccording to the no slip conditions seen for the lower Reynolds numbers. Thismight indicate some problems using the model for higher velocities. This mighteither depend on the model used in DualSPHysics or it might be something to dowith our experimental setup and choices of calculation variables. For this Reynoldsnumber it can be seen in fig. 3.21 that the resolution impacts the drag coefficientquite a bit. It does not necessarily affect the mean value but the variance differs alot between the different dp values. The mean drag coefficient is centered slightlyabove one which is pretty close to the reference value as seen in fig. 3.23. The liftcoefficient seen in fig. 3.22 is very noisy just like the corresponding Drag coefficient.This might be because of the turbulent characteristic of the flow. This problemmight be because the turbulence model of DualSPHysics is unable to handle thiscase or it might be because the resolution is not high enough for this case. Itcould also be caused by the speed of sound c0 seen for Re = 1000 in table 3.3 notbeing high enough. Since higher values of c0 causes calculation steps to becomeshorter this might affect the results, though the value chosen is higher than therecommended ten times larger than the highest speed in the system given in theDualSPHysics documentation [6].

3.5 Calculation timesA comparison between calculation time for CPU and GPU simulations dependingon number of particles can be seen in fig. 3.26. The simulations used to plot thisis done using the same setup but using different particle distances dp resultingin different calculation times. Just from this small number of data points it canbe seen that the difference between CPU and GPU grows for higher amounts ofparticles.

35

Page 38: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

Figure 3.26: Comparison between CPU (28 cores) calculation times and GPU(Nvidia Tesla k80 ) calculation times depending on number of particles.

A more thorough investigation of calculation times depending on number ofparticles can be seen in fig. 3.27. This is taken from a paper investigating theGPU implementation of DualSPHysics further [20]. From this picture it can beseen that the GPU calculations are far superior to the CPU calculations in termsof calculation times. It is further shown in fig. 3.28 that the GPUs give a hugeadvantage in speed compared even to CPU dual cores.

36

Page 39: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

Figure 3.27: Comparison between CPU (Intel Xeon X5500 ) calculation times andsome different GPUs calculation times depending on number of particles (N).Figure from [20].

Figure 3.28: Shows the speedup of different GPUs compared to CPU single coreand all 8 cores of an Intel Xeon X5500. The figure is from [20].

A drawback of using GPU is that the number of particles simulated are limitedby the dedicated memory of the GPU which is generally a lot less compared to

37

Page 40: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

the available memory of a CPU. The limits of some different GPUs can be seenin fig. 3.29. These different GPUs might have similar calculation times but somemight be able to handle more particles than others.

Figure 3.29: Shows limitations of number of particles for some different GPUs,figure from [20].

38

Page 41: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

Chapter 4

Conclusions & Future work

4.1 Summary discussions and improvementsSection 3.3 details the simulation of the KCS hull, presents some results and dis-cusses the problem of achieving high enough resolution. This causes us not toreally be able to determine if our simulations are performing correct or not andalso limits the amount of testing due to high calculation times. The results seenin section 3.3 does not compare well with results seen in reference material whichmight be because of the resolution and/or something else. Possible solutions tothis would be if inlets/outlets were available This would allow for a smaller sim-ulation area instead of using a long channel which would reduce the amount ofparticles needed for the same particle size. Another solution would be to make useof variable resolution. This would enable different areas of the simulation to usedifferent resolution and hence reduce the resolution in areas where nothing com-plicated is occurring and increase the resolution in areas which are complicated.This would be useful to increase the resolution of the fluid close to the hull and thewake and reduce in far away from the hull. Since the resolution in DualSPHysicsalso determines the resolution of the hull it would be useful to be able to set theresolution of the hull higher separately from the fluid since as can be seen in fig. 3.8the hull is not especially smooth at the resolutions used in this study.

In section 3.4 a cylinder in crossflow is simulated and the results are comparedto generally accepted behavior of this experimental setup. The visual comparisonsall seem to correspond to the reference material and behaves as expected. Thedrag coefficient corresponds well with reference values as well as can be seen infig. 3.23. It can be seen that the simulated values follow the reference line but isnot perfectly on top of it. If considering stability and clean (not noisy) results thenthe results for Re = 100 is the case that looks the most interesting and stable.In comparison the Re = 1000 case looks very noisy. It is also having problems

39

Page 42: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

simulating the boundary layer of the side walls. This might have something to dowith the resolution of the simulations but similar resolutions have been used inboth cases. Another possibility is that since the flow behind the cylinder should beturbulent at Re = 1000 the laminar+SPS turbulence model used in DualSPHysicsmight not be able to handle the turbulent flow occurring in this setup. Alsopossible is that the speed of sound c0 used in eq. (2.1.16) set in the Re = 1000case is set too low to handle the behavior of this case. A general problem forthese simulations of the cylinder in crossflow is that the approximate inlet/outletfunction used is not a completely correct inlet/outlet. Hence it would be useful toexamine these simulations again but using a real implementation of inlet/outlet,DualSPHysics has this as a future planned function to be implemented.

Section 3.5 presents differences in calculation times between CPU and GPU anddiscusses these briefly. The improvement in speed is huge for GPUs as compared toCPUs for the DualSPHysics code which can be seen in fig. 3.28 for some differentGPUs. A drawback of using GPU over CPU is that they are limited in numberof simulated particles by its internal memory. This is visible from fig. 3.28 andfig. 3.29 by looking at the GPUs GTX 680 and the Tesla K20. They both havequite similar calculation speed but the max number of particles in a simulationis more than double in the Tesla K20. A possible solution to this limitation isthe use of multiple GPU calculations where different simulate separate parts ofthe fluid and hence only need to keep check of their own parts as long as theycommunicate information between themselves. This is a feature DualSPHysics isworking on at the moment and the next version of DualSPHysics will include abeta of their multiple GPU implementation. Multiple GPU will also increase thecalculation times since only part of the simulation is handled by each GPU.

4.2 ConclusionGenerally there are obstacles to the use of SPH on hydrodynamic modeling inDualSPHysics. Achieving adequate small distance between particles with low cal-culation time is a bit hindered by the absence of functions not yet implemented inDualSPHysics. Some of these functions are inlets/outlets, variable resolution overthe simulation area and the multiple GPU implementation. All of these wouldhelp towards achieving a reasonable resolution in simulations and push down thecalculation times. At the moment some larger complex simulations like the KCShull are hard to resolve with the limitations to resolution imposed by both calcu-lation time and memory limits. Even with these limitations the method and theDualSPHysics code seems very promising for hydrodynamic modeling and is ableto resolve behavior in the cylinder in crossflow simulations made in this study.SPH seem especially promising with the progress of GPUs being pushed ahead

40

Page 43: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

quickly by both computer games and computational science. These GPUs focusedon parallel computing pixels on a screen are perfect for the SPH implementationof parallel computations for many particles.

41

Page 44: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

Bibliography

[1] L. B. Lucy. A numerical approach to the testing of the fission hypothesis.Astronomical Journal, 82:1013–1024, December 1977. URL http://adsabs.harvard.edu/full/1977AJ.....82.1013L.

[2] R. A. Gingold and J. J. Monaghan. Smoothed particle hydrodynamics-theoryand application to non-spherical stars. Monthly Notices of the Royal As-tronomical Society, 181:375–389, 1977. URL http://adsabs.harvard.edu/full/1977MNRAS.181..375G.

[3] J. J. Monaghan. Simulating free surface flows with SPH. Journal of Com-putational Physics, 110(2):399–406, February 1994. ISSN 00219991. doi: 10.1006/jcph.1994.1034. URL http://dx.doi.org/10.1006/jcph.1994.1034.

[4] J. J. Monaghan. Smoothed particle hydrodynamics. Reports on Progressin Physics, 68(8):1703–1759, July 2005. ISSN 0034-4885. doi: 10.1088/0034-4885/68/8/r01. URL http://dx.doi.org/10.1088/0034-4885/68/8/r01.

[5] Damien Violeau. Fluid Mechanics and the SPH Method: Theory and Applica-tions. Oxford University Press, 1 edition, July 2012. ISBN 0199655529. URLhttp://www.worldcat.org/isbn/0199655529.

[6] Users Guide for DualSPHysics code, DualSPHysics v4.0, April 2016.

[7] J. J. Monaghan. Smoothed particle hydrodynamics. Annual Review of Astron-omy and Astrophysics, 30(1):543–574, September 1992. ISSN 0066-4146. doi:10.1146/annurev.aa.30.090192.002551. URL http://dx.doi.org/10.1146/annurev.aa.30.090192.002551.

[8] G. R. Liu. Mesh Free Methods: Moving Beyond the Finite Element Method.CRC Press, 1 edition, July 2002. ISBN 0849312388. URL http://www.worldcat.org/isbn/0849312388.

42

Page 45: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

[9] J. J. Monaghan and J. C. Lattanzio. A refined particle method for astrophys-ical problems.aap, 149:135–143, August 1985.

[10] Holger Wendland. Piecewise polynomial, positive definite and compactlysupported radial functions of minimal degree. Advances in ComputationalMathematics, 4(1):389–396, December 1995. ISSN 1019-7168. doi: 10.1007/bf02123482. URL http://dx.doi.org/10.1007/bf02123482.

[11] H. Gotoh, T. Shibahara, and T. Sakai. Sub-particle-scale turbulence model forthe MPS method - Lagrangian flow model for hydraulic engineering. AdvancedMethods for Computational Fluid Dynamics, 9-4:339–347, 2001.

[12] R. A. Dalrymple and B. D. Rogers. Numerical modeling of water waves withthe SPH method. Coastal Engineering, 53(2-3):141–147, February 2006. ISSN03783839. doi: 10.1016/j.coastaleng.2005.10.004. URL http://dx.doi.org/10.1016/j.coastaleng.2005.10.004.

[13] Diego Molteni and Andrea Colagrossi. A simple procedure to improve thepressure evaluation in hydrodynamic context using the {SPH}. ComputerPhysics Communications, 180(6):861 – 872, 2009. ISSN 0010-4655. doi:http://dx.doi.org/10.1016/j.cpc.2008.12.004. URL //www.sciencedirect.com/science/article/pii/S0010465508004219.

[14] J. J. Monaghan, R. A. F. Cas, A. Kos, and M. Hallworth. gravity currentsdescending a ramp in a stratified tank. Journal of Fluid Mechanics, 379:39–69, 1998.

[15] G. K. Batchelor. An Introduction to Fluid Dynamics. Cambridge UniversityPress, February 2000.

[16] J. J. Monaghan. On the problem of penetration in particle methods.Journal of Computational Physics, 82(1):1–15, May 1989. ISSN 00219991.doi: 10.1016/0021-9991(89)90032-6. URL http://dx.doi.org/10.1016/0021-9991(89)90032-6.

[17] MOERI Container Ship (KCS). http://www.simman2008.dk/KCS/container.html. Accessed: 2016-12-20.

[18] Drag coefficient for cylinder in crossflow. http://www.esru.strath.ac.uk/EandE/Web_sites/13-14/Jacket_Substructures/jackets/waveawind.html. Accessed: 2016-12-18.

43

Page 46: Evaluation of SPH for hydrodynamic modeling, using ...1176095/FULLTEXT01.pdf · Evaluation of SPH for hydrodynamic modeling, using DualSPHysics Jonas Eriksson Computational methods

[19] Cylinder behaviour in crossflow for different Reynolds values.http://iopscience.iop.org/article/10.1088/0143-0807/36/1/015001#ejp502342s2. Accessed: 2016-12-18.

[20] A. J. C. Crespo, J. M. Domínguez, B. D. Rogers, M. Gómez-Gesteira, S. Long-shaw, R. Canelas, R. Vacondio, A. Barreiro, and O. García-Feal. Dual-sphysics: Open-source parallel cfd solver based on smoothed particle hydro-dynamics (sph). Computer Physics Communications, 187:204–216, Febru-ary 2015. ISSN 00104655. doi: 10.1016/j.cpc.2014.10.004. URL http://dx.doi.org/10.1016/j.cpc.2014.10.004.

44