Download presentation
Presentation is loading. Please wait.
Published byLeslie Peters Modified over 8 years ago
1
Robert S. Laramee r.s.laramee@swansea.ac.uk 1 http://cs.swan.ac.uk/~csbob/teaching/ Visualization, Lecture Flow visualization, Part 2 (of 3)
2
Robert S. Laramee r.s.laramee@swansea.ac.uk 2 http://cs.swan.ac.uk/~csbob/teaching/ Retrospect: Previous Lecture Flow Visualization, Part 1: introduction, overview simulation vs. measurement vs. modelling 2D vs. surfaces vs. 3D steady vs time-dependent direct vs. geometric FlowVis experimental FlowVis PIV + example Vortices behind wing tips
3
Robert S. Laramee r.s.laramee@swansea.ac.uk 3 http://cs.swan.ac.uk/~csbob/teaching/ Overview: Lecture Flow Visualization, Part 2: direct FlowVis with arrows numerical integration Euler-integration Runge-Kutta-integration streamlines in 2D particle paths in 3D, sweeps illuminated streamlines streamline placement
4
Robert S. Laramee r.s.laramee@swansea.ac.uk 4 http://cs.swan.ac.uk/~csbob/teaching/ Direct Flow Visualization with Arrows Hedgehog plots, etc.
5
Robert S. Laramee r.s.laramee@swansea.ac.uk 5 http://cs.swan.ac.uk/~csbob/teaching/ Direct FlowVis with Arrows Properties: direct FlowVis normalized arrows vs. velocity coding 2D: quite useful, 3D: often problematic often difficult to understand, mentally integrate (time component missing) frequently used!
6
Robert S. Laramee r.s.laramee@swansea.ac.uk 6 http://cs.swan.ac.uk/~csbob/teaching/ Arrows in 2D Scaled arrows vs. color-coded arrows
7
Robert S. Laramee r.s.laramee@swansea.ac.uk 7 http://cs.swan.ac.uk/~csbob/teaching/ Arrows in 3D Common problems: ambiguity perspective shortening 1D objects generally difficult to grasp in 3D Remedy: 3D-Arrows (are of some help )
8
Robert S. Laramee r.s.laramee@swansea.ac.uk 8 http://cs.swan.ac.uk/~csbob/teaching/ Arrows in 3D Compromise: arrows only in layers
9
Robert S. Laramee r.s.laramee@swansea.ac.uk 9 http://cs.swan.ac.uk/~csbob/teaching/ Arrows in 3D Combines well with other 3D vis.:
10
Robert S. Laramee r.s.laramee@swansea.ac.uk 10 http://cs.swan.ac.uk/~csbob/teaching/ Integration of Streamlines Numerical Integration
11
Robert S. Laramee r.s.laramee@swansea.ac.uk 11 http://cs.swan.ac.uk/~csbob/teaching/ Streamlines – Theory Correlations: flow data v: derivative information dx/dt = v(x); spatial points x R n, Time t R, flow vectors v R n streamline s: integration over time, also called trajectory, solution, curve s(t) = s 0 + 0 u t v(s(u)) du; seed point s 0, integration variable u difficulty: result s also in the integral analytical solution usually impossible.
12
Robert S. Laramee r.s.laramee@swansea.ac.uk 12 http://cs.swan.ac.uk/~csbob/teaching/ Streamlines – Practice Basic approach: theory: s(t) = s 0 + 0 u t v(s(u)) du practice: numerical integration idea: (very) locally, the solution is (approx.) linear Euler integration: follow the current flow vector v(s i ) from the current streamline point s i for a very small time (dt) and therefore distance Euler integration: s i+1 = s i + v(s i ) · dt, integration of small steps (dt very small)
13
Robert S. Laramee r.s.laramee@swansea.ac.uk 13 http://cs.swan.ac.uk/~csbob/teaching/ Euler Integration – Example 2D model data: v x = dx/dt = y v y = dy/dt = x/2 Sample arrows: True solution: ellipses. 01234 0 1 2
14
Robert S. Laramee r.s.laramee@swansea.ac.uk 14 http://cs.swan.ac.uk/~csbob/teaching/ Euler Integration – Example Seed point s 0 = ( 0 | -1 ) T ; current flow vector v(s 0 ) = ( 1 | 0 ) T ; dt = ½ v x = dx/dt = y v y = dy/dt = x/2 01234 0 1 2
15
Robert S. Laramee r.s.laramee@swansea.ac.uk 15 http://cs.swan.ac.uk/~csbob/teaching/ Euler Integration – Example New point s 1 = s 0 + v(s 0 ) · dt = ( 1/2 | -1 ) T ; current flow vector v(s 1 ) = ( 1 | 1/4 ) T ; v x = dx/dt = y v y = dy/dt = x/2 01234 0 1 2
16
Robert S. Laramee r.s.laramee@swansea.ac.uk 16 http://cs.swan.ac.uk/~csbob/teaching/ Euler Integration – Example New point s 2 = s 1 + v(s 1 ) · dt = ( 1 | -7/8 ) T ; current flow vector v(s 2 ) = ( 7/8 | 1/2 ) T ; v x = dx/dt = y v y = dy/dt = x/2 01234 0 1 2
17
Robert S. Laramee r.s.laramee@swansea.ac.uk 17 http://cs.swan.ac.uk/~csbob/teaching/ Euler Integration – Example s 3 = ( 23/16 | -5/8 ) T ( 1.44 | -0.63 ) T ; v(s 3 )= ( 5/8 | 23/32 ) T ( 0.63 | 0.72 ) T ; v x = dx/dt = y v y = dy/dt = x/2 01234 0 1 2
18
Robert S. Laramee r.s.laramee@swansea.ac.uk 18 http://cs.swan.ac.uk/~csbob/teaching/ Euler Integration – Example s 4 = ( 7/4 | -17/64 ) T ( 1.75 | -0.27 ) T ; v(s 4 )= ( 17/64 | 7/8 ) T ( 0.27 | 0.88 ) T ; 01234 0 1 2
19
Robert S. Laramee r.s.laramee@swansea.ac.uk 19 http://cs.swan.ac.uk/~csbob/teaching/ Euler Integration – Example s 9 ( 0.20 | 1.69 ) T ; v(s 9 ) ( -1.69 | 0.10 ) T ; 01234 0 1 2
20
Robert S. Laramee r.s.laramee@swansea.ac.uk 20 http://cs.swan.ac.uk/~csbob/teaching/ Euler Integration – Example s 14 ( -3.22 | -0.10 ) T ; v(s 14 ) ( 0.10 | -1.61 ) T ; 01234 0 1 2
21
Robert S. Laramee r.s.laramee@swansea.ac.uk 21 http://cs.swan.ac.uk/~csbob/teaching/ Euler Integration – Example s 19 ( 0.75 | -3.02 ) T ; v(s 19 ) ( 3.02 | 0.37 ) T ; clearly: large integration error, dt too large, 19 steps 01234 0 1 2
22
Robert S. Laramee r.s.laramee@swansea.ac.uk 22 http://cs.swan.ac.uk/~csbob/teaching/ Euler Integration – Example dt smaller (1/4): more steps, more exact. s 36 ( 0.04 | -1.74 ) T ; v(s 36 ) ( 1.74 | 0.02 ) T ; 36 steps 01234 0 1 2
23
Robert S. Laramee r.s.laramee@swansea.ac.uk 23 http://cs.swan.ac.uk/~csbob/teaching/ Comparison Euler, Step Sizes Euler quality is proportional to dt
24
Robert S. Laramee r.s.laramee@swansea.ac.uk 24 http://cs.swan.ac.uk/~csbob/teaching/ Euler Example – Error Table dt#stepserror 1/219~200% 1/436~75% 1/1089~25% 1/100889~2% 1/10008889~0.2%
25
Robert S. Laramee r.s.laramee@swansea.ac.uk 25 http://cs.swan.ac.uk/~csbob/teaching/ Runge-Kutta Integration -Better than Euler Runge-Kutta Approach: theory: s(t) = s 0 + 0 u t v(s(u)) du Euler:s i = s 0 + 0 u<i v(s u ) dt Runge-Kutta integration: idea: cut short the curve arc RK-2 (second order RK): 1.: do half a Euler step 2.: evaluate (interpolate) flow vector there 3.: use it at the origin RK-2 (two evaluations of v per step): s i+1 = s i + v(s i +v(s i )·dt / 2) · dt
26
Robert S. Laramee r.s.laramee@swansea.ac.uk 26 http://cs.swan.ac.uk/~csbob/teaching/ RK-2 Integration – One Step 01234 0 1 2 Seed point s 0 = ( 0 | -2 ) T ; current flow vector v(s 0 ) = ( 2 | 0 ) T ; preview vector v(s 0 +v(s 0 )·dt / 2) = (2|0.5) T ; dt = 1
27
Robert S. Laramee r.s.laramee@swansea.ac.uk 27 http://cs.swan.ac.uk/~csbob/teaching/ RK-2 – One more step Seed point s 1 = ( 2 | -1.5 ) T ; current flow vector v(s 1 ) = ( 1.5 | 1 ) T ; preview vector v(s 1 +v(s 1 )·dt / 2) (1|1.4) T ; dt = 1 01234 0 1 2
28
Robert S. Laramee r.s.laramee@swansea.ac.uk 28 http://cs.swan.ac.uk/~csbob/teaching/ RK-2 – A Quick Round RK-2: even with dt = 1 (9 steps) better than Euler with dt = 1/8 (72 steps)
29
Robert S. Laramee r.s.laramee@swansea.ac.uk 29 http://cs.swan.ac.uk/~csbob/teaching/ RK-4 vs. Euler, RK-2 Even better: fourth order RK: four vectors a, b, c, d one step is a convex combination: s i+1 = s i + (a + 2·b + 2·c + d)/6 vectors: a = dt·v(s i )… original vector b = dt·v(s i +a/2)… RK-2 vector c = dt·v(s i +b/2)… use RK-2 … d = dt·v(s i +c)… and again
30
Robert S. Laramee r.s.laramee@swansea.ac.uk 30 http://cs.swan.ac.uk/~csbob/teaching/ Euler vs. Runge-Kutta RK-4: pays off only with complex flows Here approx. like RK-2
31
Robert S. Laramee r.s.laramee@swansea.ac.uk 31 http://cs.swan.ac.uk/~csbob/teaching/ Integration, Conclusions Summary: analytic determination of streamlines usually not possible hence: numerical integration various methods available (Euler, Runge-Kutta, etc.) Euler: simple, imprecise, esp. with small dt RK: more accurate in higher orders furthermore: adaptive methods, implicit methods, etc.
32
Robert S. Laramee r.s.laramee@swansea.ac.uk 32 http://cs.swan.ac.uk/~csbob/teaching/ Flow Visualization with Streamlines Streamlines, Particle Paths, etc.
33
Robert S. Laramee r.s.laramee@swansea.ac.uk 33 http://cs.swan.ac.uk/~csbob/teaching/ Streamlines in 2D Adequate for overview
34
Robert S. Laramee r.s.laramee@swansea.ac.uk 34 http://cs.swan.ac.uk/~csbob/teaching/ Visualization with Particles Particle paths = streamlines (steady flows) Variants (time- dependent data): streak lines: steadily new particles path lines: long-term path of one particle click2demo (F9!)
35
Robert S. Laramee r.s.laramee@swansea.ac.uk 35 http://cs.swan.ac.uk/~csbob/teaching/ Streamlines in 3D Color coding: Speed Selective Placement
36
Robert S. Laramee r.s.laramee@swansea.ac.uk 36 http://cs.swan.ac.uk/~csbob/teaching/ Illuminated Streamlines Illuminated 3D curves better 3D perception
37
Robert S. Laramee r.s.laramee@swansea.ac.uk 37 http://cs.swan.ac.uk/~csbob/teaching/ Streamline Placement in 2D
38
Robert S. Laramee r.s.laramee@swansea.ac.uk 38 http://cs.swan.ac.uk/~csbob/teaching/ Problem: Choice of Seed Points Streamline placement: If regular grid used: very irregular result
39
Robert S. Laramee r.s.laramee@swansea.ac.uk 39 http://cs.swan.ac.uk/~csbob/teaching/ Overview of Algorithm Idea: streamlines should not lie too close to one another Approach: choose a seed point with distance d sep from an already existing streamline forward- and backward-integration until distance d test is reached (or …). two parameters: d sep … start distance d test … minimum distance
40
Robert S. Laramee r.s.laramee@swansea.ac.uk 40 http://cs.swan.ac.uk/~csbob/teaching/ Algorithm – Pseudo-Code Compute initial streamline, put it into a queue current streamline = initial streamline WHILE not finished DO: TRY: get new seed point which is d sep away from current streamline IF successful THEN compute new streamline AND put to queue ELSE IF no more streamline in queue THEN exit loop ELSE next streamline in queue becomes current streamline
41
Robert S. Laramee r.s.laramee@swansea.ac.uk 41 http://cs.swan.ac.uk/~csbob/teaching/ Streamline Termination When to stop streamline integration: when distance to neighboring streamline ≤ d test when streamline leaves flow domain when streamline runs into fixed point (v = 0) when streamline gets too near to itself (loop) after a certain amount of maximal steps
42
Robert S. Laramee r.s.laramee@swansea.ac.uk 42 http://cs.swan.ac.uk/~csbob/teaching/ New Streamlines
43
Robert S. Laramee r.s.laramee@swansea.ac.uk 43 http://cs.swan.ac.uk/~csbob/teaching/ Different Streamline Densities Variations of d sep relative to image width: 6% 3% 1.5%
44
Robert S. Laramee r.s.laramee@swansea.ac.uk 44 http://cs.swan.ac.uk/~csbob/teaching/ d sep vs. d test d test = 0.9 · d sep d test = 0.5 · d sep
45
Robert S. Laramee r.s.laramee@swansea.ac.uk 45 http://cs.swan.ac.uk/~csbob/teaching/ Tapering and Glyphs Thickness in relation to distance Directional glyphs:
46
Robert S. Laramee r.s.laramee@swansea.ac.uk 46 http://cs.swan.ac.uk/~csbob/teaching/ Literature For more information, please see: B. Jobard & W. Lefer: “Creating Evenly-Spaced Streamlines of Arbitrary Density” in Proceedings of 8th Eurographics Workshop on Visualization in Scientific Computing, April 1997, pp. 45-55 Data Visualization: Principles and Practice, Chapter 6: Vector Visualization by A. Telea, AK Peters 2008 FlowVis Videos available on Bob's web page.
47
Robert S. Laramee r.s.laramee@swansea.ac.uk 47 http://cs.swan.ac.uk/~csbob/teaching/ Acknowledgements We thank the following for material used in this lecture: Bruno Jobard Malte Zöckler Georg Fischel Frits H. Post Roger Crawfis Helwig Hauser
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.