Manchester Metropolitan University. Towards the Numerical Simulation of Ship Generated Waves Using a. Cartesian Cut Cell Based Free Surface Solver.
Centre of Mathematical Modelling and Flow Analysis Department of Computing and Mathematics Manchester Metropolitan University
Towards the Numerical Simulation of Ship Generated Waves Using a Cartesian Cut Cell Based Free Surface Solver
´ ´ Antonio Armesto Alvarez Jose
December 2008
A Thesis Submitted in Partial Fullfilment of the Requirements for the Degree of Doctor of Philosophy.
Towards the Numerical Simulation of Ship Generated Waves Using a Cartesian Cut Cell Based Free Surface Solver
´ ´ Antonio Armesto Alvarez Jose
Centre for Mathematical Modelling and Flow Analysis Manchester Metropolitan University John Dalton Building Chester Street Manchester M1 5GD, UK.
December 2008
Contents List of Acronyms
iii
List of Figures
v
List of Tables
xi
Abstract
xiii
Declaration
xv
Acknowledgements
xvii
Agradecimientos
xix
Chapter 1. Introduction 1. Motivation 2. Grid Methods 3. Alternative Equations that were Dismissed 4. Navier-Stokes Equations 5. Alternative Solution Methods 6. Outline of the Thesis
1 1 3 5 9 14 23
Chapter 2. Cartesian Cut Cell Method 1. Introduction 2. Cutting the Grid Around the Solid 3. Cells Merging 4. Intersecting Solid and Free Surface 5. Cartesian Cut Cell Routines
25 25 27 30 33 36
Chapter 3. Numerical Method 1. Introduction 2. Artificial Compressibility Method 3. Godunov’s Method 4. Flux Calculation 5. The Riemann Problem 6. Merged Cells Contributions 7. Boundary Conditions 8. Linearization 9. Linear System 10. Solution Scheme
43 43 44 46 48 53 58 59 62 65 67
Chapter 4. Free Surface 1. Introduction 2. Interface Capturing Methods 3. Interface Tracking Methods
69 69 70 74 i
ii
CONTENTS
4. 5. 6.
Pressure on Free Surface Flows Boundary Conditions at the Free Surface Solid and Free Surface Cutting Each Other
Chapter 5. Numerical Experiments: No Free Surface 1. Lid-driven Couette Flow 2. Lid-Driven Cavity Flow 3. Current Flow in a Pipe 4. Current Flow in a Pipe with an Obstacle.
78 78 80 83 83 84 92 97
Chapter 6. Numerical Experiments: Free Surface 1. Small Amplitude Sloshing Tank 2. Mass-Wave Maker 3. Semi Dam Break 4. Current Flow Passing Over a Bump 5. Current Flow Passing a Cylindrical Body in the Flow 6. Current Flow Passing a Cylinder at the Free Surface
101 101 115 116 121 130 139
Chapter 7. Conclusions and Future Work 1. Conclusions 2. Future Work
143 143 144
List of References
147
Appendix A.
157
Publications
List of Acronyms ACM ALE ALU CCCM CCCR CFD CFPOB CFPCFS CFPCBF CMMFA EE FDM FEM FVM GNE HLL LBM LBG-BGK LGA LHS LSM MAC MMU NSE ODE PDE RANS RHS R-K RP RS SEM SPH SWE VoF
Artificial Compressibility Method Arbitrary Lagrangian-Eulerian Methods Approximate Lower Upper (LU) Factorization Cartesian Cut Cell Method Cartesian Cut Cell Routines Computational Fluid Dynamics Current Flow Passing Over a Bump Current Flow Passing a Cylinder at the Free Surface Current Flow Passing a Cylindrical Body in the Flow Centre of Mathematical Modelling and Flow Analysis Euler Equation Finite Difference Methods Finite Element Methods Finite Volume Methods Green-Naghdi equations Harten, Lax and Van Leer (Riemann solver) Lattice Boltzmann Method Lattice Boltzmann Method Bhatnagar-Gross-Krook Lattice Gas Automata Left Hand Side Level Set Method Marker and Cell Manchester Metropolitan University Navier-Stokes Equations Ordinary Differential Equation Partial Differential Equation Reynolds-Averaged Navier-Stokes Equations Right Hand Side Runge-Kutta Methods Riemann Problem Riemann Solver Spectral Element Methods Smoothed Particle Hydrodynamics Shallow Water Equations Volume of Fluids
iii
List of Figures 1.1 Laboratory experiments at the Ship Model Tank from the Ship Technology Department of MARINTEK, SINTEF [8].
2
1.2 Waves generated on the water surface by an IACC hull by Prof. Quarteroni, Alinghi Team and Fluent Inc. [6].
2
1.3 Scheme of the computational domain defined by the free surface using a CCCM.
3
1.4 Common cell types used in structured grids.
4
1.5 Example of a structured grid in 2-D.
4
1.6 Common cell types used in unstructured grids.
5
1.7 Example of an unstructured grid in 2-D.
5
1.8 Example of a mixed grid in 2-D.
5
1.9 Notation used in the SWE.
6
1.10Situations that can and can not be dealt with using SWE.
7
1.11Scheme of the domains proposed by Jiang [65, 66].
8
1.12Lattice Boltzmann Method.
20
1.13Scheme of the particles in the domain.
21
2.1 Flags: (a) Flow cell, (b) Cut cell and (c) Solid cell.
25
2.2 (a) Simple cut given by the CCCM. (b) Corner cut which can not be described by the CCCM.
26
2.3 Intermediate steps of a flow cell becoming solid cell due the movement of the solid body.
26
2.4 The computational domain is the FLOW part (water) while the Air part is of no interest in this study and is all the part above the free surface. Approximation of the cuts avoiding corners in cut cells is shown as well as merged cells. 27 2.5 Notation used with respect to cell (𝑖, 𝑗).
28
2.6 Computing the intersection points with the grid. 𝑎 = (𝑥𝑎 , 𝑦𝑗 ), 𝑏 = (𝑥𝑖+1 , 𝑦𝑏 ) and 𝑐 = (𝑥𝑐 , 𝑦𝑗+1 )
29
2.7 Cell types for 𝑆𝑙𝑜𝑝𝑒(𝑖, 𝑗) = 1, where coloured part is solid.
29
2.8 Cell types for 𝑆𝑙𝑜𝑝𝑒(𝑖, 𝑗) = 2, where coloured part is solid.
29
2.9 Cell types for 𝑆𝑙𝑜𝑝𝑒(𝑖, 𝑗) = 3, where coloured part is solid.
30
2.10Cell types for 𝑆𝑙𝑜𝑝𝑒(𝑖, 𝑗) = 4, where coloured part is solid.
30
2.11Area of cut cell 𝐴 is smaller than 𝐴𝑚𝑖𝑛 and is merged with surrounding cell 𝐵 forming super-cell 𝐶.
31
2.12Merge small flow cells.
31
2.13Super-cell containing cells 𝐴, 𝐵, 𝐶, 𝐷, 𝐸 and 𝐹 when merging at the free surface.
32
2.14Cut between the solid (red) and the free surface (blue) in one cell.
33
v
vi
LIST OF FIGURES
2.15Cut between the solid (red) and the free surface (blue) in one cell. 𝑆𝑓 𝑠 and 𝐸𝑓 𝑠 are the start and end points from the free surface, 𝑆𝑠 and 𝐸𝑠 are the start and end points from the solid obstacle. Point 𝐶 is the intersection point between both cuts. 34 2.16Cell of type 1 for 𝑆𝑙𝑜𝑝𝑒𝑠 (𝑖, 𝑗) = 1. The red colored part is the solid and the blue is the free surface (air). 36 2.17Cell of type 2 for 𝑆𝑙𝑜𝑝𝑒𝑠 (𝑖, 𝑗) = 1. The red colored part is the solid and the blue is the free surface (air). 36 2.18Cell of type 3 for 𝑆𝑙𝑜𝑝𝑒𝑠 (𝑖, 𝑗) = 1. The red colored part is the solid and the blue is the free surface (air). 37 2.19Cell of type 4 for 𝑆𝑙𝑜𝑝𝑒𝑠 (𝑖, 𝑗) = 1. The red colored part is the solid and the blue is the free surface (air). 37 2.20Position of the solid bodies given in the example.
38
2.21Grid resultant of applying the CCCR to the geometry given. Merged cells A, B, C, D and E. 40 3.1 Reconstructed values (𝑖 + 1, 𝑗) and U𝐿 (𝑖+1/2,𝑗) at each side of cell interface (𝑖 + 1/2, 𝑗).
50
3.2 Locate point R.
51
3.3 Gradients for the solid cut cell.
52
3.4 (a) Rarefaction wave, (b) Shock wave and (c) Contact discontinuity.
55
3.5 Division of the space produced by the three waves (𝜆1 , 𝜆2 and 𝜆3 ).
55
3.6 Boundary cell (𝑖, 𝑗) and its ghost cell (𝑖𝑔 , 𝑗𝑔 ).
60
3.7 Mesh 𝜒 with ghost cells at boundaries 𝑥 = 𝑎, {(0, 𝑗) : 𝑗 = 1, 2, . . . , 𝑀 } and 𝑥 = 𝑏, {(𝑀 + 1, 𝑗) : 𝑗 = 1, 2, . . . , 𝑀 }.
60
4.1 Distribution of markers in the MAC method.
70
4.2 Values of function 𝜙 in the VoF method.
73
4.3 Reconstruction of the free surface using the VoF method.
73 𝑛
4.4 Movement of the control points from the free surface at time 𝑡 = 𝑡 , to the free surface at time 𝑡 = 𝑡𝑛+1 (dotted line). 74 4.5 Situations where function ℎ would be multi-valued. 4.6 Unitary ⃗𝑛 normal and ⃗𝑡 tangential vectors and curvature 𝐾 of the free surface. ⃗ =𝑉 ⃗𝑓 − 𝑉 ⃗𝑔 ) at the free surface and cell interfaces. 4.7 Velocities (𝑉
75
4.8 Cut between the solid (red) and the free surface (blue) in one cell.
81
5.1 Scheme of the lid driven Couette problem
83
5.2 Scheme of the lid driven cavity problem
85
79 80
5.3 Results of the lid driven cavity flow using Roe’s RS, 𝑅𝑒 = 100, 𝑁 = 𝑀 = 50, 𝛽 = 0.01 and Δ𝜏 = 106 . 85 5.4 Logarithm of ∣∣U𝑛+1 − U𝑛 ∣∣2 for both RS. The following values have been considered, for a grid size 50 × 50, 𝛽 = 0.01, 𝑅𝑒 = 100, Δ𝜏 = 100000 and Δ𝑡 = 1 with 𝑇𝑒𝑛𝑑 = 100. 86 5.5 Horizontal velocities along 𝑥 = 0.5 with HLL (top) and Roe’s (bottom) RS.
88
5.6 Comparison of the horizontal velocities along 𝑥 = 0.5 using both RS and 𝑅𝑒 = 50, 100, 400, 1000, 2000, 5000.
89
5.7 Vertical velocities along 𝑦 = 0.5 with HLL (top) and Roe’s (bottom) RS.
90
LIST OF FIGURES
5.8 Comparison of the vertical velocities along 𝑦 = 0.5 using both RS and 𝑅𝑒 = 50, 100, 400, 1000, 2000, 5000.
vii
91
5.9 Layer flow in a domain Ω = [0, 10] × [0, 1].
92
5.10Velocity profile at final time (𝑇𝑒𝑛𝑑 = 100) using the Roe’s RS with V = 1.5, Δ𝑡 = 0.5, 𝑅𝑒 = 50 and 𝛽 = 2.5.
92
5.11Horizontal velocities at the end of the pipe (𝑥 = 10) using 𝑅𝑒 = 1000.
94
5.12Logarithm of ∣∣U𝑛+1 − U𝑛 ∣∣2 during the computation using 𝑅𝑒 = 1000.
94
5.13Horizontal velocities at the end of the pipe (𝑥 = 10) using 𝑅𝑒 = 1000 and 𝛽 = 10. 5.14Logarithm of ∣∣U
𝑛+1
𝑛
− U ∣∣2 during the computation using 𝑅𝑒 = 1000 and 𝛽 = 10.
95 95
5.15Horizontal velocities at the end of the pipe (𝑥 = 10) using 𝑅𝑒 = 500.
96
5.16Logarithm of ∣∣U𝑛+1 − U𝑛 ∣∣2 during the computation using 𝑅𝑒 = 1000.
96
5.17Current flow in a pipe Ω = [0, 40] × [0, 20], with cylindrical obstacle of centre 𝐶 = (10, 10) ⃗𝑖𝑛 = (1, 0)𝑇 . and radius 𝑟 = 1, and inflow velocity 𝑉 97 5.18Drag 𝑐𝐷 and lift 𝑐𝐿 coefficients computed using the Roe’s RS, 𝑁 = 100, 𝑀 = 50, Δ𝑡 = 1/100 and 𝛽 = 1.5.
98
5.19Velocity profile using both RS at final time 𝑡 = 300, 𝑁 = 100, 𝑀 = 50, Δ𝑡 = 1/100 and 𝛽 = 1.5.
99
5.20Streamlines produced using HLL and Roe’s RS at 𝑡 = 272 and 𝑡 = 276. 𝑁 = 100, 𝑀 = 50, Δ𝑡 = 1/100 and 𝛽 = 1.5. 100 6.1 Initial position of the free surface.
102
6.2 Free surface elevation of the first point for different 𝛽 values (500 − 50000), using 𝑁 = 𝑀 = 120 and Δ𝑡 = 1/500.
103
6.3 Free surface elevation of the first point for different 𝛽 values (0.01 − 500000), using 𝑁 = 𝑀 = 60 and Δ𝑡 = 1/20.
104
6.4 Free surface elevation of the first point for different time steps (Δ = 1/20, 1/100, 1/500), using different grid sizes (𝑁, 𝑀 ) and 𝛽 = 1.5. 105 6.5 Free surface elevation of the first point for different time steps (Δ = 1/20, 1/100, 1/500), using different grid sizes (𝑁, 𝑀 ) and 𝛽 = 500. 106 6.6 Free surface elevation of the first point for different time steps (Δ = 1/20, 1/100, 1/500), using different grid sizes (𝑁, 𝑀 ) and 𝛽 = 50000. 107 6.7 Free surface elevation of the first point for different time steps (Δ = 1/20, 1/100, 1/500), using different grid sizes (𝑁, 𝑀 ) and 𝛽 = 500000. 108 6.8 Free surface elevation of the first point for different spatial configurations, 𝑁 = 𝑀 = (30, 60, 120), using different time intervals Δ𝑡 and 𝛽 = 1.5.
109
6.9 Initial position of the free surface.
110
6.10Position of the free surface for different values of the Reynolds numbers (𝑅𝑒 = 2, 20, 200, 2000, 20000) using 𝑀 × 𝑁 = 120 × 120, Δ𝑡 = 1/60 and 𝛽 = 1.5.
111
6.11Position of the free surface using diferent 𝑅𝑒 = 100, 𝑁 = 𝑀 = 120, 𝛽 = 1.5 and different values of the time step. 112 6.12Position of the free surface using diferent 𝑅𝑒 = 100, 𝑁 = 𝑀 = 120, time step Δ𝑡 = 1/120 and different values of 𝛽. 112 6.13Free surface elevation of the middle point for 𝛽 = 0.5, using different grid sizes 𝑁 = 𝑀 = (30, 60, 120) and different time steps Δ𝑡 = (1/10, 1/60, 1/100, 1/120).
113
viii
LIST OF FIGURES
6.14Free surface elevation of the middle point for 𝛽 = 1.5, using different grid sizes 𝑁 = 𝑀 = (30, 60, 120) and different time steps Δ𝑡 = (1/60, 1/100, 1/120).
114
6.15Scheme of the mass-wave maker problem. The red square represents the area of the mass source. 115 6.16Free surface elevation at time 𝑇 = 4 s. and 𝑇 = 8 s. using 𝑁 = 201 and 𝑀 = 50, Δ𝑡 = 1/500 and different values of 𝛽 = 500, 2000, 200000.
116
6.17Scheme of the “full” dam break problem.
117
6.18Scheme of the semi dam break problem.
117
6.19Free surface elevation at different times for 𝑁 = 200, 𝑀 = 40, 𝛽 = 500 and different values of the time step Δ𝑡 = 1/200 (891.35 CPU sec), 1/500 (1881.17 CPU sec), 1/1000 (3085.13 CPU sec). 118 6.20Free surface elevation at different times for 𝑁 = 200, 𝑀 = 40, Δ𝑡 = 1/500 and different values of 𝛽 = 500 (1881.17 CPU sec), 2000 (1609.19 CPU sec), 5000 (2027.31 CPU sec). 119 6.21Free surface elevation at different times for 𝑁 = 200, 𝑀 = 40, Δ𝑡 = 1/1000 and different values of 𝛽 = 500 (3085.13 CPU sec), 5000 (3167.69 CPU sec), 50000 (5602.10 CPU sec). 120 6.22Scheme of the CFPOB problem.
121
6.23Velocity profile of the CFPOB problem after 20 seconds using 𝛽 = 5, Δ𝑡 = 1/50.
121
6.24Free surface elevation at different times for 𝑁 = 300, 𝑀 = 30, Δ𝑡 = 1/20 and different values of 𝛽 = 1, 5, 50, 500.
123
6.25Free surface elevation at different times for 𝑁 = 300, 𝑀 = 30, Δ𝑡 = 1/100 and different values of 𝛽 = 1, 5, 50. 124 6.26Free surface elevation at different times for 𝑁 = 300, 𝑀 = 30, different time steps Δ𝑡 = 1/20, 1/50, 1/100, 1/400 and 𝛽 = 5.
125
6.27Velocity profile of the CFPOB problem after 20 seconds using Reynolds number 𝑅𝑒 = 200, 𝛽 = 0.6, Δ𝑡 = 1/100. 126 6.28Free surface elevation at different times for 𝑁 = 300, 𝑀 = 30, different time steps Δ𝑡 = 1/66, 1/100, 1/200 and 𝛽 = 0.5. 𝑡𝑜𝑙 = 10−5
127
6.29Free surface elevation at different times for 𝑁 = 300, 𝑀 = 30, different time steps Δ𝑡 = 1/66, 1/100, 1/200 and 𝛽 = 0.6. 𝑡𝑜𝑙 = 10−5
128
6.30Free surface elevation at different times for 𝑁 = 300, 𝑀 = 30, time step Δ𝑡 = 1/100 and different values of 𝛽(= 0.1, 0.5, 0.6, 1, 1.5). 𝑡𝑜𝑙 = 10−5 129 6.31Scheme of the CFPCBF problem.
130
6.32Velocity profile of the CFPCBF after 20 seconds using 𝛽 = 1, Δ𝑡 = 1/50.
130
6.33Free surface elevation at different times for 𝑁 = 300, 𝑀 = 30, time steps Δ𝑡 = 1/20 and different values of 𝛽(= 5, 50, 500). 132 6.34Free surface elevation at different times for 𝑁 = 300, 𝑀 = 30, time steps Δ𝑡 = 1/100 and different values of 𝛽(= 1, 5, 50, 500). 133 6.35Free surface elevation at different times for 𝑁 = 300, 𝑀 = 30, different time steps Δ𝑡 = 1/20, 1/50, 1/100 and 𝛽 = 5. 𝑡𝑜𝑙 = 10−5
134
6.36Velocity profile of the CFPCBF problem after 20 seconds using Reynolds number 𝑅𝑒 = 200, 𝛽 = 1, Δ𝑡 = 1/200. 135 6.37Free surface elevation at different times for 𝑁 = 300, 𝑀 = 30, different time steps Δ𝑡 = 1/50, 1/100, 1/200 and 𝛽 = 0.5. 𝑡𝑜𝑙 = 10−5
136
6.38Free surface elevation at different times for 𝑁 = 300, 𝑀 = 30, different time steps Δ𝑡 = 1/50, 1/100, 1/200 and 𝛽 = 0.6. 𝑡𝑜𝑙 = 10−5
137
LIST OF FIGURES
6.39Free surface elevation at different times for 𝑁 = 300, 𝑀 = 30, different values of 𝛽(= 0.1, 0.5, 0.6, 1, 1.5) and time step Δ𝑡 = 1/100. 𝑡𝑜𝑙 = 10−5
ix
138
6.40Scheme of the CFPCFS problem. 139 6.41Free surface elevation at different different times for 𝑁 = 300, 𝑀 = 30, different values of 𝛽(= 500, 1000, 5000) and time step Δ𝑡 = 1/100. 𝑡𝑜𝑙 = 4 ⋅ 10−4 . 140 6.42Velocity profile of the current flow passing a cylinder at the free surface. Velocity at one cell is so hight it does not allow to see more than that cell. Free surface is represented by a black line. 141 6.43Velocity profile of the current flow passing a cylinder at the free surface, where velocity plotted between 0 and 2. 141
List of Tables 5.1 Errors obtained using both RS once the steady state is reached. Δ𝑥 = Δ𝑦 = 0.1, Δ𝑡 = 0.1, 𝛽 = 1, 𝜈 = 0.001. 84 5.2 Cell center of the cell containing the primary vortex in a grid 50 × 50 for a range of different compressibility coefficients 𝛽. 86 5.3 Cell centre of the cell containing the primary vortex in different grid sizes for 𝛽 = 0.01. The following values have been considered, 𝛽 = 0.01, 𝑅𝑒 = 100, Δ𝜏 = 100000 and Δ𝑡 = 1 with 𝑇𝑒𝑛𝑑 = 100. 86 5.4 Running times for the versions with both RS. The following values have been considered, grid size 50 × 50, so Δ𝑥 = Δ𝑦 = 0.02, 𝑅𝑒 = 100, Δ𝜏 = 100000 and Δ𝑡 = 0.1 with 𝑇𝑒𝑛𝑑 = 100. 𝑡𝑜𝑙 = 10−5.
87
5.5 Running times for the versions with both RS. The same values have been considered but Δ𝑡 = 1
87
5.6 Errors at the final time for a range of Reynolds numbers. Grid size 150 × 150 but for 𝑅𝑒 = 7500 the grid size is 250 × 250.
88
5.7 Case 1, computational times in seconds.
∗
denotes values obtained using formula (114).
93
5.8 Case 2, computational times in seconds.
∗
values obtained using formula (114).
94
5.9 Case 3, computational times in seconds.
∗
values obtained using formula (114).
95
6.1 Computational times in CPU seconds using different values of 𝛽 and Δ𝑡 in a grid 𝑁 = 𝑀 = 30. Divergent results are illustrated by ⋅, 𝑡𝑜𝑙 = 10−6
6.2 Computational times in CPU seconds using different values of 𝛽 and Δ𝑡 in a grid 𝑁 = 𝑀 = 60. Divergent results are illustrated by ⋅, 𝑡𝑜𝑙 = 10−6
6.3 Computational times in CPU seconds using different values of 𝛽 and Δ𝑡 in a grid 𝑁 = 𝑀 = 120. Divergent results are illustrated by ⋅, 𝑡𝑜𝑙 = 10−6
6.4 Computational times in CPU seconds using different values of 𝛽 and Δ𝑡 in a grid 𝑁 = 𝑀 = 30 for 𝑅𝑒 = 100. Divergent results are illustrated by ⋅, 𝑡𝑜𝑙 = 10−6 .
6.5 Computational times in CPU seconds using different values of 𝛽 and Δ𝑡 in a grid 𝑁 = 𝑀 = 60 for 𝑅𝑒 = 100. Divergent results are illustrated by ⋅, 𝑡𝑜𝑙 = 10−6 .
6.6 Computational times in CPU seconds using different values of 𝛽 and Δ𝑡 in a grid 𝑁 = 𝑀 = 120 for 𝑅𝑒 = 100. Divergent results are illustrated by ⋅, 𝑡𝑜𝑙 = 10−6 .
102 102 103 110 111 111
6.7 Computational times in CPU seconds using a grid 𝑁 × 𝑀 = 300 × 30, different values of 𝛽 and Δ𝑡. Divergent results are illustrated by ⋅, 𝑡𝑜𝑙 = 10−5 . 122 6.8 Computational times in CPU seconds using 𝑅𝑒 = 200, a grid 𝑁 × 𝑀 = 300 × 30, different values of 𝛽 and Δ𝑡. Divergent results are illustrated by ⋅, 𝑡𝑜𝑙 = 10−5 . 126
6.9 Computational times in CPU seconds using a grid 𝑁 × 𝑀 = 300 × 30, different values of 𝛽 and Δ𝑡. Divergent results are illustrated by ⋅, 𝑡𝑜𝑙 = 10−5 . 131 xi
xii
LIST OF TABLES
6.10Computational times in CPU seconds using 𝑅𝑒 = 200, a grid 𝑁 × 𝑀 = 300 × 30, different values of 𝛽 and Δ𝑡. Divergent results are illustrated by ⋅, 𝑡𝑜𝑙 = 10−5 . 135
Abstract The Cartesian Cut Cell method has been applied to different flow configurations by researchers at the Centre of Mathematical Modelling and Flow Analysis. This method has been implementer to define flow domains around obstacles using a Godunov-type high order upwind scheme to solve Shallow Water Equations and Navier-Stokes (Euler) equations in two phase flows. A new idea to study Navier-Stoke (Euler) equations in just one phase flows where the domain is accurate described using the Cartesian Cut Cell Method around the moving free surface is presented. The solution technique involves three stages for every time step: the definition of the domain, the solution of the flow equations and the movement of the free surface. The Cartesian Cut Cell Method only requires to recompute cells affected by the movement of the free surface obtaining providing quickly the new domain. The flow equations are solved using the Artificial Compressibility Method and a Godunov-type high order upwind scheme involving the solution of Riemann problems. The Heigh Function method is applied to study the evolution on time of the free surface. This method involves the solution of the kinematic equations, where a fourth order Runge-Kutta method is employed. Boundary conditions at the free surface are discussed. The technique proposed is very quick and allows the use of big time steps. In comparison with the two phase version, the proposed techniques used one thousand times bigger time steps and require around 25 times less computational effort. On the other hand, the results shows dependency on the artificial compressibility parameter introduced as part of the solution of the flow equations. Extensions to the presented study are proposed including the use of different flow solvers. An algorithm to solve free surface flows in a single phase system is presented. The Cartesian Cut Cell Method is used to define the grid in a domain involving free surface and/or the presence of an obstacle. The algorithm approximate the solutions of the incompressible Navier-Stokes equations based on the Artificial Compressibility Method and uses the cell-centred finite volume approach. A Godunov-type high order upwind scheme is applied to compute fluxes at cell interfaces, involving polynomial reconstruction and the solution of a Riemann problem. The HLL Riemann solver and Roe’s Riemann solver are implemented as part of the Godunov-type upwind scheme. An implicit scheme is used for the time discretization in problems without free surface while an explicit forth order Runge-Kutta method is used in free surface problems. An introduction to problem where the free surface and the obstacle cut each other is presented.
xiii
Declaration No portion of the work referred to in this Thesis has been submitted in support of an application for another degree or qualification at this or any other university or other institution of learning. Apart from those parts of this Thesis which contain citations to the work of others and apart from the assistance mentioned in the acknowledgements, this Thesis is my own work.
´ Jos´e Antonio Armesto Alvarez
xv
Acknowledgements I would like to thank my supervisors Mr. Clive Mingham, Dr. Ling Qian and Prof. Derek Causon for their support and guidance throughout my studies. I would also like to thank the Manchester Metropolitan University for the economical support provided for this Thesis. I would also like to thank my former supervisor Dr. David Ingram and my fellow colleagues at the Centre of Mathematical Methods and Flow Analysis and specially to Mr. Andrew Morris for all the informal discussions we had about the Cartesian Cut Cell routines and Dr. Wei Bai for his very useful criticism of my work. My gratitude to my office colleagues Dr. Ben Cawley, Mr. Yong Zang, Mr. Stavros Tentonidis, Ms. Fieke Geurtz and Mr. Kevin Bennet for the enjoyable work atmosphere and the lunches at Tai Wu. My gratitude to Mr. Adri´ an Sarasquete for his help to open my eyes to new methods at the conferences “MARINE CFD 2005” and “Marine 2007, II International Conference on Computational Methods in Marine Engineering” and Dr. Antonio Souto Iglesias and Prof. Ra´ ul Medina Santamar´ıa for giving me the opportunity to present my work at the Universidad Politecnica de Madrid in April 2008 and at the Instituto de Hidr´ aulica Ambiental “IH Cantabria”, Universidad de Cantabria in October 2008 respectively. Many thanks to Mr. Koushan from SINTEF for permitting me the use of their picture in Figure 1.1 and Prof. Quarteroni, Dr. Parolini, Ms. Eugenia Manzanas from the Alinghi Team and Fluent Inc. for their picture used in Figure 1.2. Finally I would like to thanks my girlfriend Mar´ıa for her support, comprehension and love and my family for their support during the last years. During my time in Manchester I made many friends and team-mates from the Manchester Handball Club, Jorge, Mar´ıa, Jean Charles, Rakel, Karim, James, Minas, Lukasz..., and friends and enemies from the Manchester University Handball Club, Asier, Krasi, Marta, Luis, Ralf, Chris, Dominik, Damien,.... To all of them and my friends in Valladolid, Adolfo, Ra´ ul, Pilar, David, Jos´e Luis... and Kaiserslautern, Lolo, Fernando, Jonathan, Panos, Julio, Diego,... I would like to thank.
xvii
Agradecimientos Me gustar´ıa agradecerles el apoyo y su dedicacion a mis directores de tesis, D. Clive Mingham, Dr. Ling Qian y Prof. Derek Causon. Mi agradecimiento a la Manchester Metropolitan University el apoyo economico prestado para la realizaci´ on de esta Tesis. Me gustar´ıa agradecer tambien a mi ex-director Dr. David Ingram y a mis compa˜ neros del Centre of Mathematical Methods and Flow Analysis y especialmente a D. Andrew Morris por las discusiones informales mantenidas sobre las rutinas del Cartesian Cut Cell y al Dr. Wei Bai por sus extremadamente utiles criticas a mi trabajo. Mi agradecimiento a mis companheros de despacho Dr. Ben Cawley, D. Yong Zang, D. Stavros Tentonidis, Da. Fieke Geurtz y D. Kevin Bennet por el magnifico ambiente de trabajo y los almuerzos en Tai Wu. Mi agradecimiento a D. Adri´ an Sarasquete por su ayuda en la participaci´ on de conferencias como “MARINE CFD 2005” and “Marine 2007, II International Conference on Computational Methods in Marine Engineering” y al Dr. Antonio Souto Iglesias y al Prof. Ra´ ul Medina Santamar´ıa por darme la oportunidad de exponer mi trabajo en la Universidad Politecnica de Madrid en Abril de 2008 y el el Instituto de Hidr´ aulica Ambiental “IH Cantabria” de la Universidad de Cantabria en Octubre de 2008 respectivamente. Muchas gracias al Sr. Koushan de SINTEF por permitirme utilizar su imagen en Figure 1.1 y Prof. Quarteroni, Dr. Parolini, Da. Eugenia Manzanas del Alinghi Team y Fluent Inc. por su imagen utilizada en Figure 1.2. Finalmente me gustaria agradecer a mi novia Mar´ıa su paciencia, apoyo y comprensi´on, y a mi familia su apoyo durante los ultimos a˜ nos. Durante mi estancia en Manchester he hecho muchos amigos de mi equipo, el Manchester Handball Club Jorge, Mar´ıa, Jean Charles, Rakel, Karim, James, Minas, Lukasz..., del equipo rival, el Manchester University Handball Club Asier, Krasi, Marta, Luis, Ralf, Chris, Dominik, Damien,.... A todos ellos y a mis amigos de Valladolid, Adolfo, Ra´ ul, Pilar, David, Jos´e Luis,... y Kaiserslautern, Lolo, Fernando, Jonathan, Panos, Julio, Diego,... muchas gracias.
xix
CHAPTER 1
Introduction 1. Motivation The Centre of Mathematical Modelling and Flow Analysis (CMMFA1) has developed a Cartesian Cut Cell Method (CCCM) [24, 25, 63, 126, 162, 161] (see Chapter 2) to define grids in computational domains to solve the Shallow Water Equations (SWE)[24, 25, 60, 61, 100, 140, 161, 166] and the Euler Equations (EE) and Navier-Stokes Equations (NSE) in two fluids systems [63, 117, 118, 119]. In this methodology a Godunov-type high order upwind scheme is applied to compute fluxes at cell interfaces, involving polynomial reconstruction and the solution of a Riemann Problem (RP) is used to solve the system over the defined grid. Alternative methods used to define grids in the computational domains are described in Section 2. New applications of this technique are always desired. Colleagues in the CMMFA are working in different applications like wave run-up and overtopping using depth integrated equations (SWE and Boussinesq’s equations) by Dr. Shiach [138, 139, 140], SWE in different layers, by Ph.D. candidate Zhang [165] and the applicability of the SWE to river modelling by Ph.D. candidate Morris [103]. After a background reading about the CCCM and the SWE it was found that applications of the SWE were already studied: tidal waves over irregular beds [166], bore reflection at inclined walls and circular piers [25, 166], wave overtopping on seawalls [61] dam break problems [42, 46, 100, 123], landslides in a fjord [24] flood disasters [99, 101], tsunamis [79, 126], multi-layers SWE [22, 23, 64, 165]. An alternative to the SWE was considered for this dissertation. Parolini and Quarteroni in [113] applied mathematical modelling to the design of the 2003 and 2007 America’s Cup winner, the Alinghi Team [1]. A two-phase system was considered to study the hull shape and the sails. Inspired by this work, the application of the CCCM to be studied in this research was found: “To study towards Ships Hydrodynamics”. SWE are depth integrated equations so obstacles suspended in the flow (hydrofoils and/or ships) will be in the middle of the integration domain and can not be studied with these equations. Boussinesq’s equations have the same problem as SWE for the study of Ship’s Hydrodynamics, but some extensions have been already applied for this case as the Green-Naghdi Equations (GNE) [47] with a “huge” dispersive term. A second way using Boussinesq-type equations is to split the computational domain into two sub-domains and use different equations in each of them, Jiang [65, 66], in this case the difficulty is the interface between both domains. An introduction to these set of equations is given in Section 3. This study is a first approach to describe waves generated by a ship in the flow using a CCCM (see Figure 1.3), so the incompressible NSE (Section 4) have been considered. Qian has already applied 1Manchester Metropolitan University (MMU). http://cmmfa.mmu.ac.uk/ 1
2
1. INTRODUCTION
Figure 1.1. Laboratory experiments at the Ship Model Tank from the Ship Technology Department of MARINTEK, SINTEF [8].
Figure 1.2. Waves generated on the water surface by an IACC hull by Prof. Quarteroni, Alinghi Team and Fluent Inc. [6]. the technique used at the CMMFA to incompressible NSE in two phase flows [117, 118, 119]. In the presented study the effort is concentrated in a single phase flow with the idea to open the way to study waves generated by ships’ hulls. The main difference between single phase and two-phase is the treatment of the free surface (interface between air and water). In the two-phase case this interface is given by the gradient of the densities (air/water), while in the case of single phase the free surface is described using the kinematic condition (see Chapter 4) and the velocities from the fluid. In Qian’s work the time step considered is very small, order of 10−5 , which is believed to be the effect of the big gradient of densities across the free surface. Using single phase as there is not such a gradient, it was thought that the time step considered would be much bigger and the computational cost will be reduced. The aim of this work is to study in the direction of waves generated by ships, but it can also be applied to situations involving the NSE with free surface and obstacles on it, like oil platforms. The Artificial Compressibility Method (ACM) [30] is applied to the incompressible NSE, where a pressure perturbation is applied in fictitious time to the conservation of mass equation (see Chapter 3) obtaining a set of hyperbolic equations. A Godunov-type scheme is used in the resulting equations
2. GRID METHODS
3
Figure 1.3. Scheme of the computational domain defined by the free surface using a CCCM. where the solution of RP are required at cell interfaces. Different methods applied to solve the NSE are described in Section 5. The computational domain changes, as the free surface moves at every time step. There are different methods to describe the movements of the free surface and a revision of them can be found in Chapter 4. The Height Function method is applied to simulate the free surface movement. 2. Grid Methods In the study of Computational Fluid Dynamics (CFD) the most common procedure is to define a grid (mesh) covering the computational domain where discretized equations are solved. The grid is formed by several finite volume non-overlapping sub-domains called cells, with common interfaces. When the computational domain moves, the grid is recomputed to fit it at every time, so an efficient grid method to recompute the grid is needed. The grid has to be flexible to describe the boundaries (solid and/or free surface). There are different methods to define grids fitting the computational domain. 2.1. Cartesian Cut Cell Method. The Cartesian Cut Cell Method (CCCM) is used to describe the grid in the computational domain. It consist of a Cartesian background grid overlapping the domain. The background grid is cut around the boundaries and the obstacles in the domain to obtain the final grid. In this work the method is applied to define the grid around the solid bodies and the free surface. When solid bodies and/or the free surface moves, only cells around them have to be recomputed. A description of this method is given in Chapter 2. 2.2. Alternative Grid Generation Methods. The methods to define grids can be divided into different categories depending on the shape of the cells or depending on how the cells are connected to each other.
4
1. INTRODUCTION
In two dimensions, interfaces (sides) between cells are 1-D. Two different shape of cells, quadrilaterals (4 sides) and triangles (3 sides) are usually used. In three dimension interfaces between cells are 2-D, hexahedra (6 sides), tetrahedra (4 sides), square pyramids and extruded triangles (5 sides) cells are usually considered. Using CCCM a combination of cell forms (3,4 and 5 sides in 2D) are considered. The most common classification done is the one depending on the connectivity among cells: ∙ Structured grids: when the connectivity between cells is regular. Cells in the grid can be numbered as the indexes of a matrix, so it is easy to know the neighbours of each cell every time. The shape of the cells in this grids are quadrangular, in 2-D, and hexahedral, in 3-D. Their application to very complicated domains is limited but when the domain moves these methods are very quick as not many cells have to be recomputed.
(a) Rectangular cell (2-D).
(b) Hexahedral cell (3-D).
Figure 1.4. Common cell types used in structured grids.
Figure 1.5. Example of a structured grid in 2-D. ∙ Unstructured grids: when the connectivity is very irregular. The neighbours of each cell have to be stored in what could be called “vector of neighbours”. The cells in this kind of grids can have many shapes, the most popular being triangles in 2-D, and tetrahedra (4 sides) and pyramids, in 3-D. They are very flexible to adjust to complicated domains, but when the domain moves, most of the cells, but not all of them, have to be relocated. ∙ Mixed grids: when in the same grid there are cells following a regular connectivity in some areas and irregular connectivity in other areas.
3. ALTERNATIVE EQUATIONS THAT WERE DISMISSED
(a) Triangular cell (2D).
(b) Tetraedral cell (3D).
5
(c) Piramidal cell (3-D).
Figure 1.6. Common cell types used in unstructured grids.
Figure 1.7. Example of an unstructured grid in 2-D.
Figure 1.8. Example of a mixed grid in 2-D.
3. Alternative Equations that were Dismissed The following systems of equations have been considered at the initial stage of the work as an option to study ship waves. They are velocity averaged equations, so they are an approximation to the NSE that reduce the dimension, 3-D NSE is approximated by 2-D equations, and 2-D NSE approximated by 1-D.
6
1. INTRODUCTION
3.1. Shallow Water Equations (SWE). SWE are depth integrated simplifications of the NSE. The vertical velocity is neglected and they can be applied where the wave length of the phenomenon is much bigger than the depth of the domain. They are used to model processes produced by gravitational and rotational forces and include Coriolis forces. To avoid the depth restriction some work has been done using more than one layer [23, 22, 64, 165]. The NSE (Section 4) are rewritten using Reynold decomposition into the Reynolds-Averaged NavierStokes equations (RANS, see equations (41, 42)). They are depth integrated using the no-slip boundary condition at the bed and the kinematic condition at the free surface, see [124, 126, 165]. So the SWE can be written as:
y
η
h
H
x
zb Figure 1.9. Notation used in the SWE.
∂U + ∇ ⋅ F = S, ∂𝑡
(1)
(2)
U
=
⎡
⎤ 𝜙 ⎣ 𝜙𝑢 ⎦ , 𝜙𝑣
F
=
⎤ ⃗ 𝜙𝑉 ⎣ 𝜙𝑢𝑉 ⃗ + 1 𝜙2 i ⎦ 2 ⃗ + 1 𝜙2 j 𝜙𝑣 𝑉 2 ⎡
and
S
=
⎡
⎤ 0 𝑔 ⎣ 𝑔𝜙 ∂𝐻 ⎦, ∂𝑥 − 𝜌 𝜏𝑓 𝑥 𝑔 ∂𝐻 𝑔𝜙 ∂𝑦 − 𝜌 𝜏𝑓 𝑦
⃗ = [𝑢, 𝑣]𝑇 are the depth averaged velocities, 𝑔 the gravity acceleration, 𝜙 = 𝑔ℎ is the geopowhere 𝑉 tential, 𝜌 is the density, ℎ the water depth, 𝐻 the partial depth between a fixed reference level and the bed of the domain, 𝜏𝑓 𝑥 , 𝜏𝑓 𝑦 are the components of the bed shear stress dependent on the bed friction coefficient [166] and ∇⋅ denotes the divergence. SWE can not deal with obstacles suspended in the flow. To study ship waves with this equations, the ship can not be suspended, so it would have to be in contact with the bed, see Figure 1.10. In this situation the form of the wetted ship has no relevance. 3.2. Boussinesq’s equations. Boussinesq’s equations are a depth integrated (averaged) simplification of the NSE. Unlike the SWE, Boussinesq’s equations can be used to model dispersive wave (waves of different wavelengths travelling at different phases) processes.
3. ALTERNATIVE EQUATIONS THAT WERE DISMISSED
(a) Obstacle suspended in flow.
7
(b) Extesion of the ship contacting the bed.
Figure 1.10. Situations that can and can not be dealt with using SWE.
The applicability of the original Boussinesq’s equations derived by Boussinesq [18] was limited to waters of constant depth, Peregrine [114] extended the applicability to shallow waters. A very popular extension to Boussinesq’s equations are the Nwogu’s Buoussinesq equations [108], a description of them can be found in [75, 138, 155]. Nwogu’s Boussinesq equations overcome the shallow waters limitation [56] and has the form,
(3)
(4)
( ) ∂𝜁 ⃗ + ∇ ⋅ 𝐻𝑉 ∂𝑡
⃗ ∂𝑉 ∂𝑡
+
(
) ⃗ ⋅∇ 𝑉 ⃗ 𝑉
+∇
{(
ℎ2 𝑧𝛼2 − 2 6
+ 𝑔∇𝜁 + 𝑧𝛼
{
)
(
⃗ ℎ∇ ∇ ⋅ 𝑉
)
(
ℎ + 𝑧𝛼 + 2
)
(
⃗) ℎ∇ ∇ ⋅ (ℎ𝑉
) ( ( ))} ( ⃗ ⃗ ∂𝑉 ∂𝑉 𝑧𝛼 +∇ ∇⋅ ℎ ∇ ∇⋅ 2 ∂𝑡 ∂𝑡
)}
=
= 0,
0,
⃗ is the horizontal velocity vector at a certain elevation 𝑧 = 𝑧𝛼 and 𝑧 = ((𝑧𝛼 /ℎ)2 /2) + (𝑧𝛼 /ℎ). where 𝑉 Modified Boussinesq’s equations have already been used in ship waves by Jiang [65, 66] where two set of Boussinesq type equations are considered. The first one,
(5)
∂𝜁 ∂ ( ⃗) 𝐻 𝑉 = 0, + ∂𝑡 ∂𝑥
(6)
) 3⃗ ( 2 ⃗ ⃗ ∂𝑉 ⃗ ∂ 𝑉 + 𝑔 ∂𝜁 − ℎ ∂ 𝑉 𝐻 𝑉 ⃗ = 0, +𝑉 ∂𝑡 ∂𝑥 ∂𝑥 3 ∂𝑡∂ 2 𝑥
⃗ for the flow outside the waterline (𝐷𝑓 𝑠 ) with the unknown depth-averaged horizontal velocity 𝑉 and the wave elevation 𝜁. The second one is a set of non-linear partial-differential equations of Boussinesq type, see Figure 1.11,
(7)
−
) ∂ ( ∂𝑇 ⃗ = 0, + (ℎ𝑇 ) 𝑉 ∂𝑡 ∂𝑥
8
(8)
1. INTRODUCTION
⎛ ( )⎞ 2 ∂ 𝜌𝑝 3⃗ ⃗ ⃗ ∂𝑉 ⃗ ∂𝑉 + ⎝ ⎠ − (ℎ − 𝑇 ) ∂ 𝑉 +𝑉 ∂𝑡 ∂𝑥 ∂𝑥 3 ∂𝑡∂ 2 𝑥 −
⃗ ⃗ (ℎ − 𝑇 ) ∂𝑇 ∂ 2 𝑉 ∂𝑇 ∂ 2 𝑉 𝑇 + (ℎ − 𝑇 ) =𝑔 , 2 3 ∂𝑡 ∂ 𝑥 ∂𝑥 ∂𝑡∂𝑥 𝑥
for the flow inside the waterline (𝐷𝑠 ) with the pressure 𝑝𝑠 acting on the wetted body-surface, 𝑔 denotes the acceleration of gravity, 𝜌 the water density, 𝑇 the local instantaneous draft and ℎ the constant water-depth. In the interface between both domains (𝐷𝑠 and 𝐷𝑓 𝑠 ) a combination of both equations have to be solved.
D fs
Ds
D fs
Figure 1.11. Scheme of the domains proposed by Jiang [65, 66].
3.3. Green-Naghdi Equations. The Green-Naghdi equations (GNE) [47] are an extension of the Boussinesq equations. They provide a depth-averaged description of shallow water motion with a free surface under gravity, 𝑔. GNE have been applied to ship hydrodynamics by Wu and Chen [67] and they look like:
(9)
∂𝜁 ⃗ ) = 0, + ∇ ⋅ (𝐻 𝑉 ∂𝑡
(10)
⃗ ∂𝑉 ⃗ ⋅ ∇)𝑉 ⃗ + 𝑔∇(𝜁 + 𝑝) + 𝜏 𝑉 ⃗ = −𝐴, + (𝑉 ∂𝑡
⃗ = (𝑢, 𝑣) the depth-averaged horizontal where 𝜁 is the free surface height relative to still water, 𝑉 velocities, 𝐻 = ℎ + 𝑧 the total water depth, ℎ the still water depth, 𝜌 is the water density, 𝑔 acceleration due to gravity, 𝑝 = 𝑝/𝜌𝑔 is the moving pressure on the free surface, ∇ is the horizontal ⃗ ∣/(𝑐2 𝐻) is the bed friction coefficient and 𝑐 is the Chezy constant. The differential operator, 𝜏 = 𝑔∣𝑉 frequency dispersion term 𝐴 of the Eq. (10) is,
4. NAVIER-STOKES EQUATIONS
(11)
9
1 𝐴 = − 𝐷2 ℎ ⋅ ∇(2𝜁 − ℎ) 6 +
} 1{ 2 𝐷 𝜁 ⋅ ∇(4𝜁 + ℎ) + (ℎ + 𝜁) ⋅ ∇(2𝐷2 𝜁 − 𝐷2 ℎ) , 6
⃗ being the where 𝐷 is the total horizontal differential operator (derivative along trajectories) with 𝑉 velocity of the fluid,
(12)
𝐷=
∂ ⃗ ⋅ ∇). + (𝑉 ∂𝑡
4. Navier-Stokes Equations The Navier-Stokes Equations (NSE) are a set of non-linear Partial Differential Equations (PDE) that governs the motion of viscous flows. They are named after Claude-Louis Navier and Sir George Gabriel Stokes. These equations have been applied to many phenomenon in physics from hydrodynamics (water flow, ocean currents) to aerodynamics (flow around airfoils) going through meteorology (weather modelling). The existence and smoothness of the solution of the NSE is one of the seven problems proposed by the Clay Mathematics Institute in the so-called Millennium Prize Problems. The solution of each problem is awarded with one million US dollars. The description of the Navier-Stokes problem proposed by the Clay Mathematics Institute is given by Fefferman [36]. “Waves follow our boat as we meander across the lake, and turbulent air currents follow our flight in a modern jet. Mathematicians and physicists believe that an explanation for and the prediction of both the breeze and the turbulence can be found through an understanding of solutions to the NSE. Although these equations were written down in the 19th Century, our understanding of them remains minimal. The challenge is to make substantial progress toward a mathematical theory which will unlock the secrets hidden in the NSE ” [3].
4.1. Continuous Media Modelling. The fluid is a continuous material, so its properties (velocity, density, pressure) are continuous. These properties are defined at each point as the limit ¯ ∈ ℝ𝑛 , (𝑛 = 2, 3) can be of volumes containing that point, for example the velocity 𝑢 at point x defined as,
(13)
⃗ (¯ 𝑉 x; 𝑡) = lim
𝑟→0
(
1 2𝜋𝑟
∫
⃗ (x; 𝑡) d x 𝑉 𝐵(¯ x,𝑟)
)
where 𝐵(¯ x, 𝑟) = {y ∈ ℝ𝑛 : ∣∣¯ x − y∣∣ < 𝑟}. A similar procedure is followed to define fluid properties (density, pressure) at every point of the fluid. The study of physical quantities (mass and momentum) is done using representative volumes called control volume Ω. In these volumes the physical quantities are balanced over a time interval, the amount in the volume is equal to the amount leaving or entering the volume plus the amount produced by the source, i.e.,
10
(14)
1. INTRODUCTION
(
Rate of change Inside Ω
)
(
=
Flux through boundaries Flux through ∂Ω
)
+
(
Sources Inside Ω
)
.
The flux through the boundaries can be split into advection (movement with the fluid flow) and diffusion (net transport by random, molecular or turbulent, motion). Definition 1.1. Definitions and properties. ∙ Consider vectors ⃗𝑎, ⃗𝑏 ∈ ℝ𝑛 , the dot product is a real number defined as: (15)
⃗𝑎 ⋅ ⃗𝑏 = [𝑎1 , 𝑎2 , . . . , 𝑎𝑛 ] ⋅ [𝑏1 , 𝑏2 , . . . , 𝑏𝑛 ] =
𝑛 ∑
𝑎 𝑖 𝑏𝑖 .
𝑖=1
∙ Consider a vector ⃗𝑎 = [𝑎1 , 𝑎2 , . . . , 𝑎𝑛 ] ∈ ℝ𝑛 , and another vector ⃗𝑏 = [𝑏1 , 𝑏2 , . . . , 𝑏𝑚 ] ∈ ℝ𝑚 where 𝑚 can be different than 𝑛, the outer product is a 𝑛 × 𝑚 matrix, ⎡
𝑎 1 𝑏1 ⎢ 𝑎 2 𝑏1 ⎢ ⃗𝑎 ⊗ ⃗𝑏 = ⎢ ⎣ ... 𝑎 𝑛 𝑏1
(16)
𝑎 1 𝑏2 𝑎 2 𝑏2 ... 𝑎 𝑛 𝑏2
... ... .. . ...
3
⎤ 𝑎 1 𝑏𝑚 𝑎 2 𝑏𝑚 ⎥ ⎥ ⎥. ... ⎦ 𝑎 𝑛 𝑏𝑚
∙ Consider a scalar function 𝜆 : ℝ → ℝ The notation ∇ is used for the gradient, (17)
[
] ∂𝜆 ∂𝜆 ∂𝜆 ∇𝜆 = grad(𝜆) = . , , ∂𝑥 ∂𝑦 ∂𝑧 ∙ Consider a vectorial function 𝐹⃗ : ℝ3 → ℝ3 . 𝐹⃗ = [𝐹1 , 𝐹2 , 𝐹3 ]. The notation ∇⋅ is used for the divergence, ∇ ⋅ 𝐹⃗ = div(𝐹⃗ ) =
(18)
∂𝐹1 ∂𝐹2 ∂𝐹3 + + . ∂𝑥 ∂𝑦 ∂𝑧
– Consider a scalar function 𝜆 : ℝ3 → ℝ and a vectorial function 𝐹⃗ : ℝ3 → ℝ3 , (19)
(𝜆𝐹⃗ ) = ( |{z} ∇ 𝜆)
∇⋅ |{z}
𝑔𝑟𝑎𝑑𝑖𝑒𝑛𝑡
𝑑𝑖𝑣𝑒𝑟𝑔𝑒𝑛𝑐𝑒
⋅ |{z}
𝑑𝑜𝑡 𝑝𝑟𝑜𝑑𝑢𝑐𝑡
𝐹⃗ + 𝜆(
∇⋅ |{z}
𝐹⃗ )
𝑑𝑖𝑣𝑒𝑟𝑔𝑒𝑛𝑐𝑒
– Consider a function 𝜆 : ℝ → ℝ and function 𝐹⃗ = [𝑓, 𝑔] : ℝ2 → ℝ2 , (20)
∇ ⋅ (𝜆𝐹⃗ ⊗ 𝐹⃗ ) = ∇ ⋅
2
[
] [ ∂(𝜆𝑓 𝑓 ) ∂(𝜆𝑔𝑓 ) ] 𝜆𝑔𝑓 ∂𝑥 ∂𝑦 = ∂(𝜆𝑓 𝑔) ∂(𝜆𝑔𝑔) 𝜆𝑔𝑔 ∂𝑥 ∂𝑦 [ ] ∂𝜆𝑓 ∂𝑓 ∂𝑓 𝜆𝑓 ∂𝑥 + 𝑓 ∂𝑥 𝜆𝑔 ∂𝑦 + 𝑓 ∂𝜆𝑔 ∂𝑦 = ∂𝑔 ∂𝑔 𝜆𝑓 ∂𝑥 + 𝑔 ∂𝜆𝑓 𝜆𝑔 ∂𝑦 + 𝑔 ∂𝜆𝑔 ∂𝑥 ∂𝑦 ] [ ] [ ∂𝜆𝑓 ∂𝑓 ∂𝑓 𝑓 ∂𝑥 𝑓 ∂𝜆𝑔 𝑓 ∂𝑥 𝑔 ∂𝑦 ∂𝑦 + =𝜆 ∂𝑔 ∂𝑔 𝑔 ∂𝑦 𝑔 ∂𝜆𝑔 𝑓 ∂𝑥 𝑔 ∂𝜆𝑓 ∂𝑥 ∂𝑦
𝜆𝑓 𝑓 𝜆𝑓 𝑔
A similar procedure is applied in 3-D.
= 𝜆(𝐹⃗ ⋅ ∇𝐹⃗ ) + 𝐹⃗ ∇ ⋅ (𝜆𝐹⃗ ).
4. NAVIER-STOKES EQUATIONS
11
4.2. Conservation of Mass. When there are no sources applied to the system, the mass is conserved (density × volume = constant) [14, 152]. So the derivative along trajectories, see formula (12), is zero, ∫
𝑑 𝑑𝑡
(21)
𝜌𝑑Ω + Ω
∫
∂Ω
⃗ ⋅ n𝑑𝐴 = 0. 𝜌𝑉
Applying the divergence theorem2, 𝑑 𝑑𝑡
(22)
∫
𝜌𝑑Ω + Ω
∫
Ω
⃗ )𝑑Ω = 0. ∇ ⋅ (𝜌𝑉
Using Leibniz’s rule3 and asumming 𝜌 and ∂𝜌/∂𝑡 smooth, the derivative on time can be included in the integral. Then using the fact that the integral is a scalar function4 , ∫ (
(23)
Ω
) ∂𝜌 ⃗ ) 𝑑Ω = 0. + ∇ ⋅ (𝜌𝑉 ∂𝑡
The above relation has to be satisfied for every volume Ω in the fluid domain, therefore it is necessary that the interior of the integral sign to be zero, so ∂𝜌 ⃗ ) = 0. + ∇ ⋅ (𝜌𝑉 ∂𝑡
(24)
This equation is the so-called conservation of mass equation. When the flow is incompressible density (𝜌) variations are ignored and the conservation of mass equation in this case becomes 𝑑𝜌 ⃗ = 0, = 0 and ∇ ⋅ 𝑉 𝑑𝑡
(25)
4.3. Conservation of Momentum. For the conservation of momentum there are some forces acting on the fluid (denoted by 𝒮) [14, 152] and equation (14) can be written as: (26)
∫
Ω
⃗) ∂(𝜌𝑉 𝑑Ω + ∂𝑡
∫
∂Ω
⃗ )𝑉 ⃗ ⋅ n𝑑𝐴 = (𝜌𝑉
∫
Ω
𝒮.
This equation can be integrated over volumes as the conservation of mass has been done before, obtaining
(27)
∂ ⃗ ⃗ ⊗𝑉 ⃗ ) + 𝒮. (𝜌𝑉 ) + ∇ ⋅ (𝜌𝑉 ∂𝑡
∫ 2Divergence theorem ∫ ∇ ⋅ 𝐹 ⃗ 𝑑Ω = ⃗ Ω ∂Ω 𝐹 n𝑑𝑆 3Leibniz’s rule: ∂ ∫ 𝑓 (x; 𝑡)𝑑Ω = ∫ ∂𝑓 (x; 𝑡)𝑑Ω. Ω ∂𝑡 ∂𝑡 Ω 4Scalar rule: ∫ 𝑓 𝑑Ω + ∫ 𝑔𝑑Ω = ∫ 𝑓 + 𝑔𝑑Ω and ∫ 𝜆𝑓 𝑑Ω = 𝜆 ∫ 𝑓 𝑑Ω for 𝜆 ∈ ℝ. Ω Ω Ω Ω Ω
12
1. INTRODUCTION
where ⊗ denotes the outer product of vectors. ⃗ in equation (27) results, Using equation (20) with 𝜆 = 𝜌 and 𝐹⃗ = 𝑉
(28)
⃗ ⃗ ∂𝜌𝑉 ⃗ ⋅ ∇𝑉 ⃗)+𝑉 ⃗ ∇ ⋅ (𝜌𝑉 ⃗)+𝒮 =𝑉 ⃗ ∂𝜌 + 𝜌 ∂ 𝑉 + 𝜌(𝑉 ⃗ ⋅ ∇𝑉 ⃗)+𝑉 ⃗ ∇ ⋅ (𝜌𝑉 ⃗)+𝒮 + 𝜆(𝑉 ∂𝑡 ∂𝑡( ∂𝑡 ) ( ) ) ( ⃗ ⃗ ∂ 𝑉 ∂ 𝑉 ∂𝜌 ⃗ ) +𝜌 ⃗ ⋅ ∇𝑉 ⃗ +𝒮 =𝜌 ⃗ ⋅ ∇𝑉 ⃗ +𝒮 ⃗ + ∇ ⋅ (𝜌𝑉 +𝑉 +𝑉 =𝑉 ∂𝑡 ∂𝑡 ∂𝑡 | {z } =0( Mass Conservation)
Then the conservation of momentum equations states,
𝜌
(29)
(
⃗ ∂𝑉 ⃗ ⋅ ∇𝑉 ⃗ +𝑉 ∂𝑡
)
+ 𝒮 = 0.
The force term 𝒮 can be split into two different forces, external forces 𝒮𝑒 , like gravity force, and internal contact forces 𝒮𝑐 . (30)
𝜌
(
⃗ ∂𝑉 ⃗ ⋅ ∇𝑉 ⃗ +𝑉 ∂𝑡
)
+ 𝒮𝑒 + 𝒮𝑐 = 0,
The contact forces have contributions from the pressure due Johann, Bernoulli and Euler, and contributions from viscosity due Navier and Stokes [14], (31)
⃗ + 𝜆∇(∇ ⋅ 𝑉 ⃗ ). 𝒮𝑐 = −∇𝑝 + 𝜇∇ ⋅ 𝑉 | {z } {z } | 𝑝𝑟𝑒𝑠𝑠𝑢𝑟𝑒
𝑣𝑖𝑠𝑐𝑜𝑠𝑖𝑡𝑦
Where 𝜇 is the viscosity coefficient and 𝜆 a viscous coefficient associated with volume change which is usually neglected.
Definition 1.2. Important CFD Parameters. ∙ Reynolds number (𝑅𝑒) [14] is a dimensionless parameter that provides a ratio of change in the flow conditions depending on density ad viscosity: (32)
𝜌𝐿𝑈 , 𝜇 where 𝐿 is a representative length, such as the maximum diameter between boundaries, 𝑈 is a representative velocity, such as the velocity at the right boundary, 𝜌 the density and 𝜇 the viscosity. 𝑅𝑒 =
“All those flows that satisfy the same boundary and initial conditions when expressed ⃗ =𝑉 ⃗ /𝑈 , 𝑡 = 𝑡/𝐿 and x = x/𝐿), and for which the in non-dimensional form (redefine 𝑉 corresponding values of 𝜌, 𝐿, 𝑈 and 𝜇 are different without the value of the combination
4. NAVIER-STOKES EQUATIONS
13
𝜌𝐿𝑈/𝜇 (= 𝑅𝑒) being different, are described by one and the same non-dimensional solution; and all such flows are said to be dynamically similar” [14]. The Reynolds number is the parameter indicating the character of the flow being laminar (the fluid travels in regular paths) or turbulent (the fluid travels in irregular and mixing paths). ∙ Mach number (𝑀 ) is a dimensionless parameter that provides the ratio between the reference speed of the fluid (or obstacle in the fluid), ∣𝑈 ∣, and the speed of sound in this fluid, 𝑐𝑓 , (33)
𝑀=
∣𝑈 ∣ . 𝑐𝑓
Speed of sound of water at 15𝑜 C is 𝑐𝑓 = 1470𝑚/𝑠 [14]. Like in the Reynolds number, fluids with similar Mach numbers behave alike. Flows can be classified depending on the Mach number,
(34)
⎧ subcritical flow ⎨ 1 supercritical flow.
∙ Froude Number (𝐹 𝑟). The interest in this dissertation is in free surface flows, where gravity induce the movement of the waves, in fact these kind of waves are usually called “gravity waves”. The Froude number is a dimensionless parameter providing a ratio of inertial and gravitational forces, i.e., the ratio between √ the speed of the fluid (𝑈 ) and the speed of propagation of a wave at the free surface ( 𝑔𝐿), (35)
√ 𝐹 𝑟 = 𝑈/ 𝑔𝐿.
The Froude number is to gravity waves the equivalent of the Mach number to gas dynamics [77], and it provides the regime of the flow in this case,
(36)
⎧ ⎨ 1
subcritical flow critical flow supercritical flow.
The NSE for incompressible flows (constant 𝜌) are called Incompressible NSE and look like, (37)
⃗ =0 ∇⋅𝑉
(38)
⃗ ∂𝑉 ⃗ ⋅ ∇𝑉 ⃗ = −∇𝑝 + 𝜇∇ ⋅ 𝑉 ⃗ + 𝒮𝑒 . +𝑉 ∂𝑡
These equations are reduced when the flow is incompressible and inviscid, resulting in the EE, (39)
⃗ = 0, ∇⋅𝑉
(40)
⃗ ∂𝑉 ⃗ ⋅ ∇𝑉 ⃗ = −∇𝑝 + 𝒮𝑒 . +𝑉 ∂𝑡
14
1. INTRODUCTION
A time average of the fluid properties (velocities, density and pressure) using Reynold decomposition5 is used to obtain the RANS equations, written as [113]:
(41)
∂𝜌𝑎 ⃗ + 𝑉𝑎 ⋅ ∇𝜌𝑎 = 0, ∂𝑡
(42)
⃗𝑎 ∂𝜌𝑎 𝑉 ⃗𝑏 ⋅ ∇𝑉 ⃗𝑏 = −∇𝑝𝑎 + 𝜇𝑎 ∇ ⋅ 𝑉 ⃗ 𝑎 + 𝒮𝑒 = ∇ ⋅ ( 𝑅 ˜ + 𝑆), +𝑉 ∂𝑡
˜ the Reynolds stress tensor (𝑅 ˜ 𝑖,𝑗 = −𝜌𝑎 𝑢𝑏,𝑖 𝑢𝑏,𝑗 , 𝑖, 𝑗 = where 𝑢𝑏 = 𝜌𝑎 𝑢𝑎 /𝜌 is the Favre average and 𝑅 1, 2, 3) and 𝑢𝑐 = 𝑢 − 𝑢𝑏 . This set of equations are usually applied to turbulent flows. 4.4. Artificial Compressibility Method (ACM). Using Artificial Compressibility Method (ACM) [30] the incompressible NSE are modified becoming what could be called pseudo-compressible NSE, which is an hyperbolic system of equations. Techniques usually applied to the solution of compressible NSE like a Godunov-type Method can be used solving the new pseudo-compressible NSE. This method will be explained in Section 2.
5. Alternative Solution Methods This section contains a brief revision of the methods applied not only to the NSE, but to PDE in general. In the first part of the section the method used for the particular case of NSE is shown. The second part reviews the different methods for the spatial and temporal discretization in general PDEs. 5.1. Alternative Variables. The first choice that can be made is the kind of variable used to ⃗ and pressure 𝑝 are considered. That is solve the NSE. In this study primitive variables, velocity 𝑉 not the only option, “derived variables” such as the vorticity-stream variables can also be considered. ⃗ = [𝑢, 𝑣, 𝑤]𝑇 , The vorticity, 𝜔 ⃗ , is defined as the curl of the velocity, in 3-D 𝑉
(43)
⃗𝑖 ⃗ = ∂/∂𝑥 𝜔 ⃗ =∇×𝑉 𝑢
⃗𝑗 ∂/∂𝑦 𝑣
⃗𝑘 ∂/∂𝑧 𝑤
,
where ⃗𝑖, ⃗𝑗, ⃗𝑘 are the unitary vectors in the 𝑥, 𝑦 and 𝑧 directions. In two dimensions it is reduced to the 𝑧-component of this vector, i.e.,
(44)
∂𝑢 ∂𝑣 − . 𝜔=𝜔 ⃗ ⋅ ⃗𝑘 = ∂𝑥 ∂𝑦
In two dimensions a function called the stream function, 𝜓, can be defined as:
(45)
∂𝜓 ∂𝜓 = −𝑣 and = 𝑢. ∂𝑥 ∂𝑦
5𝜌 = 𝜌 + 𝜌′ where 𝜌 denotes the average of 𝜌 and 𝜌′ denotes the perturbation part. 𝑎 𝑎
5. ALTERNATIVE SOLUTION METHODS
15
The conservation of mass equation (37) and the conservation of momentum equation (38) can be written into the so-called Vorticity Equations: (46)
Δ𝜓 = −𝜔.
(47)
∂𝜔 ⃗ ⋅ ∇)𝜔 = 𝜇∇ ⋅ 𝜔. + (𝑉 ∂𝑡
The boundary conditions are difficult to implement in these variables. In addition the difficulty to extend it to 3-D makes the system not very popular in CFD. 5.2. Coupled/Uncoupled methods. Once the variables to use in the resolution of the NSE are known, the next step is the election of the way these variables are going to be considered, each one differently or both coupled. In this work the variables are coupled in a vector denoted as U. When using coupled variables the methods can be divided in direct methods or modified methods. The direct methods try to solve the coupled system directly and are difficult to solve and expensive computationally. The modified methods consist in a perturbation of the conservation of mass equation (37) which can be done in different ways: ∙ Penalty Method, where the pressure multiplied by a penalty parameter 𝛽 is added, (48)
(49)
(50)
⃗ =0⇒∇⋅𝑉 ⃗ + 𝛽𝑝 = 0. ∇⋅𝑉 ⃗ )/𝛽 and therefore the conservation of Then the pressure can be written as 𝑝 = −(∇ ⋅ 𝑉 momentum can be written as: ⃗ ∂𝑉 ⃗ ⋅ ∇)𝑉 ⃗ = 1 ∇(∇ ⋅ 𝑉 ⃗ ) + 𝜇∇ ⋅ 𝑉 ⃗ + 𝒮𝑒 . + (𝑉 ∂𝑡 𝛽 ∙ Petrov-Galerking Method, where the perturbation has the form of the Laplacian of the pressure multiplied by a small parameter 𝛽, ⃗ =0⇒∇⋅𝑉 ⃗ − 𝛽∇ ⋅ 𝑝 = 0 : ∇𝑝 ⋅ ⃗𝑛∣∂Ω = 0. ∇⋅𝑉
∙ ACM, the perturbation is added using a derivative of the pressure in fictitious time, 𝜏 , multiplied by an artificial compressibility parameter 𝛽. This is the method applied in this dissertation and will be described in Section 2, (51)
⃗ =0⇒ ∇⋅𝑉
1 ∂𝜌 ⃗ = 0. +∇⋅𝑉 𝛽 ∂𝜏
The issue in the modified methods is in choosing the value of the perturbation parameter, denoted by 𝛽 in all the cases. This value has to be big enough to change the conservation of mass equation and small enough to avoid an excessive perturbation. In the case of the ACM the value of the parameter 𝛽 will be discussed. ⃗ , and the pressure, 𝑝, in different ways. The idea A second approach is to compute the velocity, 𝑉 is to obtain smaller systems of equations which are easier to compute. These methods are usually called Projection Method or Fractional Step Methods or Predictor-Corrector Methods and were introduced also by Chorin in [31]. The usual methodology is:
16
1. INTRODUCTION
⃗ ∗ may, or may not, use a pressure (1) To obtain a first estimation for the velocity 𝑉 approximation, (2) to solve a Poisson equation for the pressure6 using the estimated velocities (3) finally to update the velocity using the estimated velocity and the pressure computed. There is a family of methods that can be considered an extension of these methods called SemiImplicit Method for Pressure Linked Equation (SIMPLE). An iterative process is used to compute the velocity and pressure as described in [125]: (1) Guess a pressure value 𝑝0 at each cell, ⃗ ∗ using 𝑝0 , and solving the conservation of (2) obtain a first estimation for the velocity 𝑉 momentum equation, (3) solve a Poisson equation for the pressure using the estimated velocities and a fictitious time step 𝜏 , (4) correct the velocity and pressure improving the conservation of mass (5) iterate steps 2 to 4 until a divergence-free velocity field is obtained. This method is used for example by Apsley and Hu [12], Chang and Yang [28], Ferrari et al. [38] and Wu and Hu [158]. 5.3. Spatial discretization. There are different approaches for the spatial discretization which are outlined in this section. ∙ Finite Difference Methods (FDM). The basic idea is to simplify the computational domain in a set of nodes and use the Taylor extension to write a discretization of the equations based on the neighbouring nodes. (52)
(53)
∂2𝑓 ∂𝑓 (𝑥0 ) + Δ𝑥2 2 (𝑥0 ) + 𝑂(Δ𝑥3 ). ∂𝑥 ∂𝑥 Example 1.3. Lets consider the hyperbolic advection equation in 1D, 𝑓 (𝑥0 + Δ𝑥) = 𝑓 (𝑥0 ) + Δ𝑥
∂𝑢 ∂𝑢 +𝑎 = 0, ∂𝑡 ∂𝑥 over a grid {𝑥𝑖 : 𝑖 = 0, 1, . . . , 𝑁 }. There are different approximations to describe ∂𝑢/∂𝑥: – forward
(54)
(𝑢𝑖 )𝑥 =
𝑢𝑖+1 − 𝑢𝑖 ∂𝑢 𝑢𝑖+1 − 𝑢𝑖 ⇒ = −𝑎 Δ𝑥 ∂𝑡 Δ𝑥
(𝑢𝑖 )𝑥 =
∂𝑢 𝑢𝑖 − 𝑢𝑖−1 𝑢𝑖 − 𝑢𝑖−1 ⇒ = −𝑎 Δ𝑥 ∂𝑡 Δ𝑥
– backward (55) – centred (56)
𝑢𝑖+1 − 𝑢𝑖−1 ∂𝑢 𝑢𝑖+1 − 𝑢𝑖−1 ⇒ = −𝑎 . 2Δ𝑥 ∂𝑡 2Δ𝑥 This methodology is applied to solve the NSE for example by Gerrits [43], Kleefsman [72, 73] and Veldman et al. [153]. (𝑢𝑖 )𝑥 =
6Poisson Equation: Δ𝑝 = (∂ 2 /∂𝑥2 + ∂ 2 /∂𝑦 2 + ∂ 2 /∂𝑧 2 )𝑝 = −𝑉 ⃗ ⋅ ∇𝑉 ⃗
5. ALTERNATIVE SOLUTION METHODS
17
∙ Finite Element Methods (FEM). A more global approach is taken in this case. The idea is to find a finite function which approximates the solution of the NSE. The first step is to rewrite the NSE in a variational form. Consider Ω the computational domain, and ∂Ω its boundary, 𝐻01 (Ω) is called Sobolev space7 and is the space of smooth functions which verify ⃗ , 𝑝 ∈ 𝐻 1 (Ω) such that [125], the boundary conditions. The idea is to find a function 𝑉 0 ∫
(57)
(58)
∫
Ω
Ω
⃗ )𝑑Ω = 0, ∀𝑞 ∈ 𝐻 1 (Ω) : 𝑞(∇ ⋅ 𝑉
⃗ ∂𝑉 ⃗ ⋅ ∇𝑉 ⃗ v𝑑Ω v + 𝑉 ∂𝑡
=
∫
Ω
∫
𝑞𝑑Ω = 0. Ω
⃗ ⋅ ∇v + 𝒮𝑒 ⋅ v, ∀𝑣 −𝑝∇ ⋅ v + 𝜇∇𝑉
∈
𝐻01 (Ω).
Example 1.4. Consider the differential equation (59)
(60)
∂2𝑢 (𝑥, 𝑡) = 𝑓 (𝑥), 𝑥 ∈ [0, 1] 𝑢(0) = 𝑢(1) = 0. ∂𝑥2 The variational equation will be, ∫
[0,1]
∂2𝑢 (𝑥)𝑣(𝑥)𝑑𝑥 = ∂𝑥2
∫
[0,1]
𝑓 (𝑥)𝑣(𝑥)𝑑𝑥, ∀𝑣 ∈ 𝐻01 ([0, 1]),
integrating by parts and using the boundary conditions, it is obtained: (61)
∫
[0,1]
∂𝑢 ∂𝑣 (𝑥) (𝑥)𝑑𝑥 = ∂𝑥 ∂𝑥
∫
[0,1]
𝑓 (𝑥)𝑣(𝑥)𝑑𝑥, ∀𝑣 ∈ 𝐻01 ([0, 1]).
The discretization consists of changing the scope space 𝐻01 (Ω) by a finite subset 𝑉0 ∈ 𝐻01 (Ω) which have a basis {𝜙𝑖 : 𝑖 = 1, 2, . . . , 𝑁 } of local function with compact support8 on Ω. So every function u ∈ 𝑉0 can be written as, (62)
u=
𝑁 ∑
𝛼𝑖 𝜙 𝑖 .
𝑖=1
The Spectral Element Methods (SEM) can be considered a particular case of the FEM. In this case, instead of local compact support functions, piecewise polynomial functions are considered. Details about FEM and SEM can be found in [122]. These kind of methods have been applied for example by Parolini and Quarteroni [113], ˘ L¨ohner et al. [85, 86, 91] and Sidlof applied FEM in [141]. ∙ Finite Volume Methods (FVM). The computational domain is divided into a set of volumes which do not overlap each other called control volumes. The equations are integrated over these control volumes where the fluxes are balanced at the interface between them. The conservation properties are easily maintained both global and locally. “FVM is often seen as the most natural method for treating fluid dynamics problem” [125]. Example 1.5. Consider the hyperbolic advection equation in 1-D, 7Sobolev Space: 𝐻 1 (Ω) = {𝑓 ∈ 𝐿2 (Ω) : ∣∣𝑓 ∣∣ < ∞}. 2
𝐻01 (Ω) = {𝑓 ∈ 𝐻 1 (Ω) : 𝑓 ∣∂Ω = 0}, i.e., verifies the boundary conditions. 8Compact support function in Ω is a function with zero value everywhere in Ω but in a compact subset of Ω, Ω . 0
18
(63)
(64)
(65)
1. INTRODUCTION
∂𝑢 ∂𝑢 +𝑎 = 0, ∂𝑡 ∂𝑥 over a grid {𝑥𝑖 : 𝑖 = 0, 1, . . . , 𝑁 }. The 1-D control volumes are {Ω𝑖 }𝑖=1,2,...,𝑁 = {[𝑥𝑖−1 , 𝑥𝑖 ]}𝑖=1,2,...,𝑁 . The equations are integrated over the control volumes, ∫
∫
∂𝑢 𝑢(𝑥, 𝑡)𝑑𝑥 = 0. Ω𝑖 ∂𝑥 Ω𝑖 ∫ After integration and defining 𝑢 ¯𝑖 = (1/Ω𝑖 ) Ω𝑖 𝑢(𝑥, 𝑡)𝑑𝑥 the discretized equation results: ∂𝑢 𝑢(𝑥, 𝑡)𝑑𝑥 + 𝑎 ∂𝑡
∂𝑢 ¯𝑖 + 𝑎 [𝑢(𝑥𝑖 , 𝑡) − 𝑢(𝑥𝑖+1 , 𝑡) = 0.] ∂𝑡 The Godunov method, which can be considered a particular case of FVM, is applied in this study, and it is described in Chapter 3.
CFX ANSYS [2], Fluent [4] are the most common commercial software applied in CFD problems, and all of them are computed using FVM. While MIKE by DHI [5] use three different methods (FDM, FEM, FVM) in the different products they have. 5.4. Temporal discretization. Temporal discretization is required in problems involving time evolution, where the equation can be written as,
(66)
∂𝑦 = 𝑓 (𝑥, 𝑦(𝑥)), ∂𝑡
𝑓 being a function involving or not partial derivatives of time. The different methods can be divided into two main categories, Explicit methods (the information at time 𝑡 = 𝑡𝑛 is used to compute time 𝑡 = 𝑡𝑛+1 ) and Implicit methods (the calculation of time 𝑡 = 𝑡𝑛+1 is done based on the same time). Example 1.6. Let’s consider the hyperbolic advection equation in 1-D,
(67)
∂𝑢 ∂𝑢 +𝑎 = 0. ∂𝑡 ∂𝑥
An Explicit first order in time method can be written as:
(68)
𝑢𝑛 − 𝑢𝑛𝑖−1 − 𝑢𝑛𝑖 𝑢𝑛+1 𝑖 = 𝑎 𝑖+1 . Δ𝑡 2Δ𝑥
A corresponding Implicit first order in time method can be written as:
(69)
𝑢𝑛+1 − 𝑢𝑛+1 𝑢𝑛+1 − 𝑢𝑛𝑖 𝑖−1 𝑖 = 𝑎 𝑖+1 . Δ𝑡 2Δ𝑥
There are some properties which measure the method. Definition 1.7. Definitions and properties of numerical methods [106]: Lets denote by ℒ the operator corresponding the differential equation, so it can be written as ℒ𝑢 = 0. The discrete operator is denoted by 𝐿Δ𝑡 , so the discrete equation can be written as 𝐿Δ𝑡 𝑢 = 0.
5. ALTERNATIVE SOLUTION METHODS
19
∙ Consistency. Defines the relation between the differential equation and the discrete scheme. A scheme is said to be consistent if (70)
𝐿Δ𝑡 𝑢 → ℒ𝑢, when Δ𝑡, Δ𝑥 → 0.
∙ Stability. Defines the relation between the computed solution and the exact solution of the discrete equations. Given an initial solution 𝑈0 the repetition of an action 𝐶 produces the approximation at time 𝑡 = 𝑡𝑛 to be the repetition of 𝐶 𝑛-times over the initial condition 𝑈0 , i.e., 𝑈 𝑛 = 𝐶 𝑛 𝑈0 . A scheme is said to be stable when the operator 𝐶 is bounded. Consider 𝐾 constant ∣∣𝐶 𝑛 ∣∣ < 𝐾 for all 𝑛 ∈ ℕ ⇔ ∣∣𝐶∣∣ < 1.
(71)
∙ Convergence. Defines the relation between the differential equation and the numerical method. A numerical method is said to be convergent if the numerical solution 𝑈Δ𝑡,Δ𝑥 approaches the exact solution 𝑢 as the step size Δ𝑡 goes to 0, (72) 𝑛
𝑈Δ𝑡,Δ𝑥 → 𝑢, when Δ𝑡, Δ𝑥 → 0.
∙ Local error 𝜖 . Defines the error produced by the numerical method at time step 𝑡 = 𝑡𝑛 , 𝑈 𝑛 assuming the previous steps were computed without error compared with the exact solution at time 𝑡 = 𝑡𝑛 , 𝑢(𝑥, 𝑡𝑛 ), (73)
𝜖𝑛 = ∣∣𝑈 𝑛 − 𝑢(𝑥, 𝑡𝑛 )∣∣.
∙ Order: The method has order p if (74)
𝜖𝑛 = 𝑂(ℎ𝑝 ) : ℎ → 0
∙ Consistency is a necessary condition for convergence, but not sufficient. A general method which involves the most commonly used methods are called Runge-Kutta (R-K) for equation (66) can be written as [96],
(75)
𝑘𝑖 = 𝑓 (𝑥𝑛 + 𝑐𝑖 Δ𝑡, 𝑦 𝑛 + Δ𝑡
𝑠 ∑
𝑎𝑖𝑗 𝑘𝑗 ) , 𝑖 = 1 . . . , 𝑠,
𝑗=1
(76)
𝑦 𝑛+1 = 𝑦 𝑛 + Δ𝑡
𝑠 ∑
𝑏𝑗 𝑘 𝑗 ,
𝑗=1
where 𝑏 = {𝑏𝑗 }𝑠𝑗=1 , 𝑐 = {𝑐𝑗 }𝑠𝑗=1 ∈ ℝ𝑠 and 𝒜 = {𝑎𝑖𝑗 }𝑠𝑖,𝑗=1 ∈ ℝ𝑠×𝑠 . 𝑘𝑖 are called stages and 𝑠 is the number of stages of a method. When 𝑎𝑖𝑗 = 0 for 𝑖 ≤ 𝑗 the method is called explicit, if 𝑎𝑖𝑗 = 0 is only verified for 𝑖 < 𝑗 the method is called semi-implicit and otherwise implicit [96]. Theorem 1.8. Existence, consistency, stability and order [96]. ∙ Lets consider 𝑓 Lipschitz9 with constant 𝐿 and ℎ∗ 𝐿∣∣𝒜∣∣∞ < 1. Then the R-K given by equations (75,76) has unique solution for all ℎ ∈ (0, ℎ∗ ]. ∙ A R-K given by equations (75,76) is consistent if and only if 𝑏1 + . . . + 𝑏𝑠 = 1 9f(x) is a Lipschitz function in Ω if there exist a constant 𝐿 such that: ∣∣𝑓 (𝑥 )−𝑓 (𝑥 )∣∣ < 𝐿∣∣𝑥 −𝑥 ∣∣ for all 𝑥 , 𝑥 ∈ Ω. 1 2 1 2 1 2
20
1. INTRODUCTION
∙ Lets consider ℎ∗ 𝐿∣∣𝒜∣∣∞ < 1, then the R-K given by equations (75,76) is stable for all ℎ ∈ (0, ℎ∗ ]. ∙ A R-K method given by equations (75,76) of 𝑠 stages can achieve a maximum order of 𝑠. The most common R-K methods used are: ∙ Explicit first order, also called forward Euler, is a first order one stage method with 𝑐1 = 0, 𝑎1,1 = 0 and 𝑏1 = 1. ∙ Explicit Euler modified is a second order two stage method with 𝑏1 = 𝑐1 = 𝑎1,1 = 𝑎1,2 = 0, and 𝑎2,1 = 1/2, 𝑎2,2 = 0., 𝑏2 = 1, 𝑐2 = 1.2. ∙ Explicit Euler improved is a second order two stage method with 𝑏1 = 1/2, 𝑐1 = 𝑎1,1 = 𝑎1,2 = 0, and 𝑎2,1 = 1, 𝑎2,2 = 0, 𝑏2 = 1/2, 𝑐2 = 0. ∙ Explicit Heun’s method is a second order two stage method with 𝑏1 = 1/4, 𝑐1 = 𝑎1,1 = 𝑎1,2 = 0, and 𝑎2,1 = 2/3, 𝑎2,2 = 0., 𝑏2 = 3/4, 𝑐2 = 2/3. ∙ Implicit first order, also called backward Euler, is a first order one stage method with 𝑐1 = 1, 𝑎1,1 = 1 and 𝑏1 = 1. ∙ Explicit fourth order method and the most popular therefore called R-K “without surnames” is a fourth order four stages method with the following non-zero values of 𝒜, 𝑏, 𝑐: 𝑐2 = 1/2, 𝑐3 = 1/2, 𝑐4 = 1, 𝑎21 = 1/2, 𝑎32 = 1/2, 𝑎43 = 1, 𝑏1 = 1/6, 𝑏2 = 2/6, 𝑏3 = 2/6 and 𝑏4 = 1/6. 5.5. Lattice Methods. Instead of studding what happens in a grid covering the domain, a Lattice is defined in the domain. Particles (with no mass) are located at the vertex of the Lattice and move through it. The original method was the Lattice Gas Automata (LGA) in the late 1980’s. The Lattice Boltmann Method (LBM) [55] is used to simulate flow building a simplified kinetic mesoscopic (the scale is big enough to not consider the behaviour of individual atoms) model incorporating the physics of the macroscopic (scale bigger than 1mm) averaged properties of the NSE [10]. This method is gaining popularity because it is very flexible to describe complicated boundaries and interactions among different fluids (free surface problems). A detailed description of this method can be found in [10, 74, 144, 154]
(a) Rectangular Lattice in the domain.
(b) Possibilities of movement for a particle in a rectangular Lattice (D2Q9).
Figure 1.12. Lattice Boltzmann Method. The classic form of a LBM is to solve a equation, (77)
𝐷𝑓 = 𝐽(𝑓 ),
5. ALTERNATIVE SOLUTION METHODS
21
⃗ ) is a particle density function depending on time 𝑡, position x and velocity at that where 𝑓 (𝑡; x; 𝑉 ⃗ (𝑡; x). This method comprises two steps, one is the transport step (left hand position and time 𝑉 side, LHS) and the other is the collision step (right hand side, RHS). The collision operator 𝐽 can have different forms, depending on the considered approximation. Using the Bhatnagar-Gross-Krook (LBM-BGK) [50] it has the form,
(78)
1 𝐽(𝑓 ) = − (𝑓 − 𝑓 𝑒𝑞 ), 𝜏
where 𝜏 is a relaxation parameter related with the viscosity, and 𝑓 𝑒𝑞 is the equilibrium particle density. In the LBM particles move from one vertex of the Lattice to the next one, which is a problem when the vertex of the Lattice changes position, as in the case of free surface problems. LBM also introduce some numerical instabilities in the truncation of the equilibrium density [92]. 5.6. Meshless Methods. The meshless methods, and in particular the Smoothed Particle Hydrodynamics (SPH), are gaining importance in the last years because of their flexibility to describe flow around complicated domains, free surfaces and even fragmentation in damaged solids [102]. In fact, in the Conference in Computational Methods in Marine Engineering held in Barcelona in 2007, there was a whole section, Meshless Methods in Marine Engineering, devoted to their applications such as, fluid structure interactions [26, 49], breaking waves [33] and single phase free surface flows. The treatment of the free surface does not require a specific condition, as it is defined with the particles positions [143]. SPH has been applied by the company NextLimit to simulate several flow situations among then, the lava in The Lord of the Rings winning an Oscar prize [7].
Figure 1.13. Scheme of the particles in the domain. The idea is to cover the domain with particles (see Figure 1.13) and follow the movement of the particles (Lagrangian method) simulating the flow via functions which determine the interaction between particles. SPH was introduced by Gingold and Monaghan in 1977 using a kernel estimation technique based on statistical ideas, in fact, it was initially presented as a Monte Carlo type method10 [45]. Any function 𝑓 of the positions r ∈ Ω, can be approximated by, 10Monte Carlo methods are a collection of techniques used to obtain solutions to mathematical and/or physical
problems using random numbers and probability statistics.
22
(79)
1. INTRODUCTION
⟨𝑓 (r)⟩ =
∫
Ω
𝑓 (r′ )𝑊 (∣r − r′ ∣, ℎ)𝑑r′ ,
where Ω is the whole computational domain, 𝑊 is the kernel function depending on the distance between particles and ℎ is a distance called the smoothing length [143]. “The kernels are functions which tend to the delta function as the length scale h tends to zero . . . The most commonly used kernels are based on Schoenberg 𝑀𝑛 splines which are piece-wise continuous functions with compact support having the derivatives up to (n-2) continuous” [102]. Consider 𝑁 the number of particles {𝑖 : 𝑖 = 1, 2, . . . , 𝑁 } in the domain, this equation can be discretized as [102, 143],
(80)
⟨𝑓 (r𝑖 )⟩ =
𝑁 ∑ 𝑗=1
𝑓 (r𝑗 )𝑊 (∣r𝑖 − r𝑗 ∣, ℎ)Ω𝑗 ,
Ω𝑗 being the volume associated to particle 𝑗 and r𝑗 its position. These techniques are used to write “SPH-versions of the NSE” to simulate flow problems. The spatial derivatives of function 𝑓 can be written as function of the derivatives of the kernel which has the information about the spatial approximations. For a generic particle 𝑖 the conservation of mass equation looks like [143], 𝑁
(81)
∑ ∂𝜌𝑖 ⃗𝑖 − 𝑉 ⃗𝑗 )∇𝑊 (∣r𝑖 − r𝑗 ∣, ℎ), 𝑚𝑗 ( 𝑉 = ∂𝑡 𝑗=1
⃗ ) and 𝑉 ⃗𝑗 denotes the velocity of particle 𝑗 and the where 𝑚𝑗 is the mass of particle 𝑗 (𝑚 = 𝜌𝑉 conservation of momentum holds,
(82)
𝑁 ∑ ⃗𝑖 ∂𝑉 𝑚𝑗 =− ∂𝑡 𝑗=1
(
𝑃𝑖 𝑃𝑗 + 2 + Π𝑖,𝑗 𝜌2𝑖 𝜌𝑗
)
∇𝑊 (∣r𝑖 − r𝑗 ∣, ℎ) + 𝑔,
𝑃𝑗 being the pressure in particle 𝑗. Different viscous terms Π𝑖𝑗 can be considered, for example in [143] this term has the following form,
(83)
Π𝑖,𝑗 = −𝛼
⃗𝑖 − 𝑉 ⃗𝑗 )(r𝑖 − r𝑗 ) ℎ(𝑉 𝑐𝑠 𝜇𝑖,𝑗 and 𝜇𝑖𝑗 = 𝜌¯𝑖,𝑗 (r𝑖 − r𝑗 )2 + 𝜈 2
𝜌¯𝑖𝑗 being the averaged density of particles 𝑖 and 𝑗, 𝑐𝑠 the numerical sound speed, 𝛼 the viscosity parameter and 𝜈 a relaxation parameter to avoid singularities when (r𝑖 − r𝑗 ) → 0 [143]. The SPH method was introduced for self-gravity gases and it is being adapted to gravity flows, therefore SPH still needs investigation in the treatment of the free surfaces, solid boundaries and to model the effects of viscosity [143].
6. OUTLINE OF THE THESIS
23
6. Outline of the Thesis In this introductory Chapter the motivation of this dissertation has been explained and a brief description of the techniques used in this study has been given. Also a revision of alternative gridding methods (Section 2), equations to be used (Section 3), the NSE (Section 4) and solution methods (Section 5) has been introduced. Chapter 2 contains a detailed description of the CCCM used at the CMMFA. The method involves a merging cells technique to avoid very small cell numerical stability errors unless an unrealistically small time step is considered. The CCCR used in this work are described in this Chapter. In Chapter 3 the methodology used to solve the NSE are explained. The ACM and Godunov-type methods are described together with the importance of the RP and different solvers for it. Once the grid and the solver for the equation are described, the movement of the free surface is explained in Chapter 4. A detailed description of the methods used in the bibliography is given. The Height Function Method applied in this study and the fourth order R-K applied for its integration are given. The numerical experiments are divided into two groups. Chapter 5 contains experiments without free surface, as the lid-driven Couette flow, the lid-driven Cavity flow, and flow in a pipe with and without obstacle. Numerical experiments involving the movement of the free surface are tested in Chapter 6, like the small amplitude sloshing tank, the mass-wave maker, the semi-dam break and the current passing different obstacles (bump (CFPOB) and body(CFPCBF)). The idea suggested in this dissertation to approximate ship generated waves is also shown in the last experiment of this Chapter, current flow passing a cylinder at the free surface (CFPCFS). The conclusions obtained from this research and ideas for future works are highlighted in Chapter 7.
CHAPTER 2
Cartesian Cut Cell Method 1. Introduction The Cartesian Cut Cell Method (CCCM) is applied to define the computational domain where the equations should be solved. The basic idea of this method is to cover the initial domain with a Cartesian grid. Over this initial grid solid bodies are placed. The initial grid is adapted to the solid body by cuts over its cells. When the solid body moves, only the affected cells need to be re-cut, avoiding to recompute again the whole grid. The method used is explained in detail in [24, 25, 63, 126, 162] for the 2-D version and in [161] for the 3-D version. The CCCM has been used at the CMMFD to define the grid around obstacles (static or moving at a predefined velocity) in the flow, and this is the first time the method is used to define the grid around the free surface. The movement of the free surface is unknown a priori and the boundary conditions are different that in the case of solid obstacles. The cuts over the background Cartesian grid produces three different kind of cells: cells full of fluid flagged as “flow cells”, cells with no fluid flagged as “solid cells”, and cells partially full of fluid flagged as “cut cells” as it is illustrated in Figure 2.1.
a
b
c
Figure 2.1. Flags: (a) Flow cell, (b) Cut cell and (c) Solid cell. The CCCM provide information about the cut in each cell such as the start and end points of the cut, the slope of the cut and the normal vector multiplied by the length of the cut. So only cuts produced by a single line within a cell can be described using the CCCM. Cuts within one cell produced by more than one line, like corners see Figure 2.2, are not described with this method and need to be approximated, reducing the cut to one line. The information about the properties of the fluid (velocities and pressure) is stored at cell centre therefore the centroid of each cell is also given by the CCCM. When the solid moves only the cells around the solid have to be recomputed and this may produce the change of flags (flow, cut or solid) in some cells. These changes of flag can generate problems of 25
26
2. CARTESIAN CUT CELL METHOD
a
b
Figure 2.2. (a) Simple cut given by the CCCM. (b) Corner cut which can not be described by the CCCM.
creation of mass (cell that was solid becoming cut or flow) or destruction of mass (cell that was flow or cut becoming solid). To avoid these problems a merging cells technique is applied, where small cells are merged with the neighbouring cell with largest common interface. So a flow cell becoming solid cell has become first cut cell (no merged), then cut cell (merged with a flow cell) and finally solid cell as in Figure 2.3. The treatment of the mass and momentum due merging cells will be explained in Section 6.
A
B
(a) Cell B is a flow cell.
A=B
(c) Cut cell B is merged with flow cell A.
A
B
(b) Cell B is an independent cut cell.
A
B
(d) Cell B is a solid cell.
Figure 2.3. Intermediate steps of a flow cell becoming solid cell due the movement of the solid body.
In this thesis the CCCM is applied to describe the domain around solid bodies as it has been used before, for example in [117, 118, 119]. The CCCM is also applied to define the flow domain, i.e. locate the free surface. In this case the “air” (no interest in the computation) is considered as a solid body limited by the free surface and the limits of the domain. In Figure 2.4 and scheme of the domain is illustrated where the flow part (water) is below the free surface while the air part is considered a solid body located above the free surface.The computational domain is cut around this “solid” using the CCCM. The free surface is moving using the kinematic equation and the velocities at the free surface which will be explained in Chapter 4.
2. CUTTING THE GRID AROUND THE SOLID
27
SOLID(air)
FLOW(water)
Figure 2.4. The computational domain is the FLOW part (water) while the Air part is of no interest in this study and is all the part above the free surface. Approximation of the cuts avoiding corners in cut cells is shown as well as merged cells. 2. Cutting the Grid Around the Solid Lets consider the initial Cartesian grid 𝜒0 with initial point at bottom left being point (𝑥0 , 𝑦0 ), the number of rectangular cells in each direction, 𝑁 , 𝑀 and the distance between points, Δ𝑥 and Δ𝑦 it is written as,
(84)
𝜒0 = {(𝑥𝑖 , 𝑦𝑗 ) : 𝑥𝑖 = 𝑥0 + 𝑖Δ𝑥, 𝑖 = 0, 1, . . . , 𝑁
𝑦𝑗 = 𝑦0 + 𝑗Δ𝑦, 𝑗 = 0, 1, . . . , 𝑀 }
Notation 2.1. A cell is denoted by (𝑖, 𝑗) when its vertices are (𝑥𝑖 , 𝑦𝑗 ), (𝑥𝑖+1 , 𝑦𝑗 ), (𝑥𝑖+1 , 𝑦𝑗+1 ), (𝑥𝑖 , 𝑦𝑗+1 ) and with interfaces: ∙ ∙ ∙ ∙
Left with cell (𝑖 − 1, 𝑗): 𝐼𝑖 = {(𝑥𝑖 , 𝑦) : 𝑦𝑗 < 𝑦 < 𝑦𝑗+1 }. Bottom with cell (𝑖, 𝑗 − 1): 𝐼𝑗 = {(𝑥, 𝑦𝑗 ) : 𝑥𝑖 < 𝑥 < 𝑥𝑖+1 }. Right with cell (𝑖 + 1, 𝑗): 𝐼𝑖+1 = {(𝑥𝑖+1 , 𝑦) : 𝑦𝑗 < 𝑦 < 𝑦𝑗+1 }. Top with cell (𝑖, 𝑗 + 1): 𝐼𝑗+1 = {(𝑥, 𝑦𝑗+1 ) : 𝑥𝑖 < 𝑥 < 𝑥𝑖+1 }.
The neighbours of cell (𝑖, 𝑗) are called during this dissertation: left (𝑖 − 1, 𝑗), bottom (𝑖, 𝑗 − 1), right (𝑖 + 1, 𝑗) and top (𝑖, 𝑗 + 1). A solid body can be described as a polygon Γ, considered as a set of lines, Γ = {𝑃𝑘 }𝑞𝑘=1 . The intersections between solid (set of lines Γ) and the cell interfaces of 𝜒0 are required. The methodology applied is simple, let’s consider a line 𝑘 ∗ of Γ such that 𝑃𝑘∗ has a start point (𝑥𝑠 , 𝑦𝑠 ), and a final point (𝑥𝑒 , 𝑦𝑒 ). The slope 𝑄 can be easily found using,
(85)
𝑄=
𝑦𝑒 − 𝑦𝑠 , 𝑥𝑒 − 𝑥𝑠
the cell containing the initial point (𝐼𝑠 , 𝐽𝑠 ) can be found using,
(86)
𝐼𝑠 =
⌊
⌋ 𝑥𝑠 − 𝑥0 +1 Δ𝑥
and
𝐽𝑠 =
⌊
⌋ 𝑦𝑠 − 𝑦0 + 1, Δ𝑦
28
2. CARTESIAN CUT CELL METHOD
Top (i,j+1)
I j+1 yj+1
(i,j)
Ii
Left (i−1,j)
I i+1
(i,j)
Right (i+1,j)
Bottom (i,j−1)
yj
Ij xi
x i+1
(a) Cell (𝑖, 𝑗), with its vertex and interfaces.
(b) Neighbours of cell (𝑖, 𝑗).
Figure 2.5. Notation used with respect to cell (𝑖, 𝑗). where ⌊ ⌋ denotes the floor function1. Final points can be found in a similar way. The slope 𝑄 belongs to one of the four quadrants (0𝑜 , 90𝑜 ], (90𝑜 , 180𝑜 ], (180𝑜 , 270𝑜 ] or (270𝑜 , 360𝑜 ]. Let’s use Figure 2.6 to illustrate the procedure to find the intermediate intersection points. In Figure 2.6 𝑄 ∈ (0𝑜 , 90𝑜 ]. Let’s suppose that it is known the intersection at the point 𝑎 = (𝑥𝑎 , 𝑦𝑗 ). Following the slope 𝑄 the next two points are found, 𝑏 = (𝑥𝑖+1 , 𝑦𝑏 ) and 𝑐 = (𝑥𝑐 , 𝑦𝑗+1 ). To identify which of these two points is the next intersection a simple comparison is required. If 𝑥𝑐 > 𝑥𝑖+1 (as it is in this case), 𝑏 is the next intersection point, otherwise 𝑐 is the next intersection point. This procedure is repeated until all the crossing points between 𝜒0 with Γ are found and repeated until all 𝑃𝑘 in Γ are found. The treatment given to each cell depends on the flag of the cell, flow, cut or solid. Once all cells are flagged, the new grid 𝜒1 will be the flow cells and the “flow part” of the cut cells. The cut cells are of great interest as the free surface and the boundaries are their edges. A first classification of the cut cells is done using the slope 𝑄,
(87)
⎧ 1 ⎨ 2 𝑆𝑙𝑜𝑝𝑒(𝑖, 𝑗) = 3 ⎩ 4
if if if if
𝑄 ∈ (0𝑜 , 90𝑜 ] 𝑄 ∈ (90𝑜 , 180𝑜 ] 𝑄 ∈ (180𝑜 , 270𝑜 ] 𝑄 ∈ (270𝑜 , 360𝑜 ]
For each of the four possibles slopes there are also four different types of cuts depending on number of vertex and the position of the exit point, because it gives the number of flow neighbours of the cell. ∙ Slope of the cell is 1, see Figure 2.7. – Type 1 with 3 vertex and neighbours Bottom and Right. – Type 2 with 4 vertex, exit at the left side so its neighbours are Left, Bottom and Right. – Type 3 with 5 vertex and neighbours Left, Bottom, Right and Top. 1Floor function is the greatest integer smaller than the value, i.e., ⌊𝑥⌋ = max{𝑛 ∈ ℤ such that 𝑛 ≤ 𝑥}
2. CUTTING THE GRID AROUND THE SOLID
29
c
j+1
b
j
a
j−1 i−1
i
i+1
Figure 2.6. Computing the intersection points with the grid. 𝑏 = (𝑥𝑖+1 , 𝑦𝑏 ) and 𝑐 = (𝑥𝑐 , 𝑦𝑗+1 )
𝑎 = (𝑥𝑎 , 𝑦𝑗 ),
– Type 4 with 4 vertex, exit at the top side so its neighbours Bottom, Right and Top.
(a) Type 1.
(b) Type 2.
(c) Type 3.
(d) Type 4.
Figure 2.7. Cell types for 𝑆𝑙𝑜𝑝𝑒(𝑖, 𝑗) = 1, where coloured part is solid. ∙ Slope of the cell is 2, see Figure 2.8. – Type 1 with 3 vertex and neighbours Right and Top. – Type 2 with 4 vertex, exit at the bottom side so neighbours are Bottom, Right and Top. – Type 3 with 5 vertex and neighbours Left, Bottom, Right and Top. – Type 4 with 4 vertex, exit at the left side so and neighbours are Left, Right and Top.
(a) Type 1.
(b) Type 2.
(c) Type 3.
(d) Type 4.
Figure 2.8. Cell types for 𝑆𝑙𝑜𝑝𝑒(𝑖, 𝑗) = 2, where coloured part is solid.
30
2. CARTESIAN CUT CELL METHOD
∙ Slope of the – Type 1 – Type 2 – Type 3 – Type 4
cell is 3, see Figure 2.9. with 3 vertex and neighbours Left and Top. with 4 vertex, exit at the top side so neighbours are Left, Bottom and Top. with 5 vertex and neighbours Left, Bottom, Right and Top. with 4 vertex, exit at the left side so neighbours are Left, Right and Top.
(a) Type 1.
(b) Type 2.
(c) Type 3.
(d) Type 4.
Figure 2.9. Cell types for 𝑆𝑙𝑜𝑝𝑒(𝑖, 𝑗) = 3, where coloured part is solid. ∙ Slope of the cell is 4, see Figure 2.10. – Type 1 with 3 vertex and neighbours Left and Bottom. – Type 2 with 4 vertex, exit at the left side so and neighbours are Left, Bottom and Right. – Type 3 with 5 vertex and neighbours Left, Bottom, Right and Top. – Type 4 with 4 vertex, exit at the bottom side so neighbours are Left, Bottom and Top.
(a) Type 1.
(b) Type 2.
(c) Type 3.
(d) Type 4.
Figure 2.10. Cell types for 𝑆𝑙𝑜𝑝𝑒(𝑖, 𝑗) = 4, where coloured part is solid.
3. Cells Merging The result of cutting cells from the initial domain close to the body can produce very small cells. These small cells can produce numerical stability errors unless an unrealistically small time step is considered. A technique to merge these cells with surroundings cells [24, 25, 63, 162] is applied. This technique can be easily adapted to moving boundaries/interfaces [163]. The basic idea is to avoid the small cells combining them with surroundings cell and be able to use bigger global time steps, see Figure 2.11. A decision has to be taken: ∙ when shall a cell be merged? ∙ which cell shall it be merged with? The procedure to merge two consecutive cells is as follows: (1) Define a minimum value for the area of the cell to be merged 𝐴𝑚𝑖𝑛 . In this work 𝐴𝑚𝑖𝑛 is defined to be half the value of the area of a Flow cell, i.e.,
3. CELLS MERGING
B
31
1111 0000 0000 1111 0000 1111 0000 1111 0000 1111 0000 1111 0000 1111 0000 1111 0000 1111
A
C
Figure 2.11. Area of cut cell 𝐴 is smaller than 𝐴𝑚𝑖𝑛 and is merged with surrounding cell 𝐵 forming super-cell 𝐶.
(88)
Δ𝑥Δ𝑦 . 2 (2) If the area of the cut cell is smaller than 𝐴𝑚𝑖𝑛 , check whether the cell has been already merged. If it is not, go to step 3. Otherwise, go to step 4. (3) Obtain the value of the Slope according to formula (87). Find the surrounding flow or cut cell with the largest common interface with the cut cell. This surrounding cell will be the cell to merge the cut cell with, included both cells in a “merged cells list” and go to step 4. (4) Check next cut cell, and repeat 2 and 3 until all cut cells have been considered. 𝐴𝑚𝑖𝑛 =
Consider the example of cell 𝐴 from Figure 2.12, 𝑄 ∈ (90𝑜 , 180𝑜 ]. The two surroundings flow cells are at the right and top. Amounts those two options the cut cell will be merged with the one that has the bigger percentage of common flow interface. In the situation of Figure 2.12 this is cell 𝐶, by an analogous approach, cell 𝐵 will be merged with cell 𝐷.
D 1 0 0 1 0 1 0 1
B
A
11 00 00 11 00 11
C
Figure 2.12. Merge small flow cells.
32
2. CARTESIAN CUT CELL METHOD
In the previous scheme, step 3 gives information about which cell should be used to merge the cut cell. This convention is used in the case of cell being cut by the solid body. In the case of free surface, it is possible to find a situation where more than one cell will be merged with a common cell, as it is illustrated in Figure 2.13. Using the above convention, cell 𝐶 will be merged with cells 𝐵 or 𝐷 and cell 𝐸 with cells 𝐷 or 𝐹 , and at the same time cells 𝐵, 𝐷 and 𝐹 will be merged with cell 𝐴. The result of merging will be a huge super-cell containing cells 𝐴, 𝐵, 𝐶, 𝐷, 𝐸 and 𝐹 . To avoid such problems when merging, a convention is used in this study when the cut is produced by the free surface (interface water/air). The cell used to merge the cut cell will be always the cell below. This is easy to understand as the cut from the free surface will be in the upper part of cells and also because the gravity force will push the mass of the cell down.
E
F
D
A
C
B
Figure 2.13. Super-cell containing cells 𝐴, 𝐵, 𝐶, 𝐷, 𝐸 and 𝐹 when merging at the free surface. 3.1. Moving bodies/free surface. The situation with moving boundaries/free surface is the “change of label” in cells. The cells are going to change from flow cell to cut cell, from cut cell to solid cell, from solid cell to cut cell or from cut cell to solid cell. The change between solid and fluid always goes from a intermediate step involving a Cut cell. To avoid conservation problems a cut cell becoming solid has to have been merged with a flow cell before, otherwise some mass would disappear. The contribution from the cut cell becoming solid is transferred to the “super-cell” formed by both merged cells (cut and flow) maintaining the conservation of mass and momentum [163]. This gives a restriction on the time step Δ𝑡 to consider depending on the speed on the solid velocity. The time step has to be small enough to avoid flow cells becoming merged cells without being cut cells first. Two different situations are considered: ∙ “Merging independent cells”. At time 𝑡𝑛 cell 𝐴 is a cut cell, at time 𝑡𝑛+1 the solid body has “moved in” and the area of cut cell 𝐴 is reduced. If area of cell 𝐴 is smaller than a predefined area 𝐴𝑚𝑖𝑛 , cell 𝐴 is merged with neighbouring cell 𝐵 to form together super-cell 𝐶 like in previous section. Super-cell 𝐶 is considered a normal cut cell with the mass and momentum contribution of merged cells 𝐴 and 𝐵 (see Section 6). ∙ “Separation of merged cells”. At time 𝑡𝑛 cell 𝐴 is merged with cell 𝐵 in super-cell 𝐶, at time 𝑡𝑛+1 the solid body has “moved out” and the area of cut cell 𝐴 is increased. If area of 𝐴 is now larger than 𝐴𝑚𝑖𝑛 , super-cell 𝐶 is split into cells 𝐴 and 𝐵. In Section 6 is explained the way to split the contribution of cell 𝐶 into 𝐴 and 𝐵.
4. INTERSECTING SOLID AND FREE SURFACE
33
Yang et al. in [163] gives an algorithm to use a CCCM in moving boundary problems: (1) Determine the time step Δ𝑡 with the above restrictions (a cell not becoming merged from flow). (2) Find the new position of the moving body over the time step Δ𝑡. (Call the CCCR). (3) Update the labels (flow, cut or solid) of the cells near the moving body. This will include to update the flow/cut/solid cells lists, and the merged cells list. Update the centroids of the cells, normal vectors,. . . (4) Update the cut cells or merged cell groups as for normal flow cells. 4. Intersecting Solid and Free Surface The aim of this work is to introduce the study of ship waves using CCCM. In ship waves the solid body and the free surface cut each other so a new kind of cells arise, where the same cell is cut by both, the solid body and the free surface. A new approach has to be considered for these kind of cells. In this research the CCCM is used to describe the computational domain around solid obstacles and behind the free surface (interface water/air). Three different kinds of cut cells are obtained, some cut cells come from cuts around the solid body, some other cut cells from cuts of the free surface and finally some cut cells contains both kinds of cuts. The boundary conditions in cut cells depends on whether they are cut by the solid body or by the free surface. The same cell is cut by the solid obstacle and by the free surface. The CCCM can not deal with this kind of situation at the same time. The proposed solution is to call twice the CCCM, first for the solid obstacle, and the information of this cut is stored in variables with the sub-index ⋅𝑠 (for example 𝑆𝑙𝑜𝑝𝑒𝑠 ). Then the CCCM is called again to cut the free surface and the information stored in variables with sub-index ⋅𝑓 𝑠 (for example 𝑆𝑙𝑜𝑝𝑒𝑓 𝑠 ). In this kind of cell there is information about both cuts.
Figure 2.14. Cut between the solid (red) and the free surface (blue) in one cell. The point where both cuts meet 𝐶 has to be obtained. There is information about the start and end points of solid and free surface cuts (𝑆𝑠 , 𝐸𝑠 , 𝑆𝑓 𝑠 and 𝐸𝑓 𝑠 respectively). The vector director of the line defining the cut can is easily obtained using the start and end points ⃗𝑣𝑠 = (𝑣𝑠𝑥 , 𝑣𝑠𝑦 )𝑇 = 𝐸𝑠 − 𝑆𝑠
34
2. CARTESIAN CUT CELL METHOD
and ⃗𝑣𝑓 𝑠 = (𝑣𝑓𝑥𝑠 , 𝑣𝑓𝑦𝑠 )𝑇 = 𝐸𝑓 𝑠 − 𝑆𝑓 𝑠 . Consider line 𝑟𝑠 giving the cut of the solid while 𝑟𝑓 𝑠 defines the cut by the free surface.
ES E fs
C Sfs SS Figure 2.15. Cut between the solid (red) and the free surface (blue) in one cell. 𝑆𝑓 𝑠 and 𝐸𝑓 𝑠 are the start and end points from the free surface, 𝑆𝑠 and 𝐸𝑠 are the start and end points from the solid obstacle. Point 𝐶 is the intersection point between both cuts.
(89)
𝑟𝑠 = {(𝑎, 𝑏) ∈ ℝ2
𝑠.𝑡.
∃𝑡 ∈ ℝ :
(𝑎, 𝑏) = 𝑆𝑠 + 𝑡⃗𝑣𝑠 },
(90)
𝑟𝑓 𝑠 = {(𝑎, 𝑏) ∈ ℝ2
𝑠.𝑡.
∃𝑡 ∈ ℝ :
(𝑎, 𝑏) = 𝑆𝑓 𝑠 + 𝑡⃗𝑣𝑓 𝑠 }.
Point 𝐶 has to verify both equations at the same time. There exist 𝑝, 𝑡 ∈ ℝ, verifying that (91)
𝑆𝑠 + 𝑝⃗𝑣𝑠 = 𝑆𝑓 𝑠 + 𝑡⃗𝑣𝑓 𝑠 ,
which leads to a 2×2 system of equations with 𝑡 and 𝑝 as unknown,
(92)
[
𝑣𝑠𝑥 𝑣𝑠𝑦
−𝑣𝑓𝑥𝑠 −𝑣𝑓𝑦𝑠
][
𝑝 𝑡
]
=
[
𝑆𝑓𝑥𝑠 − 𝑆𝑠𝑥 𝑆𝑓𝑦𝑠 − 𝑆𝑠𝑦
The solution is quite simple: ∙ If 𝑣𝑠𝑦 = 0 and 𝑣𝑓𝑥𝑠 = 0, (93)
𝑝=
𝑆𝑠𝑦 − 𝑆𝑓𝑦𝑠 𝑆𝑓𝑥𝑠 − 𝑆𝑠𝑥 and 𝑡 = . 𝑣𝑠𝑥 𝑣𝑓𝑦𝑠
∙ If 𝑣𝑓𝑦𝑠 = 0 and 𝑣𝑠𝑥 = 0, (94)
𝑝=
𝑆𝑓𝑦𝑠 − 𝑆𝑠𝑦 𝑣𝑠𝑦
and 𝑡 =
𝑆𝑠𝑥 − 𝑆𝑓𝑥𝑠 . 𝑣𝑓𝑥𝑠
]
.
4. INTERSECTING SOLID AND FREE SURFACE
35
∙ If 𝑣𝑠𝑥 = 0, (95)
] [ ) 𝑣𝑦 ( ) 𝑆𝑠𝑥 − 𝑆𝑓𝑥𝑠 1 ( 𝑦 𝑓 𝑠 𝑝= 𝑦 and 𝑡 = 𝑆𝑓 𝑠 − 𝑆𝑠𝑦 + 𝑥 𝑆𝑠𝑥 − 𝑆𝑓𝑥𝑠 . 𝑣𝑠 𝑣𝑓 𝑠 𝑣𝑓𝑥𝑠
∙ If 𝑣𝑠𝑦 = 0, (96)
[ ] ) 𝑆𝑠𝑦 − 𝑆𝑓𝑦𝑠 ) 𝑣𝑓𝑥𝑠 ( 𝑦 1 ( 𝑥 𝑦 𝑥 and 𝑡 = . 𝑝 = 𝑥 𝑆𝑓 𝑠 − 𝑆𝑠 + 𝑦 𝑆𝑠 − 𝑆𝑓 𝑠 𝑣𝑠 𝑣𝑓 𝑠 𝑣𝑓𝑦𝑠
∙ If 𝑣𝑓𝑥𝑠 = 0, (97)
[ )] ) ( 𝑦 𝑆𝑓𝑥𝑠 − 𝑆𝑠𝑥 1 𝑣𝑠𝑦 ( 𝑥 𝑦 𝑥 𝑝= and 𝑡 = 𝑦 𝑆 − 𝑆𝑠 − 𝑆𝑓 𝑠 − 𝑆𝑠 . 𝑣𝑠𝑥 𝑣𝑓 𝑠 𝑣𝑠𝑥 𝑓 𝑠
∙ If 𝑣𝑓𝑦𝑠 = 0, (98)
𝑝=
𝑆𝑓𝑦𝑠 − 𝑆𝑠𝑦
] [ ) ( ) 1 𝑣𝑠𝑥 ( 𝑦 𝑥 𝑥 𝑦 and 𝑡 = 𝑥 𝑆𝑓 𝑠 − 𝑆𝑠 − 𝑆𝑓 𝑠 − 𝑆𝑠 . 𝑣𝑓 𝑠 𝑣𝑠𝑦
𝑣𝑠𝑦
∙ If none of the 𝑣𝑠,𝑓 𝑠 components is 0, (99)
𝑝=
1 𝑣𝑠𝑦 𝑣𝑓𝑥𝑠 𝑣𝑓𝑦𝑠
𝑣𝑠𝑥 − (100)
𝑡=
1 𝑣𝑓𝑥𝑠 −
𝑣𝑓𝑦𝑠 𝑣𝑠𝑥 𝑣𝑠𝑦
[ ( [
𝑆𝑓𝑥𝑠
−
𝑆𝑠𝑥
)
] ) 𝑣𝑓𝑥𝑠 ( 𝑦 𝑦 − 𝑦 𝑆𝑠 − 𝑆𝑓 𝑠 , 𝑣𝑓 𝑠
] ) ( ) 𝑣𝑠𝑥 ( 𝑦 𝑦 𝑥 𝑥 . 𝑆 − 𝑆 − 𝑆 − 𝑆 𝑠 𝑓𝑠 𝑠 𝑓𝑠 𝑣𝑠𝑦
The normal vectors given by the CCCM are normalized to the length of the cut, i.e., ∣∣⃗𝑛𝑓 𝑠 ∣∣ = ∣𝑆𝑓 𝑠 𝐸𝑓 𝑠 ∣ and ∣∣⃗𝑛𝑠 ∣∣ = ∣𝑆𝑠 𝐸𝑠 ∣. In this case, the length of the cut is required and the normal vectors should be renormalized, for example, in case of Figure 2.15 for it to satisfy ∣∣⃗𝑛𝑓 𝑠 ∣∣ = ∣𝑆𝑓 𝑠 𝐶∣ and ∣∣⃗𝑛𝑠 ∣∣ = ∣𝑆𝑠 𝐶∣. The area should also be recomputed, the area provided by the CCCM, 𝐴𝑓 𝑠 and 𝐴𝑠 are bigger than the final area of fluid in the cell. To recompute the area all the possibilities of the cuts are required, and there are several cases. The following figures are illustrated the cases only for the situation where the slope of cuts produced by the solid body, 𝑆𝑙𝑜𝑝𝑒𝑠 = 1 ∙ Figure 2.16(a) and 2.16(c), the 4 vertex are 𝑆𝑠 , (𝑖, 𝑗 − 1), 𝐸𝑓 𝑠 and 𝐶. ∙ Figure 2.16(b), the 3 vertex are 𝑆𝑠 , 𝐸𝑓 𝑠 and 𝐶. ∙ Figure 2.17(a) and 2.17(c), the 5 vertex are (𝑖 − 1, 𝑗 − 1), (𝑖, 𝑗 − 1), 𝐸𝑓 𝑠 , 𝐶 and 𝑆𝑠 . ∙ Figure 2.17(b), the 4 vertex are (𝑖 − 1, 𝑗), 𝐸𝑓 𝑠 , 𝐶 and 𝑆𝑠 . ∙ Case in Figure 2.18(a) and 2.18(c), the 5 vertex are (𝑖 − 1, 𝑗 − 1), (𝑖, 𝑗 − 1), 𝐸𝑓 𝑠 , 𝐶 and 𝑆𝑠 . ∙ Figure 2.18(b), the 6 vertex are (𝑖 − 1, 𝑗 − 1), (𝑖 − 1, 𝑗 − 1), (𝑖, 𝑗), 𝐸𝑓 𝑠 , 𝐶 and 𝑆𝑠 . ∙ Figure 2.18(d), the 4 vertex are (𝑖 − 1, 𝑗 − 1), 𝐸𝑓 𝑠 , 𝐶 and 𝑆𝑠 . ∙ Case in Figure 2.19(a) and 2.19(c), the 4 vertex are 𝑆𝑠 , (𝑖, 𝑗 − 1), 𝐸𝑓 𝑠 and 𝐶. ∙ Figure 2.19(b), the 5 vertex are 𝑆𝑠 , (𝑖, 𝑗 − 1), (𝑖, 𝑗), 𝐸𝑓 𝑠 and 𝐶.
36
2. CARTESIAN CUT CELL METHOD
(a) 𝑆𝑙𝑜𝑝𝑒𝑓 𝑠 𝑣𝑒𝑟𝑡𝑒𝑥 = 4.
= 1 and
(b) 𝑆𝑙𝑜𝑝𝑒𝑓 𝑠 𝑣𝑒𝑟𝑡𝑒𝑥 = 3.
= 4 and
(c) 𝑆𝑙𝑜𝑝𝑒𝑓 𝑠 𝑣𝑒𝑟𝑡𝑒𝑥 = 4.
= 4 and
Figure 2.16. Cell of type 1 for 𝑆𝑙𝑜𝑝𝑒𝑠 (𝑖, 𝑗) = 1. The red colored part is the solid and the blue is the free surface (air).
(a) 𝑆𝑙𝑜𝑝𝑒𝑓 𝑠 𝑣𝑒𝑟𝑡𝑒𝑥 = 5.
= 1 and
(b) 𝑆𝑙𝑜𝑝𝑒𝑓 𝑠 𝑣𝑒𝑟𝑡𝑒𝑥 = 4.
= 4 and
(c) 𝑆𝑙𝑜𝑝𝑒𝑓 𝑠 𝑣𝑒𝑟𝑡𝑒𝑥 = 5.
= 4 and
Figure 2.17. Cell of type 2 for 𝑆𝑙𝑜𝑝𝑒𝑠 (𝑖, 𝑗) = 1. The red colored part is the solid and the blue is the free surface (air). ∙ Figure 2.19(d), the 3 vertex are 𝑆𝑠 , 𝐸𝑓 𝑠 and 𝐶. 5. Cartesian Cut Cell Routines 5.1. Introduction. The Cartesian Cut Cell Routines (CCCR) used during this dissertation were programmed by Mr. Philip Bailey and I would like to acknowledge Mr. Andrew Morris for his help understanding them. The program is able to handle moving boundaries (if prescribed velocities are known) and solid bodies can lay at the boundaries of the initial domain. During this study solid bodies do not move, even when the routines can cope with the movement of solid bodies once the velocities of the body are known. The velocity of the free surface is unknown a priori so it is necessary to move the free surface outside the routines and call the routines to obtain the cuts at every time step. A guide to a better comprehension of the routines is given in this section. The inputs and outputs of the total routines are described, with an example of usage. Then input and output of each routine are shown. 5.2. Input. The inputs for the routines should be, ∙ (𝑥0 , 𝑦0 ), the bottom left corner of the domain. In the code this is called (𝑥0, 𝑦0). ∙ (𝑥𝑒𝑛𝑑 − 𝑥0 , 𝑦𝑒𝑛𝑑 − 𝑦0 ), distance between first and last nodes in the background grid in each direction, called (𝑥 𝑑𝑖𝑚, 𝑦 𝑑𝑖𝑚).
5. CARTESIAN CUT CELL ROUTINES
(a) 𝑆𝑙𝑜𝑝𝑒𝑓 𝑠 𝑣𝑒𝑟𝑡𝑒𝑥 = 5.
= 1 and
(b) 𝑆𝑙𝑜𝑝𝑒𝑓 𝑠 𝑣𝑒𝑟𝑡𝑒𝑥 = 6.
= 1 and
(c) 𝑆𝑙𝑜𝑝𝑒𝑓 𝑠 𝑣𝑒𝑟𝑡𝑒𝑥 = 5.
= 4 and
(d) 𝑆𝑙𝑜𝑝𝑒𝑓 𝑠 𝑣𝑒𝑟𝑡𝑒𝑥 = 4.
= 4 and
37
Figure 2.18. Cell of type 3 for 𝑆𝑙𝑜𝑝𝑒𝑠 (𝑖, 𝑗) = 1. The red colored part is the solid and the blue is the free surface (air).
(a) 𝑆𝑙𝑜𝑝𝑒𝑓 𝑠 𝑣𝑒𝑟𝑡𝑒𝑥 = 4.
= 1 and
(b) 𝑆𝑙𝑜𝑝𝑒𝑓 𝑠 = 1 and 𝑣𝑒𝑟𝑡𝑒𝑥 = 5.
(c) 𝑆𝑙𝑜𝑝𝑒𝑓 𝑠 𝑣𝑒𝑟𝑡𝑒𝑥 = 4.
= 4 and
(d) 𝑆𝑙𝑜𝑝𝑒𝑓 𝑠 𝑣𝑒𝑟𝑡𝑒𝑥 = 3.
= 4 and
Figure 2.19. Cell of type 4 for 𝑆𝑙𝑜𝑝𝑒𝑠 (𝑖, 𝑗) = 1. The red colored part is the solid and the blue is the free surface (air). ∙ Δ𝑥 and Δ𝑦, the distance between two consecutive nodes called 𝐷𝑥 and 𝐷𝑦. They allow to compute 𝑛𝑖 and 𝑛𝑗, the number of points in each coordinate. 𝑛𝑖 = 𝑥 𝑑𝑖𝑚/Δ𝑥 ∙ The number of solid bodies to consider, denoted by 𝑛𝑜 𝑠𝑙𝑑.
38
2. CARTESIAN CUT CELL METHOD
∙ 𝑥 and 𝑦 coordinates of the position of the vertex of the solids. Are denoted by 𝑥𝑚𝑏𝑑 and 𝑦𝑚𝑏𝑑. They are two dimensional arrays, for example 𝑥𝑚𝑏𝑑(𝑛, 𝑚) where 𝑛 = 1, 2, . . . , 𝑛𝑚𝑑𝑏(𝑚) and 𝑚 = 1, 2, . . . , 𝑛𝑜 𝑠𝑙𝑑. It means that the second index indicate the solid, and the first index, the number of vertex of the solid. These points have to be given anticlockwise, see the following example. Example 2.2. Lets consider a very simple domain being cut by two solid obstacles with input: ∙ ∙ ∙ ∙ ∙ ∙
(101)
Left corner of the domain (𝑥0 , 𝑦0 ) = (0, 0). Length of each side of the domain (𝑥𝑒𝑛𝑑 − 𝑥0 , 𝑦𝑒𝑛𝑑 − 𝑦0 ) = (5, 5). Size of the steps in each direction, Δ𝑥 = Δ𝑦 = 1 . So 𝑛𝑖 = 𝑛𝑗 = 5. Number of solid bodies 𝑛𝑜 𝑠𝑙𝑑 = 2. Number of vertex of each solid 𝑛𝑚𝑑𝑏(1) = 4 and 𝑛𝑚𝑑𝑏(2) = 5. Coordinates of the vertex of the solid bodies: ⎛
⎜ ⎜ 𝑥𝑚𝑏𝑑 = ⎜ ⎜ ⎝
0 1 1.5 0 ∗
5 5 4 4.5 4
⎞ ⎟ ⎟ ⎟ ⎟ ⎠
𝑎𝑛𝑑
⎛
⎜ ⎜ 𝑦𝑚𝑏𝑑 = ⎜ ⎜ ⎝
0 2 4 5 ∗
0 5 4 3 2
⎞
⎟ ⎟ ⎟, ⎟ ⎠
as the first solid has one vertex more than the second, the position (5,1) in both vectors will be empty. See that the points are given anticlockwise. The domain once it is cut looks like Figure 2.20.
5
4
3
2
1
0 0
1
2
3
4
5
Figure 2.20. Position of the solid bodies given in the example.
5.3. Output. The outputs of the routines provides all the information about the geometry of the cuts. The outputs are:
5. CARTESIAN CUT CELL ROUTINES
39
∙ (𝐶𝑢𝑡𝐼, 𝐶𝑢𝑡𝐽) index of the cell. The routines consider “ghost” cells, so numbers for the cells inside the computational domain starts at 2 as index 1 is a ghost cell. Instead of 𝑖 = 1, 2, . . . , 𝑁 the numeracy is 𝑖 = 2, 3, . . . , 𝑁 + 1. ∙ (𝐶𝑢𝑡𝑆𝑡𝑎𝑟𝑡𝑋, 𝐶𝑢𝑡𝑆𝑡𝑎𝑟𝑡𝑌 ) coordinates of the start point of the cut in the cell. ∙ (𝐶𝑢𝑡𝐸𝑛𝑑𝑋, 𝐶𝑢𝑡𝐸𝑛𝑑𝑌 ) coordinates of the end point of the cut in the cell. ∙ 𝐶𝑢𝑡𝐴𝑟𝑒𝑎 Area filled by fluid in the cut cell. ∙ 𝑖𝑠𝑜𝑙𝑖𝑑, takes values 0, 1 or 2, depending on the type of cell (this is what have been call “flag” of the cell), ⎧ ⎨ 0, 1, 𝑖𝑠𝑜𝑙𝑖𝑑 = ⎩ 2,
(102)
flow cell cut cell solid cell.
∙ 𝑀 𝑟𝑔𝐶𝑒𝑙𝑙, gives information about whether the cell has to be merged. In case the cell has to be merged, the value of this parameter also gives information about the relative position of the cell used. ⎧ 0, ⎨ 1, 2, 𝑀 𝑟𝑔𝐶𝑒𝑙𝑙 = 3, ⎩ 4,
(103)
No need to merge the cell Cell merged with the cell at Cell merged with the cell at Cell merged with the cell at Cell merged with the cell at
its its its its
EAST NORTH WEST SOUTH.
∙ 𝑆𝑙𝑜𝑝𝑒 gives the sector at which the slope of the cut belongs, ⎧ 1, ⎨ 2, 𝑆𝑙𝑜𝑝𝑒 = 3, ⎩ 4,
(104)
The The The The
slope slope slope slope
belongs belongs belongs belongs
to to to to
(0𝑜 , 90𝑜 ] (90𝑜 , 180𝑜 ] (180𝑜 , 270𝑜 ] (270𝑜 , 360𝑜 ].
∙ (𝐶𝑢𝑡𝑁 𝑜𝑟𝑚𝑎𝑙𝑋, 𝐶𝑢𝑡𝑁 𝑜𝑟𝑚𝑎𝑙𝑌 ) output normal vectors of the cut, which in this document has been called ⃗𝑛. The norm of this normal vector is multiplied by the length of the cut, (105)
⃗𝑛 = ∣(𝐶𝑢𝑡𝑆𝑡𝑎𝑟𝑡𝑋, 𝐶𝑢𝑡𝑆𝑡𝑎𝑟𝑡𝑌 )(𝐶𝑢𝑡𝐸𝑛𝑑𝑋, 𝐶𝑢𝑡𝐸𝑛𝑑𝑌 )∣.
∙ (𝐶𝑢𝑡𝐶𝑒𝑛𝑡𝑟𝑜𝑖𝑑𝑋, 𝐶𝑢𝑡𝐶𝑒𝑛𝑡𝑟𝑜𝑖𝑑𝑌 ) gives the centroid of the cell. This parameter is very important because the information of flow variables is stored at this point. Example 2.3. The domain given in Example 2.2 has been passed to the CCCR and the result is shown in Figure 2.21, where 𝐴 is the result of merging cells (3, 6) and (2, 6), remember that the index starts by 2 because of the ghost cells. The area of cell (2, 6) is small, so it is merged with the EAST cell (3, 6). The natural way it would be to merge with the NORTH cell (2, 7), but it lies out of our domain. In the case of super-cells 𝐵, 𝐶, 𝐷 and 𝐸 the cells to merge with lie in the domain.
5.4. Routines to be called. 5.4.1. Find all solid body and Cell Intersection points with Velocity. The initial background grid, the position and movement of solid bodies (in case they move) is given to the CCCR. This routine will find the intersection of the background grid with each solid body. The output of this routine are 3 arrays with internal data for the next routines. INPUT
40
2. CARTESIAN CUT CELL METHOD
5 A 4 C 3
D 2
B
E
1
0 0
1
2
3
4
5
Figure 2.21. Grid resultant of applying the CCCR to the geometry given. Merged cells A, B, C, D and E.
∙ SBMaxNumberOfPnts, (Integer) maximum number of vertex in the solid bodies plus 1. It means, in the case we have 5 triangles, 2 rectangle, one 7-sides-polygon and 3 pentagons, this value would be 8 because the maximum number of sides amount our polygons is 7, and the first vertex is repeat, one more is added, so this value is 8. ∙ NumberOfSlds, (Integer) Number of solid bodies in the domain. ∙ SBXCoordinates, (Array) X vertex of the Solid bodies. It has as many indexes as solid bodies (NumberOfSlds) to store the x-coordinates of the vertex in each index. ∙ SBYCoordinates, (Array) Y vertex of the Solid bodies. It has as many index as solid bodies (NumberOfSlds) to store the y-coordinates of the vertex in each index. ∙ SBUVel, (Array) U velocity of each vertex of the solid bodies. ∙ SBVVel, (Array) V velocity of each vertex of the solid bodies. ∙ SBNumberOfPnts, (Array) gives the number of vertex (or sides) plus one of each solid body. In the case of just one solid body it is equal to SBMaxNumberOfPnts ∙ DeltaX, DeltaY, (Reals) distance between two consecutive nodes in the background grid in each direction. ∙ CompDomainStartX, (Real) X-coordinate of the starting point of our domain, usually is set to 0. ∙ CompDomainStartY, (Real) Y-coordinate of the starting point of our domain, usually is set to 0. ∙ XLength, Length of the domain in the X-direction. ∙ YLength, Length of the domain in the X-direction. INPUT & OUTPUT ∙ MrgCellLst, (Array) List of Merged cells. ∙ AllSldBdysIsectPntLst, (Array) List of all the intersection points (with the solid bodies). ∙ SBNumberOfIsectPnts, (Array) Number of intersection points for each solid body.
5. CARTESIAN CUT CELL ROUTINES
41
5.4.2. Find all Isolid data. Isolid is an array that has to be initializated to zero before call the subroutine. This routine will assign an isolid value (0 for Flow, 1 foe Cut and 2 for Solid cells) to each cell of the background domain. INPUT ∙ NumberOfSlds, (Integer) Number of solid bodies in the domain. ∙ DeltaX, DeltaY, (Reals) distance between two consecutive nodes in the background grid in each direction. ∙ CompDomainStartX, (Real) X-coordinate of the starting point of our domain,usually is set to 0. ∙ CompDomainStartY, (Real) Y-coordinate of the starting point of our domain, usually is set to 0. ∙ XLength, Length of the domain in the X-direction. ∙ YLength, Length of the domain in the X-direction. ∙ AllSldBdysIsectPntLst, (Array) List of all the intersection (with the solid bodies) points. Output of the previous subroutine. ∙ SBNumberOfIsectPnts, (Array) Number of Intersection points for each solid body. Output of the previous subroutine. INPUT & OUTPUT ∙ Isolid, Array that describes the relative position of each cell with respect to the domain. It means, it has value 0 for a flow cell, 1 for a cut cell and 2 for a solid cell. It is 2 cells wider and longer because of the ghost cells. 5.4.3. Get Next Cut From All Isolid List. This routine go through each point computing the geometrical details of Cut cells. This subroutine should be called for every solid body in the domain. INPUT ∙ AllSldBdysIsectPntLst, (Array) List of all the intersection points (with the solid bodies). Output of the first subroutine. ∙ NumberOfIsectPnts, (Array) Number of intersection points for the selected solid body. Is one of the values in the array NumberOfIsectPnts that is Output of the first subroutine. ∙ RequiredSBIndex, Index of the body that we want to study. OUTPUT ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙ ∙
CutStartX, (Real) X-coordinate of the first cut. CutStartY, (Real) Y-coordinate of the first cut. CutEndX, (Real) X-coordinate of the last cut. CutEndY, (Real) Y-coordinate of the last cut. CutI, (Integer) X-direction index of the cut. CutJ, (Integer) Y-direction index of the cut. CutNormalX, (Real) X-component of the normal vector of the cut. CutNormalY, (Real) Y-component of the normal vector of the cut. CutU, (Real) U component of the velocity of the cut. CutV, (Real) V component of the velocity of the cut. CutArea, (Real) Area of the cut cell. CutCentroidX, (Real) X-coordinate of the centre point of the cut cell. CutCentroidY, (Real) X-coordinate of the centre point of the cut cell.
42
2. CARTESIAN CUT CELL METHOD
∙ MrgCell, (Integer) variable saying whether the cell needs to be merged, and the relative position of the cell to merge with. ∙ Slope, (Real) Gives the slope (angle) of the cut. INPUT & OUTPUT ∙ NextIsectPnt (Real) next intersection point. ∙ IsectPntIndex (Integer) index of the next intersection point in the intersection point list.
CHAPTER 3
Numerical Method 1. Introduction The technique (CCCM and Godunov’s type Method) use in this dissertation has been successfully used by the CMMFA for the SWE [24, 25, 60, 61, 100, 140, 161, 166]. It also has been applied to the EE and NSE in two fluids systems [63, 117, 118, 119]. The CMMFA is responsible for the software AMAZON-CC, based on the SWE, and AMAZON-SC, based on the NSE for two fluid systems. LeVeque uses also this technique in [77, 78] and also produced the CLAWPACK software. DamFlow is also a software about SWE done by University of Malaga [23]. Toro in his [148] gives details of the employed method for both systems of equations. The ACM [30] is used to obtain the solution of the incompressible NSE. Applying a perturbation to the conservation of mass equation on a fictitious time a new set of equations are obtained. This perturbation makes the system compressible in fictitious time. The solutions of the perturbed system (compressible) converges in fictitious time to the solutions of the incompressible NSE. The new set of equations are an hyperbolic system of equations which is solved using a cell-centred finite volume approach. A high order Godunov type upwind scheme is used where information is stored at cell centres. For each time iteration values are linearly reconstructed at each side of cell interface using slope limiters to avoid under/over oscillations. A local RP is set at each cell interfaces using the reconstructed values. A quick and robust Riemann Solver (RS) is required as the exact Riemann solution is computer expensive. These techniques are applied to a two dimensional incompressible one fluid system. The density 𝜌 is assumed to be constant, these are the parameters used in the equation, ∙ ∙ ∙ ∙
⃗ = (𝑢, 𝑣), 𝑢, 𝑣 velocities in the 𝑥 and 𝑦 direction respectively, 𝑉 𝑝 dynamic pressure, ⃗ 𝑔 gravity acceleration, that would be included in vector 𝐵, 𝜇 denotes the viscosity.
Using this notation, incompressible NSE (EE 𝜇 = 0) equations are written as follows, ∙ Conservation of mass, (106) ∙ Conservation of momentum, (107)
⃗ =0 ∇⋅𝑉
) ( ⃗ ∂𝑉 ⃗ ×𝑉 ⃗ − 𝑇⃗ = 𝐵 ⃗ +∇⋅ 𝑉 ∂𝑡 43
44
3. NUMERICAL METHOD
⃗ − 𝐼𝑝, with 𝜇 the dynamic viscosity, for the being 𝑇⃗ = −𝐼𝑝 for the EE and 𝑇⃗ = 𝜇∇ ⋅ 𝑉 NSE. ∙ Incompressibility constraint, (108)
⃗ =0 ∇⋅𝑉
In this case the conservation of mass (106) and the incompressibility constraint (108) are the same because density is constant. The ACM will be introduced and applied for the presented case in next section.
2. Artificial Compressibility Method The Artificial Compressibility Method (ACM) was first developed by Alexander Joel Chorin in 1967 and has been reprinted by the AIAA Selected Reprint Series (1968), Physical Society of Japan (1971) and Journal of Computational Physics (1997) [30]. In 2000, Professor Chorin received the Norbert Wiener Prize in Applied Mathematics for his contribution to Fluid Dynamics and also holds the University of California Professor award. The ACM was initially developed to solve steady problems while unsteady problems would be solved using the Projection Method also by Chorin [31]. In fact, using Chorin’s words about the Projection Method “Essentially it constitutes an extension to time dependent problems of the artificial compressibility method introduced in [30] for steady flow problems” [31]. The ACM has been applied to unsteady problems by many authors. Rogers and D. Kwak [128, 129] used the ACM for the unsteady case but they already open the possibility to use it directly in the unsteady cases “Although the current study is limited to steady-state problems, it is shown that this entire formulation can be used for solving unsteady problems” [129]. Since then the ACM has been successfully applied for the simulation of incompressible flow in different flow system (one/two fluids) and the considered mesh (structured/unstructured). In the ACM a new fictitious time scale (pseudo time 𝜏 ) is defined between two consecutive time steps. The relation between (physical) time 𝑡 and pseudo time 𝜏 is given by Kelecy and Pletcher in [71] “The solution at a given physical time level is approached asymptotically as a steady state solution in pseudo-time”. A tolerance value 𝑡𝑜𝑙 is defined, the system is iterated in pseudo time (index 𝑚) until the difference in two consecutive pseudo time steps is below this tolerance. The value obtained in the last pseudo iteration of time 𝑛 is considered the value at next time step 𝑛 + 1 and the start value for the iteration in pseudo time. The incompressibility constraint/conservation of mass (106/108) is perturbed adding a derivative of pressure in pseudo time obtaining,
(109)
1 ∂𝑝 ⃗ = 0, +∇⋅𝑉 𝛽 ∂𝜏
where 𝛽 is a constant (units of pressure) and 𝜏 is the pseudo-time. For simplicity this equation is multiplied by 𝛽 so equations (110) and (111) are the set of equations in Chapter 6 were called “pseudo-compressible NSE”:
2. ARTIFICIAL COMPRESSIBILITY METHOD
(110)
∂𝑝 ⃗ = 0, + 𝛽∇ ⋅ 𝑉 ∂𝜏
(111)
( ) ⃗ ∂𝑉 ⃗ ×𝑉 ⃗ − 𝑇⃗ = 𝐵, ⃗ +∇⋅ 𝑉 ∂𝑡
where,
(112)
⃗ 𝑉
=
[
𝑢 𝑣
]
,
F
=
[
⃗ 𝑢 + 𝑝⃗𝑖 𝑉 ⃗ 𝑉 𝑣 + 𝑝⃗𝑗
]
𝑎𝑛𝑑
B
=
45
[
⃗𝑥 𝐵 ⃗𝑦 𝐵
]
=
[
0 0
]
.
2.1. Artificial Compressibility Parameter. There is uncertainty in the literature about the appropriate value of the artificial compressibility parameter, 𝛽. Peri`c in [39] says “Typical values of 𝛽 used in various methods based on artificial compressibility were in the range between 0.1 and 10 ”. Bet et al. [17] apply 𝛽 values between 0.4 and 2.0 for the case they study. They also plot a convergence rate for different 𝛽 values. Lee at al. [76], used a range of 𝛽 values between 0.5 and 10, finding 𝛽 = 1 when the “most acceptable convergence” is obtained. Li et al. [81] used an artificial compressibility parameter 𝛽 the ℓ2 norm of the velocity multiplied by a constant 𝜖 which values belongs to the interval [3, 10]. Qian et al. [117, 118, 119] used similar 𝛽 values understanding they work with a two phase flow, and they used 𝛽/𝜌, where 𝜌 is the density to modify the conservation of mass equation. “It was found that a 𝛽 value between 200 and 2000 produced good results for the current test cases” [119], the value density used in water was 𝜌 = 1000, so 𝛽/𝜌 takes values between 0.2 and 2, while in air 𝜌 = 1 therefore 𝛽 was between 200 and 2000. In Experiments a value of 𝛽 = 0.01 has been successfully applied for the lid-driven Cavity flow and for the lid-driven Couette flow. Malan et al. [94] do not use a constant value of the artificial parameter 𝛽 through the whole computation. Instead 𝛽 is recomputed automatically at every time step, computing convective and diffusive values for 𝛽 and using the maximum of them. A comparison of results using constant or automatically recomputed 𝛽 values is presented in [93]. Nithiarasu [107] gives a methodology in which it is possible to find an appropriate value (constant through the computation) for 𝛽 and Δ𝑡. In Nithiarasu’s computation of 𝛽 the convective velocity, 𝑣𝑐𝑜𝑛𝑣 and the diffusive velocity, 𝑣𝑑𝑖𝑓 𝑓 , are required and defined as,
(113)
𝑣𝑐𝑜𝑛𝑣 =
√
𝑢 ˆ𝑢 ˆ
and
𝑣𝑑𝑖𝑓 𝑓 =
2 , ℎ𝑅𝑒
where 𝑢 ˆ is the maximum value of the velocity in the domain, and ℎ the grid size. The appropriate value for the artificial compressibility parameter is given by (114)
𝛽 = max(𝜖, 𝑣𝑐𝑜𝑛𝑣 , 𝑣𝑑𝑖𝑓 𝑓 ),
where 𝜖 is a constant value which in Nithiarasu’s work has the value 0.5. Similarly for the time interval, Δ𝑡, Nithiarasu computed a convective time Δ𝑡𝑐𝑜𝑛𝑣 and a diffusive time Δ𝑡𝑑𝑖𝑓 𝑓 ,
46
(115)
3. NUMERICAL METHOD
Δ𝑡𝑐𝑜𝑛𝑣 =
ℎ 𝑣𝑐𝑜𝑛𝑣 + 𝛽
and
Δ𝑡𝑑𝑖𝑓 𝑓 =
ℎ2 𝑅𝑒 , 2
and consider the value for Δ𝑡 as: (116)
Δ𝑡 = 𝜖Δ𝑡 min(Δ𝑡𝑐𝑜𝑛𝑣 , Δ𝑡𝑑𝑖𝑓 𝑓 ),
where 𝜖Δ𝑡 is a safety value varying in the interval (0.5, 2). A different value is given in [119]: “the time step Δ𝑡 used for advancing the solution was within the range 5 × 10−5 - 5 × 10−4 s”. In this work different values of 𝛽 and Δ𝑡 has been applied which will be more explained in following Chapters (5, 6 and 7)
3. Godunov’s Method Godunov’s most influential work is in the area of applied and numerical mathematics has had a major impact on science and engineering, particularly in the development of methodologies used in Computational Fluid Dynamics (CFD). Godunov’s theorem: All linear monotone scheme for the convection equation are necessarily first order accurate (see proof in [57]). On 1-2 May, 1997 a symposium entitled: Godunov-Type Numerical Methods, was held at the University of Michigan to honour Godunov. These methods are widely used to compute continuum processes dominated by wave propagation. On the following day, 3rd May, Godunov received an honorary degree from the University of Michigan. Godunov’s scheme is a conservative numerical scheme for solving PDE. In this method, the conservative variables are considered as piecewise constant over the mesh cells at each time step and the time evolution is determined by the exact solution of the RP (shock tube)at the inter-cell boundaries [57]. Guinot in [51] explained the potential of this method: “As mentioned in previous chapters and as illustrated by a number of authors on simple examples (see e.g. LeVeque [77] or Toro [148]), globally non-conservative numerical methods lead to errors in the computation of both the amplitude and/or celerity of shocks... This is because several initial conditions may lead to the same final state when the flow is discontinuous. For this reason Godunov sought a conservative alternative to the Method of Characteristics to solve systems of conservation laws... Although being only first-order accurate, and therefore leading to considerable smearing of waves and discontinuities, the scheme allowed shocks to be represented correctly, both in terms of celerity and amplitude”. Van Leer gives a possible definition of Godunov-type methods in [151]: “If we define Godunov-type methods as non-oscillatory finite volume schemes that incorporate the solution (exact or approximate) to Riemann initial-value problem, or a generalization of it”. The original Godonov’s method consists of three different steps: (1) Define a piece-wise constant distribution of data in the domain. At each cell the average value is computed:
3. GODUNOV’S METHOD
𝑛 𝑈(𝑖,𝑗)
(117)
1
=
Ω(𝑖,𝑗)
∫
47
𝑈 (𝑥, 𝑦; 𝑡𝑛 )𝑑Ω(𝑖,𝑗) , (𝑖,𝑗)
all the points in cell (𝑖, 𝑗) will have the value of the computed average 𝑛 𝑈 (𝑥, 𝑦; 𝑡𝑛 ) = 𝑈(𝑖,𝑗) , if (𝑥, 𝑦) ∈ Ω(𝑖, 𝑗).
(118)
(2) At each cell interface, e.g. (i+1/2,j), solve the local RP for the conservation laws using the 𝑛 averaged constant states at each side of the interface, denoted 𝐹˜(𝑖+1/2,𝑗) . (3) Update the value at each cell using the solution of the RP: 𝑛+1 𝑛 𝑈𝑖,𝑗 = 𝑈𝑖,𝑗 +
(119)
∑
𝐹˜𝑙𝑛 .
𝑙∈∂Ω(𝑖,𝑗)
A restriction in time is enforced to avoid wave iteration within cells, i.e. more than one wave travelling through each cell, (120) 𝑛 where 𝑆𝑚𝑎𝑥
1 2
min(Δ𝑥, Δ𝑦) , 𝑛 𝑆𝑚𝑎𝑥 denotes the maximum wave velocity at time 𝑡𝑛 in the entire domain. Δ𝑡 ≤
3.1. Improvement to step (1): In this work a similar methodology is applied with some improvements. Instead of considering piecewise constant values at cells, a linear reconstruction within cells is used, so a piecewise linear function is obtained. Slope limiters are used to avoid spurious over and undershoots. A description of the reconstruction applied is given in Section 4.2 [51, 57, 78, 148]. 3.2. Improvement to step (2): The methodology implies the solution of local RP at every cell interface at every time. An efficient solver is required and will be explained in Section 5. 3.3. Application of step (3) and the ACM:. Using the same notation for the velocity, pressure and flux given in equation (112) and using the subscripts ⋅(𝑖,𝑗) to indicate average values in cell (𝑖, 𝑗) stored at cell centres, an implicit scheme in real time is used here for equation (111). The real time level is denoted by 𝑛.
(121)
Ω(𝑖,𝑗) ( ⃗ 𝑛+1 ⃗ 𝑛 ) 𝑉(𝑖,𝑗) − 𝑉(𝑖,𝑗) Δ𝑡
+
⎛ ⎝
∑
𝑙∈∂Ω(𝑖,𝑗)
⎞𝑛+1
(FS)𝑙 − BΩ⎠
=
0.
For equation (110) an implicit scheme in pseudo-time is used and the pseudo-time level is denoted by 𝑚,
(122)
⎛ ⎞𝑚+1 ) ∑ Ω(𝑖,𝑗) ( 𝑚+1 ⃗ S)𝑙 ⎠ ⎝ 𝑝(𝑖,𝑗) − 𝑝𝑚 (𝑉 = 0. (𝑖,𝑗) + Δ𝜏 𝑙∈∂Ω(𝑖,𝑗)
The quantities at pseudo-time step 𝑚 + 1 approaches the solution at next time step 𝑛 + 1 in the limit as 𝑚 → ∞. As the solutions of the pseudo-incompressible NSE converges in fictitious time to
48
3. NUMERICAL METHOD
the solutions of the incompressible NSE: “it is possible to change in equation (121) the index 𝑛 + 1 by the index 𝑚 + 1 obtaining” [71],
(123)
Ω(𝑖,𝑗) ( ⃗ 𝑚+1 ⃗ 𝑛 ) 𝑉(𝑖,𝑗) − 𝑉(𝑖,𝑗) Δ𝑡
⎛
+
⎝
∑
𝑙∈∂Ω(𝑖,𝑗)
⎞𝑚+1
(FS)𝑙 − BΩ⎠
=
0.
Now it is possible to merge equations (122) and (123) in the following equation,
(124)
Ω(𝑖,𝑗) Ω(𝑖,𝑗) 𝑛 (𝐼 − 𝐼0 )∂U(𝑖,𝑗) + 𝐼0 (∂U(𝑖,𝑗) + U𝑚 (𝑖,𝑗) − U(𝑖,𝑗) ) Δ𝜏 Δ𝑡 ⎛ +⎝
∑
𝑙∈∂Ω(𝑖,𝑗)
⎞𝑚+1
(FS)𝑙 − BΩ(𝑖,𝑗) ⎠
= 0,
𝑚 where ∂U(𝑖,𝑗) = U𝑚+1 (𝑖,𝑗) − U(𝑖,𝑗) , 𝐼 = diag(1, 1, 1), 𝐼0 = diag(1, 1, 0) and
⎡
⎤ 𝑢 U = ⎣ 𝑣 ⎦, 𝑝
(125)
⎡ ⃗ ⎤ 𝑉 𝑢 + 𝑝⃗𝑖 ⃗ 𝑣 + 𝑝⃗𝑗 ⎦ F=⎣ 𝑉 ⃗ 𝛽𝑉
⎤ ⃗𝑥 𝐵 ⃗𝑦 ⎦ . B=⎣ 𝐵 0 ⎡
and
4. Flux Calculation The flux function F is divided into inviscid flux F𝐼 and viscous flux F𝑉 (𝜇 = 1/𝑅𝑒). Each one of these is projected into the 𝑥 and 𝑦 directions giving four 1-dimensional fluxes,
(126)
F = F𝐼 +
1 1 F𝑉 = F𝑥𝐼 + F𝑦𝐼 + (F𝑥 + F𝑦𝑉 ) 𝑅𝑒 𝑅𝑒⎡ 𝑉 ⎤⎞ ⎤ ⎡ ⎛⎡ ⎤ ⎡ ⎤ 𝑢𝑦 𝑢𝑥 𝑢2 + 𝑝 𝑢𝑣 1 ⎝⎣ 𝑣 𝑥 ⎦ + ⎣ 𝑣 𝑦 ⎦⎠ . = ⎣ 𝑢𝑣 ⎦ + ⎣ 𝑣 2 + 𝑝 ⎦ + 𝑅𝑒 0 0 𝛽𝑢 𝛽𝑣
For the viscous flux, a central difference scheme is applied to compute the derivatives in F𝑥𝑉 and F𝑦𝑉 [118]. In the computation of the inviscid flow, F𝐼 , second order accuracy is achieved using the procedure explained below. 4.1. Viscous flux. The viscous fluxes are written as,
(127)
⎡
⎤ 𝜇𝑢𝑥 𝑆𝑥 F𝑥𝑉 𝑆𝑥 = ⎣ 𝜇𝑣𝑥 𝑆𝑥 ⎦ 0
and
⎡
⎤ 𝜇𝑢𝑦 𝑆𝑦 𝐹𝑉𝑥 𝑆𝑦 = ⎣ 𝜇𝑣𝑦 𝑆𝑦 ⎦ . 0
A central difference scheme is applied for the computation of the viscous flux, [118]. Defining matrix 𝐶 as follows,
4. FLUX CALCULATION
⎡
𝜇 𝐶=⎣ 0 0
(128)
0 𝜇 0
49
⎤ 0 0 ⎦, 0
it is possible to write F𝑥𝑉 as a function of vectors U(⋅,⋅) ,
(129)
𝑚 (F𝑥𝑉 𝑆𝑥 )𝑖+ 1 2
⎤ 𝑚 𝜇(𝑢𝑚 𝑖+1,𝑗 − 𝑢𝑖,𝑗 )𝑆𝑥 ∣𝑖+ 12 /Δ𝑥 𝑚 𝑚 − 𝑣𝑖,𝑗 )𝑆𝑥 ∣𝑖+ 21 /Δ𝑥 ⎦ = = ⎣ 𝜇(𝑣𝑖+1,𝑗 0 ⎡
and F𝑥𝑉 as function of vectors U(⋅,⋅) ,
(130)
(F𝑥𝑉 𝑆𝑥 )𝑖− 1 2
) 𝐶 ( 𝑚 U𝑖+1,𝑗 𝑆𝑥 ∣𝑖+ 21 − U𝑚 𝑖,𝑗 𝑆𝑥 ∣𝑖+ 12 , Δ𝑥
⎡
⎤ 𝑚 𝜇(𝑢𝑚 𝑖,𝑗 − 𝑢𝑖−1,𝑗 )𝑆𝑥 ∣𝑖− 12 /Δ𝑥 𝑚 𝑚 − 𝑣𝑖−1,𝑗 )𝑆𝑥 ∣𝑖− 12 /Δ𝑥 ⎦ = = ⎣ 𝜇(𝑣𝑖,𝑗 0
) 𝐶 ( 𝑚 1 𝑆 ∣ U𝑖,𝑗 𝑆𝑥 ∣𝑖− 21 − U𝑚 𝑥 𝑖− 2 . 𝑖−1,𝑗 Δ𝑥
The viscosity fluxes at cell (𝑖, 𝑗) ,F𝑥𝑉 , are written as a function of U(𝑖+1,𝑗) , U(𝑖,𝑗) and U(𝑖−1,𝑗) . In the same way in the 𝑦–direction F𝑦𝑉 can be written as a function of U(𝑖,𝑗+1) , U(𝑖,𝑗) and U(𝑖,𝑗−1) .
4.2. Inviscid Flux. Reconstruction. To compute the inviscid flux values of the flow variables, velocity and pressure, are required at cell interfaces. The technique applied stores these values only at cell centres, and values at cell interfaces have to be reconstructed every time step. In the case of flow cells this reconstruction is straight forward as all the distances are known, but in the case of cut cells distances are unknown a priori. Also one of the interfaces of cut cells is a fluid/solid interface for solid body and fluid/air interface for free surface, so different boundary conditions and/or free surface conditions have to be applied on them. At fluid/solid(air) interfaces the values of velocities and pressure are only known at one side of the interface. To impose values at the interface the ghost cell technique is applied where a point 𝑅 is defined as mirror point of the centre of the cut cell. The values at the ghost cell 𝑅 are given using information from the fluid depending on the interface presented (fluid/solid or fluid/air). Computation of the ghost point 𝑅 is described in next section and the values on it are described in Section 7 for solid body and in Section 5 for free surface. Once the distances between centroids and interfaces and the values at each side of the interface are known, reconstruction can be computed. Using information of flow, cut and ghost surrounding cells, a gradient is computed within each cell. The value at each point of the cell is calculated using the value at centroid of cell, the distance between the point and the centroid, and the gradient in the cell. So these values for each side of the interface are computed. Once reconstructed values are obtained at each side of the cell interface, a RP is solved providing the value of the inviscid flux at the cell interface.
50
3. NUMERICAL METHOD
Example 3.1. Lets consider cell interface (𝑖+1/2, 𝑗) between cells (𝑖, 𝑗) and (𝑖+1, 𝑗). Reconstructed value of velocities and pressure from cell (𝑖, 𝑗) are denoted by U𝑅 (𝑖+1/2,𝑗) and from cell (𝑖+1, 𝑗) denoted 𝐿 by U(𝑖+1/2,𝑗) , see Figure 3.1. Using these two value a RS is used to obtain the value of the inviscid 𝐿 flux at the interface (𝑖 + 1/2, 𝑗), 𝐹𝑖+1/2,𝑗 = 𝐹 (U𝑅 (𝑖,𝑗) , U(𝑖+1,𝑗) ).
R
L
U(i,j) U(i+1,j)
j
i
i+1
i=1/2
Figure 3.1. Reconstructed values (𝑖 + 1, 𝑗) and U𝐿 (𝑖+1/2,𝑗) at each side of cell interface (𝑖 + 1/2, 𝑗).
4.2.1. Construction of point R. Let’s use Figure 3.2 to illustrate this construction. Consider the line 𝑟1 passing through the point 𝐶 = (𝑥𝐶 , 𝑦𝐶 ) and with vector ⃗𝑛 = (𝑛𝑥 , 𝑛𝑦 ) and line 𝑟2 passing through 𝑆 = (𝑥𝑆 , 𝑦𝑆 ) and vector director ⃗𝑛⊥ = (−𝑛𝑦 , 𝑛𝑥 ). The point 𝐼 is the intersection of both lines 𝑟1 ∩ 𝑟2 . Point 𝑅 = (𝑥𝑅 , 𝑦𝑅 ) belongs to line 𝑟1 at twice the distance of 𝐶 than the distance between 𝐶 and 𝐼 = (𝑥𝐼 , 𝑦𝐼 ) in the direction indicated by ⃗𝑛. (131)
𝑟1 = {(𝑎, 𝑏) ∈ ℝ2
𝑠.𝑡.
∃𝑡 ∈ ℝ :
(𝑎, 𝑏) = 𝐶 + 𝑡⃗𝑛},
(132)
𝑟2 = {(𝑎, 𝑏) ∈ ℝ2
𝑠.𝑡.
∃𝑡 ∈ ℝ :
(𝑎, 𝑏) = 𝑆 + 𝑡⃗𝑛⊥ }.
So the point 𝐼 has to verify both equations at the same time. Consider 𝑝, 𝑡 ∈ ℝ, (133)
⊥
𝐶 + 𝑝⃗𝑛 = 𝑆 + 𝑡⃗𝑛 , If
𝑛𝑦 ∕= 0 ⇒ 𝑝 =
1 𝑛2𝑥 𝑛𝑦
+ 𝑛𝑦
[
] 𝑛𝑥 (𝑆𝑥 − 𝐶𝑥 ) + (𝑆𝑦 − 𝐶𝑦 ) . 𝑛𝑦
And finally,
(134)
{
𝑥𝐼 = 𝑥𝐶 + 𝑝𝑛𝑥 =⇒ 𝑦𝐼 = 𝑦𝐶 + 𝑝𝑛𝑦
{
𝑥𝑅 = 𝑥𝐶 + 2𝑝𝑛𝑥 𝑦𝑅 = 𝑦𝐶 + 2𝑝𝑛𝑦 .
To avoid division by 0, the case 𝑛𝑦 = 0 is computed in a different way. When 𝑛𝑦 = 0 the cut is vertical so if 𝑥𝑆 > 𝑥𝐶 , 𝑥𝑅 = 𝑥𝐶 + 2𝑑(𝐶, 𝑟2 ) and 𝑦𝑆 = 𝑦𝐶 . On the other hand if 𝑥𝑆 < 𝑥𝐶 , 𝑥𝑅 = 𝑥𝐶 − 2𝑑(𝐶, 𝑟2 ) and 𝑦𝑆 = 𝑦𝐶 . Where 𝑑(𝐶, 𝑟2 ) is the distance between the point 𝐶 and 𝑟2 . To compute this distance, just rewrite 𝑟2 as 𝑟2 ≡ 𝐴1 𝑥 + 𝐴2 𝑦 + 𝐴3 = 0, where 𝐴1 = 𝑛𝑥 , 𝐴2 = 𝑛𝑦 and 𝐴3 = 𝑥𝑆 𝑛𝑥 + 𝑦𝑆 𝑛𝑦 . So,
4. FLUX CALCULATION
𝑑(𝐶, 𝑟2 ) =
(135)
51
𝐴1 𝑥𝐶 + 𝐴2 𝑦𝐶 + 𝐴3 √ 𝐴21 + 𝐴22
R E I S C
Figure 3.2. Locate point R. Once the position of the point 𝑅 is known, a value for the ghost cell is defined. The CCCM is applied not only for obstacles (solid walls) but also for the free surface (air): ∙ In the case of the solid wall the no-slip boundary condition is applied. ∙ The case of the free surface (air) will be defined in Chapter 4. 4.2.2. Gradients at the cut cells. The cut cells have at least one neighbouring cell to be a ghost cell. Consider the situation in Figure 3.3 to illustrate the computation of the gradients at cut cells. Cell (𝑖, 𝑗) is a cut cell with common interfaces with flow cells 𝐷𝐸 ((𝑖 + 1, 𝑗)), 𝐸𝐹 ((𝑖, 𝑗 + 1)), 𝐹 𝐴 ((𝑖 − 1, 𝑗)) and 𝐴𝐵 ((𝑖, 𝑗 − 1)), and solid wall 𝐵𝐷. Denote the variables (velocities and pressure) at the centre of the cell (𝑖, 𝑗) as U𝑖,𝑗 and at the centre of the ghost cell (𝑅) as U𝑔 . For each 𝑥 and 𝑦 projection different gradients are computed, one for the fluid and one for the solid. The gradients for the fluid in the 𝑥 (U𝑓𝑥 , U𝑠𝑥 ) and 𝑦 (U𝑓𝑦 , U𝑠𝑦 ) directions are computed as,
(136)
U𝑓𝑥
=𝐺
(
(137)
U𝑓𝑦 = 𝐺
(
U𝑖+1,𝑗 − U𝑖,𝑗 U𝑖,𝑗 − U𝑖−1,𝑗 , Δ𝑥𝑖+(1/2),𝑗 Δ𝑥𝑖−(1/2),𝑗
)
,
U𝑖,𝑗+1 − U𝑖,𝑗 U𝑖,𝑗 − U𝑖,𝑗−1 , Δ𝑦𝑖,𝑗+(1/2) Δ𝑦𝑖,𝑗−(1/2)
)
,
where Δ𝑥𝑖+(1/2),𝑗 = 𝑥𝑖+1,𝑗 − 𝑥𝑖,𝑗 and Δ𝑦𝑖,𝑗+(1/2) = 𝑦𝑖,𝑗+1 − 𝑦𝑖,𝑗 . The gradients of the solid parts needs the projections of the segment 𝐵𝐷 (𝐵𝐶 and 𝐶𝐷) over the Cartesian grid.
(138)
U𝑠𝑥
=𝐺
(
U𝑅 − U𝑖,𝑗 U𝑖,𝑗 − U𝑖−1,𝑗 , Δ𝑥𝑖,𝑅 Δ𝑥𝑖−(1/2),𝑗
)
,
52
3. NUMERICAL METHOD
(i−1,j+1)
(i+1,j+1)
(i,j+1)
F
E
(i+1,j)
(i,j)
(i−1,j)
D A (i,j−1)
B
C R
(i−1,j−1)
Figure 3.3. Gradients for the solid cut cell.
U𝑠𝑦 = 𝐺
(139)
(
U𝑖,𝑗+1 − U𝑖,𝑗 U𝑖,𝑗 − U𝑅 , Δ𝑦𝑖,𝑗+(1/2) Δ𝑦𝑗,𝑅
)
,
where Δ𝑥𝑖,𝑅 = 𝑥𝑅 − 𝑥𝑖,𝑗 and Δ𝑦𝑗,𝑅 = 𝑦𝑖,𝑗+1 − 𝑦𝑅 . The function 𝐺 is the slope limiter function which prevents spurious unbounded oscillations. There are different options to choose this slope limiter function 𝐺 as for example [25, 71, 78, 119, 148]: ∙ Van Leer limiter (140)
𝐺(𝑎, 𝑏) = ∙ Super-B limiter
(141)
𝑎∣𝑏∣ + ∣𝑎∣𝑏 . ∣𝑎∣ + ∣𝑏∣
𝐺(𝑎, 𝑏) = 𝑠 ⋅ max(0, min(2∣𝑏∣, 𝑠 ⋅ 𝑎), min(∣𝑏∣, 2𝑠 ⋅ 𝑎)),
where 𝑠 = sign(𝑏). ∙ Minmod limiter (142)
𝐺(𝑎, 𝑏) = 𝑠 ⋅ max(0, min(∣𝑏∣, 𝑠 ⋅ 𝑎)),
where 𝑠 = sign(𝑏). ∙ k-limiter (143)
𝐺(𝑎, 𝑏) = 𝑠 ⋅ max(0, min(𝑘∣𝑏∣, 𝑠 ⋅ 𝑎), min(∣𝑏∣, 𝑘𝑠 ⋅ 𝑎)),
where 𝑠 = sign(𝑏) and 1 ≤ 𝑘 ≤ 2. ∙ MUSCL limiter
5. THE RIEMANN PROBLEM
(144)
(
(
∣𝑎∣ + ∣𝑏∣ 𝐺(𝑎, 𝑏) = 𝑠 ⋅ max 0, min 2, 2∣𝑏∣, 2 where 𝑠 = sign(𝑏).
53
))
,
During this work the Van Leer limiter has been used. Once the flow and solid gradients in each direction are computed, a weighted average is done to obtain the total gradient in each direction (U𝑥𝑖,𝑗 , U𝑦𝑖,𝑗 ):
(145)
U𝑥𝑖,𝑗 =
Δ𝑥𝑠 U𝑠𝑦 + Δ𝑥𝑓 U𝑓𝑦 Δ𝑦𝑠 U𝑠𝑥 + Δ𝑦𝑓 U𝑓𝑥 and U𝑦𝑖,𝑗 = , Δ𝑦𝑠 + Δ𝑦𝑓 Δ𝑥𝑠 + Δ𝑥𝑓
where Δ𝑥𝑓 = ∣𝐴𝐵∣, Δ𝑥𝑠 = ∣𝐵𝐶∣, Δ𝑦𝑠 = ∣𝐶𝐷∣ and Δ𝑦𝑓 = ∣𝐷𝐸∣. For flow cells, Δ𝑥𝑠 = Δ𝑦𝑠 = 0, so U𝑥 = U𝑓𝑥 and U𝑦 = U𝑓𝑦 . Once the total gradients in cell (𝑖, 𝑗) are computed they can be written in vectorial form ( ∇U) as: (146)
∇U =
[
U𝑥 U𝑦
]
,
so the value of U at every point (𝑥, 𝑦) inside cell (𝑖, 𝑗) has been reconstructed and can be written as, (147)
U(𝑥, 𝑦) = U𝑖,𝑗 + ⃗𝑟 ⋅ ∇U,
where ⃗𝑟 is the normal distance vector from the centre of the cell (𝑖, 𝑗) to the point (𝑥, 𝑦). 5. The Riemann Problem The Riemann Problem (RP) is a PDE that has the form [148], (148)
U𝑡 + F(U)𝑥 = 0,
where the initial condition is piecewise continuous with a jump at one point, for example at 𝑥 = 0,
(149)
U = U0 (𝑥) =
{
U𝐿 U𝑅
𝑖𝑓 𝑖𝑓
𝑥 ≤ 0, 𝑥 > 0.
Thanks to the ACM the pseudo-compressible NSE, (110, 111) are hyperbolic systems, all three eigenvalues of the flux F (in fact of the linearized system using the Jacobian 𝐴 = ∂F/∂U, see Section 5.3) are real and distinct, so their eigenvectors are linearly independent. The solution of the RP contains three jump discontinuities dividing the solution space in four sectors as in Figure 5. Definition 3.2. Characteristics or characteristics curves are curves 𝑥 = 𝑥(𝑡) in the 𝑥 − 𝑡 plane along which the PDE becomes an ODE (Ordinary Differential Equation) [148]. Example 3.3. Lets use this example to understand the previous definition. Consider the following 1-D PDE: (150)
𝑢𝑡 + 𝑎𝑢𝑥 = 0, −∞ < 𝑥 < ∞, 𝑡 > 0,
54
3. NUMERICAL METHOD
with initial condition: (151)
𝑢(𝑥; 0) = 𝑢0 (𝑥).
The solutions are of the form 𝑢(𝑥, 𝑡). Now lets consider a curve 𝑥 = 𝑥(𝑡), so the solutions can be written as: (152)
𝑢(𝑥; 𝑡) = 𝑢(𝑥(𝑡); 𝑡),
and the partial derivative of this solution with respect the time, ∂𝑢 ∂𝑥 ∂𝑢 ∂𝑢 (𝑥(𝑡); 𝑡) = + , ∂𝑡 ∂𝑥 ∂𝑡 ∂𝑡
(153) which is 0 when, (154)
𝑥𝑡 = 𝑎.
For the solutions of this ODE (154) the rate of change of u (153) will be zero, so for a point (𝑥; 𝑡) in the characteristic curve the solution can be written as: (155)
𝑢(𝑥; 𝑡) = 𝑢(𝑥 − 𝑎𝑡; 0) = 𝑢0 (𝑥 − 𝑎𝑡).
The curve 𝑥 = 𝑥(𝑡) is a characteristic curve if the solution of the PDE (150) can be obtained as solutions of the ODE (154). Definition 3.4. Jump discontinuities [51]. ∙ Rarefaction wave is a wave where the front profile travels faster than the tail. The characteristics looks like a fan, see Figure 3.4 (a). ∙ Shock wave is a wave where the front profile travels slower than the tail. The characteristics cross one another, see Figure 3.4 (b). ∙ Contact discontinuity is when the wave travels at a constant speed. The characteristics are parallel, see Figure 3.4 (c). The solution at the left of the first wave is constant U𝐿 , similarly at the right of the last wave the solution will be U𝑅 . In Figure 5, the space between the waves 𝜆1 and 𝜆3 is called star region, and the value of U has to be calculated in this region. This solution U is constant, for the simplification considered in this work, in the space between two waves, so for example in Figure 5 there are 4 constant solutions, both known solutions U𝐿 and U𝑅 as before, and two constant solutions, one between 𝜆1 and 𝜆2 and the last one between 𝜆2 and 𝜆3 . As the eigenvectors of the flux, W1 , W2 and W3 are linearly independent, U𝐿 and U𝑅 can be expressed as a linear combination of them,
(156)
U𝐿 =
3 ∑ 𝑖=1
𝛼𝑖 W𝑖 and U𝑅 =
3 ∑
𝛾𝑖 W 𝑖 ,
𝑖=1
where {𝛼𝑖 }𝑖=1,2,3 and {𝛾𝑖 }𝑖=1,2,3 are constant coefficients. The solution for every point (𝑥, 𝑦) in the star region will be also of the form:
5. THE RIEMANN PROBLEM
UL UL
UR
55
UL
UR
UR b
a
c
U Figure 3.4. (a) Rarefaction wave, (b) Shock wave and (c) Contact discontinuity.
λ1
λ2
t
UL
λ3
UR x 0
Figure 3.5. Division of the space produced by the three waves (𝜆1 , 𝜆2 and 𝜆3 ).
(157)
U(𝑥, 𝑦) =
3 ∑
𝜅𝑖 W 𝑖 ,
𝑖=1
where {𝜅𝑖 }𝑖=1,2,3 are constant coefficients that will have to be found (see for example [148]). In the scheme used in this dissertation a RP is required to be solved at each cell interface of the domain, and to find exact solutions as outlined will be very computationally expensive. A simplification to the RP is made using an approximate solution given by an approximate RS. Using an approximate RS the solution in the star region is simplified (constant in the cases used in this research), so there are only three constant states: at the left of the star region with value U𝐿 , at the right with value U𝑅 , and in the star region with an approximate value U∗ . The are different methods to compute this U∗ value, see for example [15, 51, 78, 148]. 5.1. Roe’s Riemann Solver. The linearized RP (Equations (148) and (149)) can be write as,
56
3. NUMERICAL METHOD
∂𝑈 ∂𝑈 +𝐴 = 0, ∂𝑡 ∂𝑥
(158)
where 𝐴 = ∂𝐹/∂𝑈 which usually is not constant. Roe’s approach [127], consists of replacing matrix ˜ 𝐿 , 𝑈𝑅 ). 𝐴 by a constant matrix 𝐴˜ which is a function of the left and right states of the RP, 𝐴˜ = 𝐴(𝑈 ∂𝑈 ∂𝑈 + 𝐴˜ = 0. ∂𝑡 ∂𝑥
(159)
To be a reasonable approximation of the solution of equations (148 and 149), the matrix 𝐴˜ should satisfy the following conditions: (1) (2) (3)
(160)
𝐴˜ should have 𝑚 real eigenvalues ( system (159) must be hyperbolic), ˜ 𝐿 , 𝑈𝑅 ) → 𝐴 when ∣𝑈𝐿 − 𝑈𝑅 ∣ → 0 (𝐴(𝑈, ˜ 𝐴(𝑈 𝑈 ) = 𝐴(𝑈 )), conservation is satisfied, i.e. for any pair (𝑈1 , 𝑈2 ), the jump Δ𝐹 = 𝐹 (𝑈1 ) − 𝐹 (𝑈2 ) in the flux is related to Δ𝑈 = 𝑈1 − 𝑈2 via the Rankine-Hugoniot condition, ˜ 1 − 𝐴𝑈 ˜ 2 = 𝐴Δ𝑈. ˜ Δ𝐹 = 𝐹 (𝑈1 ) − 𝐹 (𝑈2 ) = 𝐴𝑈
Details about the construction of this solver can be found in [51]. A matrix 𝐴˜ which satisfies the previous conditions is the matrix 𝐴 evaluated at averaged values of ˜ [71], where, the states from each side, U ⎤ ⎡ 𝐿 ⎤ 𝑢 ˜ (𝑢 + 𝑢𝑅 ) ˜ = ⎣ 𝑣˜ ⎦ = 1 ⎣ (𝑣 𝐿 + 𝑣 𝑅 ) ⎦ . U 2 (𝑝𝐿 + 𝑝𝑅 ) 𝑃˜ ⎡
(161)
˜ the matrix whose columns are the right eigenvectors of 𝐴˜ and by Λ the diagonal Denoting by 𝑅 ˜ the flux using Roe’s Riemann matrix consisting of the absolute values of the eigenvalues of 𝐴, approximation at the star region, denoted by 𝐹𝑅𝑜𝑒 , can be written as,
𝐹𝑅𝑜𝑒 =
(162)
1 [𝐹𝑅 + 𝐹𝐿 − 𝐷(𝑈𝑅 − 𝑈𝐿 )] , 2
˜ 𝑅˜−1 [117]. where 𝐷 = 𝑅Λ
5.2. HLL Riemann Solver. The name is taken from the initials of Harten, Lax and Van Leer [53]. The idea is to compute the wave speeds 𝑆𝐿 and 𝑆𝑅 at which infinitely thin waves separate the star region from the left and right states. The value at the star region is obtained using the Rankine-Hugoniot condition (160) to both waves. Different methods to compute the wave speeds 𝑆𝐿 and 𝑆𝑅 can be found for example in [51, 78, 148]. The values for the wave speeds used in this dissertation are: (163)
𝑆𝐿 = min(𝑢𝐿 − 𝑐𝐿 , 𝑢𝑅 − 𝑐𝑅 ); 𝑆𝑅 = max(𝑢𝐿 + 𝑐𝐿 , 𝑢𝑅 + 𝑐𝑅 ).
5. THE RIEMANN PROBLEM
57
The value of F in the star region denoted by F𝐻𝐿𝐿 can be written as (see details in [15, 51, 148]), (164)
F𝐻𝐿𝐿 = 𝑡1 F𝑅 + 𝑡2 F𝐿 − 𝑡3 (U𝑅 − U𝐿 ),
where
(165)
𝑡1 =
min(𝑆𝑅 , 0) − 𝑚𝑖𝑛(0, 𝑆𝐿 ) 𝑆𝑅 ∣𝑆𝐿 ∣ − 𝑆𝐿 ∣𝑆𝑅 ∣ , 𝑡2 = 1 − 𝑡1 , and 𝑡3 = . 𝑆𝑅 − 𝑆𝐿 2(𝑆𝑅 − 𝑆𝐿 )
5.3. Matrix A. The RP is linearized using the Jacobian matrix of function F. This matrix is computed as, ⎡ 2𝑢𝑛𝑥 + 𝑣𝑛𝑦 ∂F 𝑣𝑛𝑥 =⎣ 𝐴= ∂U 𝛽𝑛𝑥
(166)
𝑢𝑛𝑦 𝑢𝑛𝑥 + 2𝑣𝑛𝑦 𝛽𝑛𝑦
⎤ 𝑛𝑥 𝑛𝑦 ⎦ 0
The RP solved in this work are always 1-D, and the flux function F is split in the 𝑥 and 𝑦 directions obtaining, ⎡
⎤ 𝑢2 + 𝛽𝑝 ⎦ 𝑢𝑣 F𝑥 = ⎣ 𝑢
(167)
and
⎡
⎤ 𝑢𝑣 F𝑦 = ⎣ 𝑣 2 + 𝛽𝑝 ⎦ 𝑣
Matrix 𝐴 will also be split in each direction, 𝐴𝑥 and 𝐴𝑦 ,
(168)
⎡
2𝑢 ∂F =⎣ 𝑣 𝐴𝑥 = ∂U 𝛽 𝑥
0 𝑢 0
⎤ ⎡ 1 𝑣 𝑦 ∂F 0 ⎦ ; 𝐴𝑦 = =⎣ 0 ∂U 0 0
𝑢 2𝑣 𝛽
⎤ 0 1 ⎦. 0
For the Roe’s RS the matrix 𝐷 which is the multiplication of matrices 𝑅 (the columns being the right eigenvectors of 𝐴), Λ (absolute values of the eigenvalues of 𝐴 in the main diagonal) and 𝐿 (the rows being the left eigenvectors of 𝐴) are also needed for each direction. Defining 𝑐𝑥 =
(169)
√
𝑢2 + 𝛽
𝑐𝑦 =
√
𝑣 2 + 𝛽,
the diagonal matrices with the absolute values of the eigenvalues of 𝐴𝑥 and 𝐴𝑦 are
(170)
⎡
∣𝑢∣ Λ𝑥 = ⎣ 0 0
0 ∣𝑢 + 𝑐𝑥 ∣ 0
⎡ ⎤ 0 ∣𝑣∣ ⎦ and Λ𝑦 = ⎣ 0 0 ∣𝑢 − 𝑐𝑥 ∣ 0
0 ∣𝑣 + 𝑐𝑦 ∣ 0
⎤ 0 ⎦. 0 ∣𝑣 − 𝑐𝑦 ∣
For simplicity the elements of the matrix Λ are going to be denoted by 𝜆𝑥𝑖 , 𝜆𝑦𝑖 with 𝑖 = 1, 2, 3 depending on the direction. The right matrices 𝑅𝑥 and 𝑅𝑦 , with the right eigenvectors of 𝐴𝑥 as columns are,
58
3. NUMERICAL METHOD
⎡
𝑐𝑥 𝜆2𝑥 𝑣𝜆2𝑥 𝑐𝑥
0 𝑅𝑥 = ⎣ 1 0
(171)
⎤ 𝑐𝑥 𝜆3𝑥 −𝑣𝜆3𝑥 ⎦ 𝑐𝑥
and
⎡
1 𝑅𝑦 = ⎣ 0 0
𝑢𝜆2𝑦 𝑐𝑦 𝜆2𝑦 𝑐𝑦
⎤ −𝑢𝜆3𝑦 𝑐𝑦 𝜆3𝑦 ⎦ , 𝑐𝑦
and the left matrices 𝐿𝑥 and 𝐿𝑦 with the left eigenvectors of 𝐴𝑥 as rows are,
(172)
⎡ −𝑢𝑣 1 𝐿𝑥 = 2 ⎣ 1/2 𝑐 −1/2
𝑐2𝑥 0 0
⎤ −𝑣𝛽 −𝜆3𝑥 /2 ⎦ 𝜆2𝑥 /2
and
Finally matrices 𝐷𝑥 and 𝐷𝑦 have the following form,
(173)
⎡ 2 𝑐𝑦 1 𝐿𝑦 = 2 ⎣ 0 𝑐 0
−𝑢𝑣 1/2 −1/2
⎤ −𝑢𝛽 −𝜆3𝑦 /2 ⎦ . 𝜆2𝑦 /2
𝐷𝑥 = 1 𝑐2𝑥
[
(𝑐𝑥 /2)(𝜆2 ∣𝜆2 ∣ − 𝜆3 ∣𝜆3 ∣) 𝑣(−∣𝜆1 ∣𝑢 + (𝜆2 ∣𝜆2 ∣ + 𝜆3 ∣𝜆3 ∣/2)) (𝑐𝑥 /2)(∣𝜆2 ∣ − ∣𝜆3 ∣)
0 ∣𝜆1 ∣𝑐2𝑥 0
(𝑐𝑥 𝜆2 𝜆3 /2)(∣𝜆3 ∣ − ∣𝜆2 ∣) −(𝑣𝛽∣𝜆1 ∣) − (𝑣𝜆2 𝜆3 /2)(∣𝜆2 ∣ + ∣𝜆3 ∣) (𝑐𝑥 /2)(𝜆2 ∣𝜆3 ∣ − 𝜆3 ∣𝜆2 ∣)
]
and
(174)
𝐷𝑦 = 1 𝑐2𝑦
[
∣𝜆1 ∣𝑐2𝑦 0 0
𝑢(−∣𝜆1 ∣𝑣 + (𝜆2 ∣𝜆2 ∣ + 𝜆3 ∣𝜆3 ∣/2)) (𝑐𝑦 /2)(𝜆2 ∣𝜆2 ∣ − 𝜆3 ∣𝜆3 ∣) (𝑐𝑦 /2)(∣𝜆2 ∣ − ∣𝜆3 ∣)
−(𝑢𝛽∣𝜆1 ∣) − (𝑢𝜆2 𝜆3 /2)(∣𝜆2 ∣ + ∣𝜆3 ∣) (𝑐𝑦 𝜆2 𝜆3 /2)(∣𝜆3 ∣ − ∣𝜆2 ∣) (𝑐𝑦 /2)(𝜆2 ∣𝜆3 ∣ − 𝜆3 ∣𝜆2 ∣)
]
.
6. Merged Cells Contributions In Section 3 is explained how the CCCM deals with the merged cells, see Figure 2.11. The contributions of mass and momentum from the small cell 𝐴 are transmitted to the bigger cell 𝐵. Consider the merged cell to be denoted as 𝐶 and the area Ω𝐶 = Ω𝐴 + Ω𝐵 . The value of velocities and pressure at the centre of the merged cell 𝐶 is the weighted average of the values of cells 𝐴 and 𝐵, U𝑛𝐶 =
(175)
U𝑛𝐴 Ω𝐴 + U𝑛𝐵 Ω𝐵 . Ω𝐴 + Ω𝐵
The case of the flux is similar, as the total flux across cell 𝐶 is the sum of the fluxes across 𝐴 and 𝐵, (176)
∑
𝑙∈∂Ω𝐶
(FS)𝑙 =
∑
𝑙∈∂Ω𝐴
(FS)𝑙 +
∑
(FS)𝑙 .
𝑙∈∂Ω𝐵
Obviously there is a common interface 𝑙𝐴𝐵 that is in the fluxes from 𝐴 and 𝐵 and should not be considered in the flux of merged cell 𝐶. This interface has the same absolute value and different sign in each of the independent fluxes, so their contribution to the flux of 𝐶 is zero. 6.1. Moving bodies/free surface. As described in Section 3.1, two different situations are considered:
7. BOUNDARY CONDITIONS
59
∙ “Merging independent cells”. At time 𝑡 = 𝑡𝑛 cell 𝐴 is a cut cell, and at time 𝑡 = 𝑡𝑛+1 the solid body has “moved in” and the area of cut cell 𝐴 is reduced. At time 𝑡 = 𝑡𝑛 there are two separated cells 𝐴 and 𝐵 and at time 𝑡 = 𝑡𝑛+1 both cells are merged to form cell 𝐶. Calculating time step 𝑡 = 𝑡𝑛+1 the values of velocity and pressure are required at cell 𝐶 at time 𝑡 = 𝑡𝑛 , but this cell does not exist as cells 𝐴 and 𝐵 are still independent. Cell 𝐶 at time 𝑡 = 𝑡𝑛 is considered to be the sum of cells 𝐴 and 𝐵 at time 𝑡 = 𝑡𝑛 (for simplicity lets denote cell 𝐶 at time 𝑡 = 𝑡𝑛 by 𝐴 + 𝐵). As before, a weighted average is used to define the value of non-existing cell 𝐶 at time 𝑡 = 𝑡𝑛 (𝐴 + 𝐵), i.e. (177)
U𝑛𝐶 = U𝑛𝐴+𝐵 =
U𝑛𝐴 Ω𝐴 + U𝑛𝐵 Ω𝐵 . Ω𝐴 + Ω𝐵
So formula (124) results, (178)
Ω(𝑖,𝑗) 1 (𝐼 − 𝐼0 )∂U𝐶 + 𝐼0 (Ω𝐶 U𝑚+1 − Ω𝐴+𝐵 U𝑛𝐴+𝐵 ) 𝐶 Δ𝜏 Δ𝑡 +
(
∑
𝑙∈∂Ω𝐶
(FS)𝑙 − BΩ𝐶
)𝑚+1
= 0,
where ∂U𝐶 = U𝑚+1 − U𝑚 𝐶 , and Ω𝐴+𝐵 = Ω𝐴 + Ω𝐵 . 𝐶 ∙ “Separation of merged cells”. At time 𝑡 = 𝑡𝑛 cell 𝐴 is merged with cell 𝐵 in super-cell 𝐶, at time 𝑡 = 𝑡𝑛+1 the solid body has “moved out” and the area of cut cell 𝐴 is increased. At time 𝑡 = 𝑡𝑛 there is only one merged cell 𝐶 and at 𝑡 = 𝑡𝑛+1 there are two separated cells 𝐴 and 𝐵. In an analogous process, the values of velocities and pressure at cells 𝐴 and 𝐵 at time 𝑡 = 𝑡𝑛 are defined using the values at cell 𝐶 at time 𝑡 = 𝑡𝑛 and the kind of boundary presented. In the case of free surface where the gradient of the velocities is zero and the value of the pressure also zero, the values are considered as:
(179)
⎧ 𝑛 ⎨ 𝑢𝐴 = 𝑢𝑛𝐶 𝑛 𝑣 𝑛 = 𝑣𝐶 ⎩ 𝐴 Ω𝐴 𝑛 𝑝𝐴 = 𝑝𝑛𝐶 Ω 𝐶
⎧ 𝑛 ⎨ 𝑢𝐵 = 𝑢𝑛𝐶 𝑛 𝑣 𝑛 = 𝑣𝐶 and ⎩ 𝐵 𝑛 𝐵 𝑝𝐵 = 𝑝𝑛𝐶 Ω Ω𝐶 .
⎧ 𝑛 𝑛 Ω ⎨ 𝑢𝐴 = 𝑢𝐶 Ω𝐶𝐴 𝑛 𝑛 Ω𝐴 𝑣 = 𝑣 𝐶 Ω𝐶 ⎩ 𝐴 𝑝𝑛𝐴 = 𝑝𝑛𝐶
⎧ 𝑛 𝑛 Ω ⎨ 𝑢𝐵 = 𝑢𝐶 Ω𝐵 𝐶 𝑛 𝑛 𝐵 and 𝑣𝐵 = 𝑣𝐶 Ω Ω 𝐶 ⎩ 𝑛 𝑝𝐵 = 𝑝𝑛𝐶 .
In the case of solid body where the gradient of the pressure is zero and the value of the velocities also zero, the values are considered as:
(180)
The flux is only required at time 𝑡 = 𝑡𝑛+1 when cells 𝐴 and 𝐵 are already separated, so formula (124) is not modified once the values at cells 𝐴 and 𝐵 at time 𝑡 = 𝑡𝑛+1 are defined.
7. Boundary Conditions The ghost cell technique is applied during this study to deal with boundary conditions as explained in Section 4.2.2. Ghost cells are cells just outside the computational domain with information about the fluid variables helping the computation of the boundary conditions. The centre of the ghost cell is denoted as point 𝑅 which is a mirror point of the centroid of the interior cell, the construction of this point is described in Section 4.2.1.
60
3. NUMERICAL METHOD
Example 3.5. Consider cell (𝑖, 𝑗) being a cell at the boundary of the domain, cell (𝑖𝑔 , 𝑗𝑔 ) denotes the ghost cell which is constructed to have the same area, same shape and common boundary interface with cell (𝑖, 𝑗), see Figure 3.6. Point 𝑅 is the centre of cell (𝑖𝑔 , 𝑗𝑔 ), see Section 4.2.1, in the defined by the normal vector of the boundary and passing through the centre of cell (𝑖, 𝑗). The distance between the centre of cell (𝑖, 𝑗) and the boundary is the same that between point 𝑅 and the boundary.
(i,j)
(ig ,jg )
Figure 3.6. Boundary cell (𝑖, 𝑗) and its ghost cell (𝑖𝑔 , 𝑗𝑔 ). Consider the computational domain Ω = [𝑎, 𝑏]×[𝑐, 𝑑] with a mesh 𝜒 = {(𝑖, 𝑗) : 𝑖 = 1, 2, . . . , 𝑁 and 𝑗 = 1, 2, . . . , 𝑀 }. The ghost cell technique is explained over the boundaries 𝑥 = 𝑎 and 𝑥 = 𝑏. A set of ghost cells is defined at each boundary, {(0, 𝑗) : 𝑗 = 1, 2, . . . , 𝑀 } at 𝑥 = 𝑎 and {(𝑀 + 1, 𝑗) : 𝑗 = 1, 2, . . . , 𝑀 } at 𝑥 = 𝑏, see Figure 3.7.
M
1 0
1
2
N
N+1
Figure 3.7. Mesh 𝜒 with ghost cells at boundaries 𝑥 = 𝑎, {(0, 𝑗) : 𝑗 = 1, 2, . . . , 𝑀 } and 𝑥 = 𝑏, {(𝑀 + 1, 𝑗) : 𝑗 = 1, 2, . . . , 𝑀 }. The values of fluid variables at ghost cells depends on the kind of boundary condition presented in each situation. These values are assigned before the computation for the next time (pseudo or real) step starts. The free surface boundary condition is described in Chapter 4. The number of conditions that have to be imposed at boundaries depends on the number of incoming characteristics [78], i.e. the number of positive and negative eigenvalues. As ∣𝑐𝑥 ∣ > ∣𝑢∣ and ∣𝑐𝑦 ∣ > ∣𝑣∣
7. BOUNDARY CONDITIONS
61
(𝛽 > 0), there is always one eigenvalue positive, one negative and the third depends on the value of 𝑢 (𝑣) that means one or two conditions are needed at each boundary. For the extra boundary values first order linear extrapolation from interior points is applied. 7.1. Periodic. Periodic conditions are easy to implement. The idea is that what leaves from one end of the domain enters the domain from the other end, so the information at the left of the first cell is the information from the last cell. Consider periodic boundaries at 𝑥 = 𝑎 and 𝑥 = 𝑏, values at ghost cells are, (181)
Q𝑛0,𝑗 = Q𝑛𝑁,𝑗 and Q𝑛𝑁 +1,𝑗 = Q𝑛1,𝑗 , 𝑗 = 1, 2, . . . 𝑀.
7.2. Solid. At solid (impermeable) walls there is no flux through the boundary [39]. The boundary can be slip, fluid moves with tangential velocity at the boundary and are used mainly in small (nano) scales [40], or no-slip, all velocities at the boundary are zero and are widely used in the simulation of viscous flows [116]. In this research the slip boundary condition is applied at solid walls in inviscid flows, while the no-slip condition is used in viscous flows. A solid boundary condition is considered at 𝑥 = 𝑎. The velocity of the body is denoted by ⃗𝑏 = (𝑢𝑏 , 𝑣𝑏 )𝑇 (𝑉 ⃗𝑏 = ⃗0 for static solid conditions), velocity at the centre of the ghost cell (point 𝑉 ⃗ ⃗ = (𝑢, 𝑣)𝑇 . The slip condition considered 𝑅) by 𝑉𝑔 = (𝑢𝑔 , 𝑣𝑔 )𝑇 and at the interior node simply as 𝑉 states as: (182)
⃗ −𝑉 ⃗𝑏 ) ⋅ ⃗𝑛∣𝑥=𝑎 = 0 and ∇𝑝∣𝑥=𝑎 = 0. (𝑉
While no-slip conditions are: (183)
⃗ −𝑉 ⃗𝑏 )∣𝑥=𝑎 = 0 and ∇𝑝∣𝑥=𝑎 = 0. (𝑉
The normal and/or tangential velocity of the fluid at the boundary is zero. This velocity is computed as the average of the velocities at the centre of the ghost and interior cells minus the velocity of ⃗𝑏 in case it moves. Using this condition, the value of the velocities at the centre of the the solid, 𝑉 ghost cells are defined. The tangential direction of the velocity in the case of the slip conditions is not determinated, and therefore it is extrapolated from the interior values. In the case considered before, 𝑥 = 𝑎, the values at the centre of the ghost cell in the slip condition case is:
(184)
Q𝑛0,𝑗
⎡
⎤ −𝑢 − 2𝑢𝑏 ⎦ , 𝑗 = 1, 2, . . . 𝑀, −𝑣 =⎣ 𝑝
while in the no-slip condition case is:
(185)
Q𝑛0,𝑗
⎡
⎤ −𝑢 − 2𝑢𝑏 = ⎣ −𝑣 − 2𝑣𝑏 ⎦ , 𝑗 = 1, 2, . . . 𝑀. 𝑝
In both cases the fluxes at boundary in 𝑥 and 𝑦-directions are:
62
3. NUMERICAL METHOD
⎡
⎤ 𝛽𝑝 F𝑥 = ⎣ 0 ⎦ 0
(186)
and
⎡
⎤ 0 F𝑦 = ⎣ 𝛽𝑝 ⎦ . 0
7.3. Inflow. Fluid enters the domain from the inflow boundary. The velocity of the incoming ⃗𝑖𝑛 = (𝑢𝑖𝑛 , 𝑣𝑖𝑛 )𝑇 will be given to the ghost cell, while the pressure is extrapolated from the fluid 𝑉 interior points. Consider an inflow condition at boundary 𝑥 = 𝑎,
Q𝑛𝑁 +1,𝑗
(187)
So the fluxes at boundaries are:
(188)
⎤ 𝑢𝑖𝑛 = ⎣ 𝑣𝑖𝑛 ⎦ , 𝑗 = 1, 2, . . . 𝑀. 𝑝1,𝑗 ⎡
⎤ 𝑢2∗ + 𝛽𝑝∗ F𝑥 = ⎣ 𝑢∗ 𝑣 ∗ ⎦ 𝑢 ⎡
and
⎤ 𝑢∗ 𝑣 ∗ F𝑦 = ⎣ 𝑣∗2 + 𝛽𝑝∗ ⎦ , 𝑣∗ ⎡
where (𝑢∗ , 𝑣∗ , 𝑝∗ ) are the solution of the RP produced by the inflow values and the values at the first node. 7.4. Outflow. The condition is set for the fluid to leave the domain freely. The condition at ghost cells is obtained by extrapolation from the values at interior points, so the values at the ghost cells depends on the values inside the domain. Consider an outflow condition at boundary 𝑥 = 𝑏, using a simple linear extrapolation (gradients of velocities and pressure to be zero) the conditions are, Q𝑛𝑁 +1,𝑗 = Q𝑛𝑁,𝑗 , 𝑗 = 1, 2, . . . 𝑀.
(189)
So the fluxes at boundaries are:
(190)
⎤ 𝑢2𝑁,𝑗 + 𝛽𝑝𝑁,𝑗 ⎦ F𝑥 = ⎣ 𝑢𝑁,𝑗 𝑣𝑁,𝑗 𝑢 ⎡
and
⎡
⎤ 𝑢𝑁,𝑗 𝑣𝑁,𝑗 2 + 𝛽𝑝𝑁,𝑗 ⎦ . F𝑦 = ⎣ 𝑣𝑁,𝑗 𝑣𝑁,𝑗
8. Linearization Now that the flux between cells is known, the aim is to rewrite equation (124) having the unknowns at the LHS and the known values at the RHS. Using the same notation as in equation (124) this becomes,
(191)
⎛ ⎞𝑚+1 ∑ Ω(𝑖,𝑗) Ω(𝑖,𝑗) (𝐼 − 𝐼0 )∂U(𝑖,𝑗) + 𝐼0 ∂U(𝑖,𝑗) + ⎝ (FS)𝑙 − BΩ(𝑖,𝑗) ⎠ Δ𝜏 Δ𝑡 𝑙∈∂Ω(𝑖,𝑗)
=−
Ω(𝑖,𝑗) 𝑛 𝐼0 (U𝑚 (𝑖,𝑗) − U(𝑖,𝑗) ). Δ𝑡
8. LINEARIZATION
63
The ideal is the LHS to be a function of {∂U𝑚 (𝑘,𝑙) : (𝑘, 𝑙) ∈ {(𝑖, 𝑗), (𝑖 + 1, 𝑗), (𝑖, 𝑗 + 1), (𝑖 − 1, 𝑗), (𝑖, 𝑗 − 1)}}. The flux at pseudo-time 𝑚+1 is linearized by writing it as a function of the flux at pseudo-time 𝑚 using Taylor expansion [71],
(192)
F
=F +
(
(
=
𝑚+1
𝑚
∂F ∂𝜏
)𝑚
Δ𝜏 + 𝒪[Δ𝜏 2 ],
using the Chain Rule.
(193)
∂F ∂𝜏
)𝑚
(
∂F ∂U
)𝑚
∂U . ∂𝜏
The flux at cell interfaces are the solution of RP depending in the velocities and pressure at both sides of the interface, so the flux is a function of both states, F = F(U𝐿 , U𝑅 ) and using the Chain Rule,
(194)
(
∂F ∂𝜏
)𝑚
=
(
∂F0 ∂U𝐿
)𝑚
∂U𝐿 + ∂𝜏
(
∂F0 ∂U𝑅
)𝑚
∂U𝑅 . ∂𝜏
It is possible to approximate ∂U𝐿 /∂𝜏 and ∂U𝑅 /∂𝜏 as,
(195)
(U𝐿 )𝑚+1 − (U𝐿 )𝑚 ∂U𝐿 ∂U𝐿 = ≃ , ∂𝜏 Δ𝜏 Δ𝜏
(196)
∂U𝑅 (U𝑅 )𝑚+1 − (U𝑅 )𝑚 ∂U𝑅 = ≃ , ∂𝜏 Δ𝜏 Δ𝜏
so equation (194) can be written as,
(197)
(
∂F ∂𝜏
)𝑚
≃
(
∂F ∂U𝐿
)𝑚
∂U𝐿 + Δ𝜏
(
∂F ∂U𝑅
)𝑚
∂U𝑅 . Δ𝜏
The partial derivative of the flux is written as a function of the partial derivative of the states at each side of the interface. Still the Jacobians ∂F/∂U𝐿 and ∂F/∂U𝑅 are unknowns. The form of these Jacobians depends on the RS used, as the expression of the flux change depends on it. The expression of the flux using Roe’s RS is given in equation (162), neglecting the terms coming from the derivatives of 𝐷 with respect to U𝐿 and U𝑅 the Jacobians results,
(198)
𝐴+ =
] ∂F0 1[ ≃ 𝐴(U𝐿 ) + 𝐷 , 𝐿 ∂U 2
(199)
𝐴− =
] 1[ ∂F0 ≃ 𝐴(U𝑅 ) − 𝐷 . 𝑅 ∂U 2
The expression of the flux using the HLL RS is given in equation (164) and the Jacobians results,
64
3. NUMERICAL METHOD
(200)
𝐴+ =
∂F𝐻𝐿𝐿 ≃ 𝑡2 𝐴(U𝐿 ) + 𝑡3 𝐼, ∂U𝐿
(201)
𝐴− =
∂F𝐻𝐿𝐿 ≃ 𝑡1 𝐴(U𝑅 ) − 𝑡3 𝐼. ∂U𝑅
Then being careful in the expression of 𝐴+ and 𝐴− used, equation (197) can be written as, (
(202)
∂F ∂𝜏
)𝑚
≃
and applying it to (192),
] 1 [ + 𝐴 ∂U𝐿 + 𝐴− ∂U𝑅 , Δ𝜏
+ 𝐿 − 𝑅 F𝑚+1 = F𝑚 𝑖 + 𝐴 ∂U + 𝐴 ∂U . 𝑖
(203)
The source B from equation (124) can be also linearized as follows, B𝑚+1 ≃ B𝑚 + 𝐺∂U,
(204)
where 𝐺 = ∂B/∂U. In our case, B = 𝑔⃗𝑗, 𝐺 = diag(0, 𝑔, 0) Then it is possible to write the flux at 𝑚 + 1 in function of
(205)
⎛ ⎝
∑
𝑙∈∂Ω(𝑖,𝑗)
⎞𝑚+1
(FS)𝑙 − BΩ(𝑖,𝑗) ⎠
⎛ ⎝
=
∑
𝑙∈∂Ω(𝑖,𝑗)
⎞𝑚
⎛
(FS)𝑙 − BΩ(𝑖,𝑗) ⎠ + ⎝
∑
𝑙∈∂Ω(𝑖,𝑗)
Using this expression to rewrite equation (191) results,
(206)
(∂FS)𝑙 ⎠ − 𝐺∂U
⎞𝑚 ⎛ ∑ Ω(𝑖,𝑗) Ω(𝑖,𝑗) (𝐼 − 𝐼0 )∂U(𝑖,𝑗) + 𝐼0 ∂U(𝑖,𝑗) + ⎝ (∂FS)𝑙 ⎠ − 𝐺∂U(𝑖,𝑗) Δ𝜏 Δ𝑡 𝑙∈∂Ω(𝑖,𝑗) ⎛ ⎞𝑚 ∑ Ω(𝑖,𝑗) 𝑛 ⎝ =− 𝐼0 (U𝑚 (FS)𝑙 − BΩ(𝑖,𝑗) ⎠ , (𝑖,𝑗) − U(𝑖,𝑗) ) + Δ𝑡 𝑙∈∂Ω(𝑖,𝑗)
which can be rewritten in compact form as,
(207)
⎞𝑚
⎛ ⎞𝑚 ∑ Ω (𝐼 + 𝐻) ∂U + ⎝ (∂FS)𝑙 ⎠ = −𝑅, Δ𝜏 𝑙∈∂Ω(𝑖,𝑗)
9. LINEAR SYSTEM
65
where,
(208)
𝐻=
𝑅=
(209)
(
) Δ𝜏 − 1 𝐼0 − Δ𝜏 𝐼𝜃 𝐺𝑚 , Δ𝑡 ⎛
Ω 𝐼0 (U𝑚 − U𝑛 ) + ⎝ Δ𝑡
∑
𝑙∈∂Ω(𝑖,𝑗)
⎞𝑚
(FS)𝑙 − BΩ(𝑖,𝑗) ⎠ .
Adding the pseudo-time derivative also to the conservation of momentum, H results
𝐻=
(210)
Δ𝜏 𝐼0 − Δ𝜏 𝐼𝜃 𝐺. Δ𝑡
9. Linear System Equation (206) which is a rewritten version of equation (124) can be extended,
(211)
] [ Ω − + − − 𝐴 + 𝐴 ∂U𝑖𝑗 (𝐼 + 𝐻) ∂U𝑖𝑗 + 𝐴+ 1 1 − 𝐴 1 1 𝑖− 2 𝑗 𝑖𝑗+ 2 𝑖𝑗− 2 𝑖+ 2 𝑗 Δ𝜏 ] [ + − + = −𝑅, 𝐴− 1 ∂U𝑖+1𝑗 − 𝐴 1 ∂U𝑖−1𝑗 + 𝐴 1 ∂U𝑖𝑗+1 − 𝐴 1 ∂U𝑖𝑗−1 𝑖+ 𝑗 𝑖− 𝑗 𝑖𝑗+ 𝑖𝑗− 2
2
2
2
which is a system with unknown ∂U. Notice the dependency on the RS to write matrices 𝐴+ and 𝐴− , and obviously the expression of the flux. Once the system (211) is solved and the solution ∂U is known, the update of the solution in pseudo-time is as simple as, U𝑚+1 = U𝑚 + ∂U.
(212)
The system can be written in matrix form with a huge system matrix 𝒜, so the solution ∂U being the solution of a linear system, (213)
𝒜∂U = 𝑅.
Notation 3.6. Define the nonation to be used in the construction of 𝒜. When computing cell (𝑖, 𝑗): ∙ 𝐶𝑖,𝑗 denotes the contribution from ∂U𝑖,𝑗 to the matrix 𝒜,
∙ 𝑅𝑖,𝑗 (215)
] [ Ω − − 𝐴− + 𝐴+ , (𝐼 + 𝐻) + 𝐴+ 1 1 − 𝐴 1 1 𝑗 𝑖− 𝑗 𝑖𝑗+ 𝑖𝑗− 𝑖+ 2 2 2 2 Δ𝜏 denotes the contribution from ∂U𝑖+1,𝑗 to the matrix 𝒜, 𝐶𝑖,𝑗 =
(214)
𝑅𝑖,𝑗 = 𝐴− , 𝑖+ 1 𝑗 2
∙ 𝑇𝑖,𝑗 denotes the contribution from ∂U𝑖,𝑗+1 to the matrix 𝒜, (216)
𝑇𝑖,𝑗 = 𝐴− , 𝑖𝑗+ 1 2
66
3. NUMERICAL METHOD
∙ 𝐿𝑖,𝑗 denotes the contribution from ∂U𝑖−1,𝑗 to the matrix 𝒜, , 𝐿𝑖,𝑗 = −𝐴+ 𝑖− 1 𝑗
(217)
2
∙ 𝐵𝑖,𝑗 denotes the contribution from ∂U𝑖,𝑗−1 to the matrix 𝒜, 𝐵𝑖,𝑗 = −𝐴+ . 𝑖𝑗− 1
(218)
2
All these contributions are 3 × 3 matrices so matrix 𝒜 is penta-diagonal by blocks (matrices 3 × 3): (219)
𝒜= ⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣
𝐶1,1 𝐿2,1
𝑅1,1 𝐶2,1
0 𝑅2,1
... 0
0 ...
𝑇1,1 0
0 𝑇2,1
... 0
... ...
... ...
... ...
... ...
... ...
... ...
..
.
..
..
.
..
.
..
.
..
.
..
..
.
..
.
..
.
..
..
..
..
..
.
..
..
.
..
.
..
.
..
.
..
..
.
..
.
..
.
..
0 ..
.
.. .. .. 0
. ... ..
0 ..
𝐶𝑁,1
0
..
..
..
𝐵𝑖,𝑗
. ...
.
..
.
..
.
..
.
..
.
..
.
..
.
..
.
..
.
..
.
..
. ...
..
.
𝐿𝑁,1
. ...
0 ..
.
. ...
..
0
.
..
.
..
.
..
. ...
.
..
.
.
. ... ..
0 ..
.
.
𝑇𝑁,1
0
. ...
..
..
..
𝐿𝑖,𝑗
𝐶𝑖,𝑗
𝑅𝑖,𝑗
0
.
..
.
..
.
..
.
..
.
..
.
..
.
..
.
..
.
..
.
..
.
..
.
..
.
..
. ...
..
. ...
..
. ...
.. 0
.
..
..
..
𝑇𝑖,𝑗
0
.
..
.
..
.
..
.
..
.
..
.
..
.
..
.
..
.
..
.
..
0
. ...
..
. ...
..
. 𝐵𝑁,𝑀
..
.
. ...
.
..
.
. ...
. ...
.
.
.. 0
.
. ...
. ...
.
..
.
..
.
.
..
.
..
.
.
..
.
..
.
.
..
. 𝐿𝑁,𝑀
..
. 𝐶𝑁,𝑀
⎤
⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥. ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦
9.1. Solving the linear System. The matrix of the linear system (219) is sparse, the number of non-zero elements in the matrix is very small, in fact there are only 15 elements per row/column that can be non-zero. Also the specific form of the matrix, penta-diagonal by blocks, indicates the position of these elements a priori. For this kind of matrix there are different efficient solvers as the Approximate Lower Upper (ALU) solver used in this research which was developed by Pan and Lomax [112]. In this method the matrix 𝒜 is divided into 3 matrices, ℒ is lower diagonal, 𝒟 diagonal and 𝒰 upper diagonal in the way that, (220)
𝒜 = (ℒ + 𝒟 + 𝒰 ).
Instead of solving the system 𝒜𝑥 = 𝑏, the system solved is, (221)
(𝒟 + ℒ)𝒟−1 (𝒟 + 𝒰 )𝑥 = 𝑏.
In this way three very simple linear systems are solved, ∙ A lower diagonal system (𝒟 + ℒ)𝑥1 = 𝑏, ∙ a diagonal system 𝒟−1 𝑥2 = 𝑥1 and ∙ an upper diagonal system (𝒟 + 𝒰 )𝑥 = 𝑥2 . As this is an approximate solver, it means, there is an error,
10. SOLUTION SCHEME
(222)
(𝒟 + ℒ)𝒟−1 (𝒟 + 𝒰 ) = (𝒟 + ℒ)(𝐼 + 𝒟−1 𝒰 ) =
67
𝒟 + ℒ + 𝒰 + ℒ𝒟−1 𝒰 = 𝒜 + ℒ𝒟−1 𝒰 ,
so instead of solving 𝒜𝑥 = 𝑏, the linear system solved is (𝒜 + ℒ𝒟−1 𝒰 )𝑥 = 𝑏, and the error produced (very small in iterative processes) by this method is: (223)
∣∣(ℒ𝒟−1 𝒰 )𝑥∣∣2 .
The structure of matrix 𝒜 is changed when periodic boundary conditions are used. In this case the matrix becomes hepta-diagonal because the contribution at left of the first node is given by the last node. To solve this kind of systems, an external library (HSL MA48) provided by the Harwell Subroutine Library [9] is used. 10. Solution Scheme The solution procedure used in this dissertation uses the following scheme (similar to [70]): (1) Define 𝑡𝑚𝑎𝑥 and 𝜏𝑚𝑎𝑥 as limit (upper bounds) of real time and pseudo-time iterations and the tolerance 𝑡𝑜𝑙, (2) input the values of the variables at the initial condition (𝑛 = 0), (3) initialize the value of the variables at initial pseudo-time (𝑚 = 0), i.e., U𝑛,0 = U𝑛 , (4) compute U𝑛,𝑚+1 according to (207), and update 𝑚 to 𝑚 + 1 until for an index 𝑀 ∣∣U𝑛,𝑀 − U𝑛,𝑀 −1 ∣∣2 < 𝑡𝑜𝑙 or 𝑚 = 𝜏𝑚𝑎𝑥 (then 𝑀 is defined as 𝜏𝑚𝑎𝑥 ), (5) update the real time solution U𝑛+1 to the value U𝑛,𝑀 (U𝑚+1 → U𝑛+1 , 𝑚 + 1 → ∞) and advance the time step from 𝑛 to 𝑛 + 1, (6) repeat from 3 to 5 until 𝑛 = 𝑡𝑚𝑎𝑥 .
CHAPTER 4
Free Surface 1. Introduction The free surface is a boundary that moves according to the flow conditions. The position of the free surface is known at the initial time and its evolution has to be found using flow properties. The free surface defines an upper boundary for the computational domain for the flow. In Chapter 2 it has been shown how to adjust the grid to the computational domain while in Chapter 3 a description of the method to solve for the incompressible NSE has been presented. The methods applied in the literature to describe the movement of the free surface and the boundary conditions applied there are described in this chapter. To solve a PDE one has to know the domain where the PDE will be solved. In the case of a free surface this is not a simple fact, since the free surface will move with time and consequently the domain changes with time. Let’s define the free surface as, (224)
{(𝑥, 𝑦, 𝑧 : 𝑡) such that 𝑧 = 𝜂(𝑥, 𝑦; 𝑡)} ,
then it is possible to write the domain as, (225)
D(𝑥, 𝑦, 𝑧; 𝑡) = [𝑥0 , 𝑥𝑒𝑛𝑑 ] × [𝑦0 , 𝑦𝑒𝑛𝑑 ] × [0, 𝜂(𝑥, 𝑦; 𝑡)] × [𝑡0 , 𝑡𝑒𝑛𝑑 ]
An idea for the solution procedure using the CCCM and ACM follows the scheme: (1) Build the mesh fitting the domain. (2) Compute the pressure and the velocity until convergence in pseudo-time is reached. (3) Move the free surface, according to the velocity vectors (at the new real time) at the free surface. (4) Repeat from 1 to 3 until the steady state or the end of the computation is reached. There are in the literature different methods to locate the free surface (step 3) and therefore to identify the new domain. These methods can be divided into the following categories [39, 125]: ∙ Interface Tracking Methods. These methods focus their attention directly in the evolution in time of the position of the free surface. The position of the fluid which produces the movement of the free surface is not considered. This methods require moving grids adjusting to the free surface. Some of those methods are the Height Function or the Arbitrary Lagrangian-Eulerian (ALE) Method. “The leading question of Interface Tracking methods is: where is the surface? ” [125]. ∙ Interface Capturing Methods, also known as Volume Capturing Methods. These other set of methods compute indirectly the position of the free surface. In a first stage the new position of the fluid is computed, not paying any attention to the free surface, and in a 69
70
4. FREE SURFACE
second stage the position of the free surface is constructed with the position of the fluid obtained at the first stage. Some of these methods are the Marker-and-Cell (MAC), the Volume of Fluid (VoF) or the Level Set. “Here the leading question is: where is the fluid volume? ” [125]. A review of the different methods to compute the free surface can be found in [39, 105, 125]. A description of these methods is given in the following sections. Special attention is given to the Height Function as it is the method used in this study. In Section 5 a description of the boundary conditions applied at the free surface used in the literature is presented. The conditions applied in this research are also shown. 2. Interface Capturing Methods The idea in these kind of methods is to follow the volume of the fluid. Once the volume has been moved and the new position is known, the free surface has to be constructed at the new time step. The methodology in these methods is as follows, (1) solve flow equations, (2) follow the fluid volume, (3) reconstruct the free surface. 2.1. Marker And Cell. The Marker And Cell (MAC) method was introduced by Harlow and Welch in 1965 [52]. A complete review of the method and its development in past years can be found in [97] and recent applications to visco-elastic flows can be seen in [34, 147]. In this method a Cartesian background grid covers beyond the fluid domain. A set of Lagrangian fictitious markers with no mass and no energy are placed in the fluid domain, see Figure 4.1. These markers do not have any influence in the solution of the flow equation. Once the flow velocities are computed the markers are moved using flow velocities at their position.
Figure 4.1. Distribution of markers in the MAC method. As the grid covers more than the flow domain, some cells will have no markers therefore are considered empty. Cells with fluid and empty neighbouring cells will be at the free surface. Any other cell
2. INTERFACE CAPTURING METHODS
71
will be fluid cell. This method can deal with complex situations like breaking waves and fluid detachment, but it is very computationally expensive, especially in 3-D, as it needs to move and store large numbers of markers every time step to obtain good resolution of the free surface. 2.2. Level-Set Method. The Level-Set Method (LSM) was first developed by Osher and Sethian in 1988 [110]. A detailed overview of the method can be found in [109]. “The LSM has been used widely to solve free boundary and moving interface problems because of its simplicity and ability to capture topological changes such as merging and splitting easily and naturally” [48]. The LSM has been used in many different hydrodynamics two phase (water/air) problems, like modelling soap bubbles by Kang et al. [69], oscillating and rotating of a free liquid droplet by Watanabe [156] and droplets entering a flow by Watanabe et al. [157]. Chen and Yu in [29] applied this method in a two phase system to model greenwater effects. Garc´ıa-Espinosa et al. [41] used an overlapping extension of the LSM using FEM to solve NSE in a two phase system. Bet et al. in [16, 17] uses the ACM to study ships hydrodynamics in two phase flows including the LSM equation (227) in the system to be iterated in pseudo-time. Instead of solving a 4 × 4 system (in 3D), they solved a 5 × 5 system for every pseudo-time step. The LSM has also been used with an unsteady RANS solver in two phase system by Chun et al. in [32] and in a single phase system by Carrica et al. [20, 21] and Di Mascio et al. [95]. In the LSM, a function 𝜓(𝑥, 𝑦; 𝑡) is defined at every grid point. The function will measure the distance from every point to the closest point at the free surface. The free surface will be defined by the isoclines 𝜓(𝑥, 𝑦 : 𝑡) = 𝜓0 = 0, where
(226)
⎧ ⎨ >0 , 𝑛 0 , 𝜓𝑖𝑗 = ⎩