Title: Numerical Simulation of Incompressible Viscous Fluids using Finite Differences
1Numerical Simulation of Incompressible Viscous
Fluids using Finite Differences
Ferienakademie 2005 - Sarntal (Italy)
2PART I
- Description of the Sequential Code
Presented by Niko Manopulo
3Agenda
- Introduction and Governing Equations
- Navier Stokes Equations
- Finite Difference Discretization
- The Algorithm
- Derivation of the Pressure Equation
- Overview of the Algorithm
- 3. Obstacles and Free Surface Flows
- Treatment of Obstacles
- Treatment of Free Surface Flows
4Navier Stokes Equations
- Conservation of Mass
- Conservation of Momentum
- Conservation of Energy
5Assumptions
- Incompressible Flow
- Newtonian Fluid
- Constant Temperature
- 2D Cartesian Coordinates
6Simplified Equations
- Conservation of Mass
- Conservation of Momentum
7Boundary Conditions
- No Slip Condition
- Free Slip Condition
- Inflow Condition
- Outflow Condition
8Finite Difference Discretization
- 2nd Order Difference Scheme
- Donor Cell Scheme
- Explicit Time Discretization
9The Staggered Grid
j 1
vi,,j
vi1,,j
ui,,j
ui-1,,j
ui1,,j
j
pi,,j
pi1,,j
vi,,j-1
vi1,,j-1
j - 1
i - 1
i
i 1
i 2
10Solution Domain
Domain Boundary
j jmax 1
j jmax
j 2
j 1
j 0
i 0
i 1
i 2
i imax
i imax1
11Computation of the Pressure
- Consider again the Momentum Equation
12Computation of the Pressure
- Please follow the blackboard
13Calculation of the Time Step
- Adaptive Stepsize Control
- Courant Friedrichs Levi (CFL) Conditions
- Safety factor (t)
14Overview of the Algorithm
15Overview of the Algorithm
16Treatment of Obstacles
- The Flag Matrix
- Cell Marking Loops
17Treatment of Free Boundaries
- Falling Drop Breaking Dam
18Marker and Cell
- Domain Covered with a set of particles
- Loop moving the particles
- Loop marking the cell flags
- Additional set of Flags
- Additional conditions on
- the free boundary
19Particle Data Structure
- struct particle
- double x,y
- struct particle next
-
- struct particle_line
- int length
- struct particle Particle
-
- struct particle_line Particle_Lines
20Additional Flags
21Free Boundary Conditions
- Vanishing surface tension
22Modified Algorithm
23Modified Algorithm
24PART II
- Parallel programming applied to free boundary
value problems
Presented by Darya Popiv
25Problem to Solve
- We have sequential code of free boundary problem
- Specifically braking dam and falling drop into
the basin - Goal parallelize the code to achieve the
reasonable speed up of execution time
26Investigating Architectures
- SISD single instruction single data (PC)
- MISD multiple instruction single data (special
construction implementing conveyor mode, if
exists in pure form) - SIMD single instruction multiple data (vector
computers) - MIMD multiple instruction multiple data (true
parallel computers, clusters)
27MIMD
- Why MIMD? Promising architecture Possibility to
use - Where MIMD is realized? Distributed address space
machines Global address space machines
28Distributed vs. Global Address Space Machines
- Distributed address space machines message
passing machines. Hardware level - computer
clusters. Software libraries MPI (1.2, 2.0),
PVM, Parmacs, Express. - Global address space machines shared memory.
Software libraries OpenMP.
29Resources for our solution
- MIMD
- Computer cluster
- MPI as software library
30Now back to the roots ?
- Input domain dimensions, domain resolution,
initial boundary conditions, particle
distribution over domain, initial particle
velocities - Processing using SOR we find pressure,
velocities and therefore particle position at
each time step - Output velocities, pressure, position of
particles
31Domain Decomposition
32Domain Decomposition 2
- Calculating pressure and velocities
33Domain Decomposition 3
- Exchanging pressure and velocities between
subdomains
34Domain Decomposition 4
- Exchanging of particles between subdomains
35Parallel Algorithm
36Parallel Algorithm 2
37MPI Functions
- MPI_Init
- MPI_Finalize
- MPI_Comm_rank
- MPI_Comm_size
- MPI_Barrier
- MPI_Send, MPI_Recv
- MPI_Sendrecv
- MPI_Reduce
- MPI_Bcast
38Measuring efficiency
- Speedup
- Parallel Efficiency
39Falling Drop
40Breaking Dam
41Possible improvements
- We do not use dynamic load balancing gt speedup
is not that big - You wanna try? ?