APPLIED COMPUTATIONAL FLUIDDYNAMICS TECHNIQUES Applied Computational Fluid Dynamics Techniques: An Introduction Based on Finite Element Methods, Second Edition... Rainald LöhnerCenter fo
Trang 2APPLIED COMPUTATIONAL FLUID
DYNAMICS TECHNIQUES
Applied Computational Fluid Dynamics Techniques: An Introduction Based on Finite Element Methods, Second Edition.
Trang 3Rainald Löhner
Center for Computational Fluid Dynamics,
Department of Computational and Data Sciences,
College of Sciences, George Mason University,
Fairfax, Virginia, USA
John Wiley & Sons, Ltd
Trang 4Copyright c 2008 John Wiley & Sons Ltd, The Atrium, Southern Gate, Chichester,
West Sussex PO19 8SQ, EnglandTelephone (+44) 1243 779777
Email (for orders and customer service enquiries): cs-books@wiley.co.uk
Visit our Home Page on www.wiley.com
All Rights Reserved No part of this publication may be reproduced, stored in a retrieval system ortransmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning orotherwise, except under the terms of the Copyright, Designs and Patents Act 1988 or under the terms
of a licence issued by the Copyright Licensing Agency Ltd, 90 Tottenham Court Road,
London W1T 4LP, UK, without the permission in writing of the Publisher Requests to the Publishershould be addressed to the Permissions Department, John Wiley & Sons Ltd, The Atrium, Southern Gate,Chichester, West Sussex PO19 8SQ, England, or emailed to permreq@wiley.co.uk, or faxed to
(+44) 1243 770620
Designations used by companies to distinguish their products are often claimed as trademarks
All brand names and product names used in this book are trade names, service marks, trademarks orregistered trademarks of their respective owners The Publisher is not associated with any product orvendor mentioned in this book
This publication is designed to provide accurate and authoritative information in regard to the subjectmatter covered It is sold on the understanding that the Publisher is not engaged in rendering professionalservices If professional advice or other expert assistance is required, the services of a competentprofessional should be sought
Other Wiley Editorial Offices
John Wiley & Sons Inc., 111 River Street, Hoboken, NJ 07030, USA
Jossey-Bass, 989 Market Street, San Francisco, CA 94103-1741, USA
Wiley-VCH Verlag GmbH, Boschstr 12, D-69469 Weinheim, Germany
John Wiley & Sons Australia Ltd, 42 McDougall Street, Milton, Queensland 4064, Australia
John Wiley & Sons (Asia) Pte Ltd, 2 Clementi Loop #02-01, Jin Xing Distripark, Singapore 129809John Wiley & Sons Canada Ltd, 6045 Freemont Blvd, Mississauga, ONT, L5R 4J3
Wiley also publishes its books in a variety of electronic formats Some content that appears in print maynot be available in electronic books
Library of Congress Cataloging-in-Publication Data
Löhner, Rainald
Applied computational fluid dynamics techniques : an introduction based on finite element methods /Rainald Lohner – 2nd ed
p cm
Includes bibliographical references and index
ISBN 978-0-470-51907-3 (cloth : alk paper)
1 Fluid dynamics–Mathematics 2 Numerical analysis 3 Finite element method I Title
TA357.L592 2008
620.1’064–dc22
2007045555
British Library Cataloguing in Publication Data
A catalogue record for this book is available from the British Library
ISBN 978-0-470-51907-3
Typeset by Sunrise Setting Ltd, Torquay, UK
Printed and bound in Great Britain by Antony Rowe Ltd, Chippenham, Wiltshire
This book is printed on acid-free paper responsibly manufactured from sustainable forestry in which atleast two trees are planted for each one used for paper production
Trang 5FOREWORD TO THE SECOND EDITION xiv ACKNOWLEDGEMENTS xvii
1 INTRODUCTION AND GENERAL CONSIDERATIONS 1
1.1 The CFD code 4
1.2 Porting research codes to an industrial context 5
1.3 Scope of the book 5
2 DATA STRUCTURES AND ALGORITHMS 7 2.1 Representation of a grid 7
2.2 Derived data structures for static data 9
2.2.1 Elements surrounding points – linked lists 9
2.2.2 Points surrounding points 10
2.2.3 Elements surrounding elements 12
2.2.4 Edges 14
2.2.5 External faces 14
2.2.6 Edges of an element 16
2.3 Derived data structures for dynamic data 17
2.3.1 N-trees 18
2.4 Sorting and searching 19
2.4.1 Heap lists 19
2.5 Proximity in space 22
2.5.1 Bins 22
2.5.2 Binary trees 26
2.5.3 Quadtrees and octrees 28
2.6 Nearest-neighbours and graphs 30
2.7 Distance to surface 30
3 GRID GENERATION 35 3.1 Description of the domain to be gridded 37
3.1.1 Analytical functions 37
3.1.2 Discrete data 37
3.2 Variation of element size and shape 38
3.2.1 Internal measures of grid quality 39
3.2.2 Analytical functions 39
3.2.3 Boxes 39
Trang 6vi CONTENTS
3.2.4 Point/line/surface sources 39
3.2.5 Background grids 42
3.2.6 Element size attached to CAD data 43
3.2.7 Adaptive background grids 43
3.2.8 Surface gridding with adaptive background grids 45
3.3 Element type 46
3.4 Automatic grid generation methods 47
3.5 Other grid generation methods 49
3.6 The advancing front technique 51
3.6.1 Checking the intersection of faces 52
3.6.2 Data structures to minimize search overheads 56
3.6.3 Additional techniques to increase speed 56
3.6.4 Additional techniques to enhance reliability 58
3.7 Delaunay triangulation 59
3.7.1 Circumsphere calculations 61
3.7.2 Data structures to minimize search overheads 62
3.7.3 Boundary recovery 63
3.7.4 Additional techniques to increase speed 63
3.7.5 Additional techniques to enhance reliability and quality 64
3.8 Grid improvement 65
3.8.1 Removal of bad elements 66
3.8.2 Laplacian smoothing 67
3.8.3 Grid optimization 67
3.8.4 Selective mesh movement 67
3.8.5 Diagonal swapping 68
3.9 Optimal space-filling tetrahedra 70
3.10 Grids with uniform cores 72
3.11 Volume-to-surface meshing 73
3.12 Navier–Stokes gridding techniques 75
3.12.1 Design criteria for RANS gridders 77
3.12.2 Smoothing of surface normals 79
3.12.3 Point distribution along normals 81
3.12.4 Subdivision of prisms into tetrahedra 81
3.12.5 Element removal criteria 83
3.13 Filling space with points/arbitrary objects 90
3.13.1 The advancing front space-filling algorithm 90
3.13.2 Point/object placement stencils 91
3.13.3 Boundary consistency checks 93
3.13.4 Maximum compaction techniques 93
3.13.5 Arbitrary objects 96
3.13.6 Deposition patterns 96
3.14 Applications 98
3.14.1 Space shuttle ascend configuration 99
3.14.2 Pilot ejecting from F18 100
3.14.3 Circle of Willis 103
3.14.4 Generic submarine body 105
Trang 7CONTENTS vii
3.14.5 Ahmed car body 105
3.14.6 Truck 105
3.14.7 Point cloud for F117 106
3.14.8 Hopper filled with beans/ellipsoids 107
3.14.9 Cube filled with spheres of different sizes 107
4 APPROXIMATION THEORY 109 4.1 The basic problem 109
4.1.1 Point fitting 110
4.1.2 Weighted residual methods 110
4.1.3 Least-squares formulation 112
4.2 Choice of trial functions 112
4.2.1 Constant trial functions in one dimension 112
4.2.2 Linear trial functions in one dimension 113
4.2.3 Quadratic trial functions in one dimension 114
4.2.4 Linear trial functions in two dimensions 115
4.2.5 Quadratic trial functions in two dimensions 117
4.3 General properties of shape functions 118
4.4 Weighted residual methods with local functions 118
4.5 Accuracy and effort 119
4.6 Grid estimates 121
5 APPROXIMATION OF OPERATORS 123 5.1 Taxonomy of methods 123
5.1.1 Finite difference methods 123
5.1.2 Finite volume methods 124
5.1.3 Galerkin finite element methods 124
5.1.4 Petrov–Galerkin finite element methods 124
5.1.5 Spectral element methods 124
5.2 The Poisson operator 124
5.2.1 Minimization problem 125
5.2.2 An example 126
5.2.3 Tutorial: code fragment for heat equation 128
5.3 Recovery of derivatives 130
5.3.1 First derivatives 131
5.3.2 Second derivatives 131
5.3.3 Higher derivatives 132
6 DISCRETIZATION IN TIME 133 6.1 Explicit schemes 133
6.2 Implicit schemes 135
6.2.1 Situations where implicit schemes pay off 136
6.3 A word of caution 136
Trang 8viii CONTENTS
7 SOLUTION OF LARGE SYSTEMS OF EQUATIONS 137
7.1 Direct solvers 137
7.1.1 Gaussian elimination 137
7.1.2 Crout elimination 139
7.1.3 Cholesky elimination 140
7.2 Iterative solvers 140
7.2.1 Matrix preconditioning 141
7.2.2 Globalization procedures 147
7.3 Multigrid methods 153
7.3.1 The multigrid concept 154
7.3.2 Injection and projection operators 155
7.3.3 Grid cycling 157
7.3.4 Algorithmic complexity and storage requirements 157
7.3.5 Smoothing 158
7.3.6 An example 159
8 SIMPLE EULER/NAVIER–STOKES SOLVERS 161 8.1 Galerkin approximation 162
8.1.1 Equivalency with FVM 164
8.2 Lax–Wendroff (Taylor–Galerkin) 164
8.2.1 Expediting the RHS evaluation 165
8.2.2 Linear elements (triangles, tetrahedra) 166
8.3 Solving for the consistent mass matrix 167
8.4 Artificial viscosities 167
8.5 Boundary conditions 169
8.6 Viscous fluxes 172
9 FLUX-CORRECTED TRANSPORT SCHEMES 175 9.1 Algorithmic implementation 176
9.1.1 The limiting procedure 176
9.2 Steepening 178
9.3 FCT for Taylor–Galerkin schemes 179
9.4 Iterative limiting 179
9.5 Limiting for systems of equations 180
9.5.1 Limiting any set of quantities 180
9.6 Examples 181
9.6.1 Shock tube 181
9.6.2 Shock diffraction over a wall 182
9.7 Summary 183
10 EDGE-BASED COMPRESSIBLE FLOW SOLVERS 187 10.1 The Laplacian operator 188
10.2 First derivatives: first form 190
10.3 First derivatives: second form 191
10.4 Edge-based schemes for advection-dominated PDEs 193
10.4.1 Exact Riemann solver (Godunov scheme) 194
10.4.2 Approximate Riemann solvers 195
Trang 9CONTENTS ix
10.4.3 Scalar limited dissipation 197
10.4.4 Scalar dissipation with pressure sensors 197
10.4.5 Scalar dissipation without gradients 198
10.4.6 Taylor–Galerkin schemes 199
10.4.7 Flux-corrected transport schemes 199
11 INCOMPRESSIBLE FLOW SOLVERS 201 11.1 The advection operator 201
11.1.1 Integration along characteristics 202
11.1.2 Taylor–Galerkin 202
11.1.3 Edge-based upwinding 203
11.2 The divergence operator 203
11.3 Artificial compressibility 206
11.4 Temporal discretization: projection schemes 206
11.5 Temporal discretization: implicit schemes 208
11.6 Temporal discretization of higher order 209
11.7 Acceleration to the steady state 210
11.7.1 Local timestepping 210
11.7.2 Reduced pressure iterations 210
11.7.3 Substepping for the advection terms 211
11.7.4 Implicit treatment of the advection terms 211
11.8 Projective prediction of pressure increments 212
11.9 Examples 213
11.9.1 von Karman vortex street 213
11.9.2 NACA0012 wing 216
11.9.3 LPD-17 topside flow study 218
11.9.4 DARPA SUBOFF model 223
11.9.5 Generic submarine forebody vortex flow study 225
12 MESH MOVEMENT 227 12.1 The ALE frame of reference 227
12.1.1 Boundary conditions 228
12.2 Geometric conservation law 228
12.3 Mesh movement algorithms 229
12.3.1 Smoothing of the velocity field 230
12.3.2 Smoothing of the coordinates 233
12.3.3 Prescription via analytic functions 235
12.4 Region of moving elements 235
12.5 PDE-based distance functions 236
12.5.1 Eikonal equation 237
12.5.2 Laplace equation 237
12.6 Penalization of deformed elements 238
12.7 Special movement techniques for RANS grids 239
12.8 Rotating parts/domains 240
Trang 10x CONTENTS
12.9 Applications 241
12.9.1 Multiple spheres 241
12.9.2 Pilot ejection from F18 242
12.9.3 Drifting fleet of ships 242
13 INTERPOLATION 245 13.1 Basic interpolation algorithm 246
13.2 Fastest 1-time algorithm: brute force 247
13.3 Fastest N-time algorithm: octree search 247
13.4 Fastest known vicinity algorithm: neighbour-to-neighbour 249
13.5 Fastest grid-to-grid algorithm: advancing-front vicinity 250
13.5.1 Layering of brute-force searches 252
13.5.2 Inside-out interpolation 253
13.5.3 Measuring concavity 253
13.5.4 Vectorization 254
13.6 Conservative interpolation 257
13.6.1 Conservative and monotonic interpolation 259
13.7 Surface-grid-to-surface-grid interpolation 261
13.8 Particle–grid interpolation 265
14 ADAPTIVE MESH REFINEMENT 269 14.1 Optimal-mesh criteria 270
14.2 Error indicators/estimators 271
14.2.1 Error indicators commonly used 272
14.2.2 Problems with multiple scales 275
14.2.3 Determination of element size and shape 276
14.3 Refinement strategies 278
14.3.1 Mesh movement or repositioning (r-methods) 278
14.3.2 Mesh enrichment (h/p-methods) 278
14.3.3 Adaptive remeshing (M-methods) 284
14.3.4 Combinations 286
14.4 Tutorial: h-refinement with tetrahedra 286
14.4.1 Algorithmic implementation 287
14.5 Examples 291
14.5.1 Convection between concentric cylinders 291
14.5.2 Shock-object interaction in two dimensions 294
14.5.3 Shock–object interaction in three dimensions 296
14.5.4 Shock–structure interaction 297
14.5.5 Object falling into supersonic free stream two dimensions 297
15 EFFICIENT USE OF COMPUTER HARDWARE 299 15.1 Reduction of cache-misses 300
15.1.1 Array access in loops 300
15.1.2 Point renumbering 301
15.1.3 Reordering of nodes within elements 306
15.1.4 Renumbering of edges according to points 306
Trang 11CONTENTS xi
15.1.5 Some timings 308
15.1.6 Agglomeration techniques 309
15.2 Vector machines 316
15.2.1 Basic edge colouring algorithm 317
15.2.2 Backward/forward strategy 318
15.2.3 Combining vectorizability with data locality 318
15.2.4 Switching algorithm 319
15.2.5 Reduced i/a loops 321
15.2.6 Alternative RHS formation 326
15.3 Parallel machines: general considerations 328
15.4 Shared-memory parallel machines 329
15.4.1 Local agglomeration 330
15.4.2 Global agglomeration 331
15.4.3 Implementational issues 333
15.5 SIMD machines 334
15.6 MIMD machines 336
15.6.1 General considerations 337
15.6.2 Load balancing and domain splitting 337
15.6.3 Parallel flow solvers 342
15.7 The effect of Moore’s law on parallel computing 344
15.7.1 The life cycle of scientific computing codes 346
15.7.2 Examples 348
15.7.3 The consequences of Moore’s law 349
16 SPACE-MARCHING AND DEACTIVATION 351 16.1 Space-marching 351
16.1.1 Masking of points and edges 352
16.1.2 Renumbering of points and edges 354
16.1.3 Grouping to avoid memory contention 355
16.1.4 Extrapolation of the solution 356
16.1.5 Treatment of subsonic pockets 357
16.1.6 Measuring convergence 357
16.1.7 Application to transient problems 358
16.1.8 Macro-blocking 359
16.1.9 Examples for space-marching and blocking 360
16.2 Deactivation 365
16.2.1 Examples of dynamic deactivation 366
17 OVERLAPPING GRIDS 371 17.1 Interpolation criteria 372
17.2 External boundaries and domains 373
17.3 Interpolation: initialization 373
17.4 Treatment of domains that are partially outside 375
17.5 Removal of inactive regions 375
17.6 Incremental interpolation 377
17.7 Changes to the flow solver 377
Trang 12xii CONTENTS
17.8 Examples 378
17.8.1 Sphere in channel (compressible Euler) 378
17.8.2 Sphere in shear flow (incompressible Navier–Stokes) 378
17.8.3 Spinning missile 379
18 EMBEDDED AND IMMERSED GRID TECHNIQUES 383 18.1 Kinetic treatment of embedded or immersed objects 385
18.1.1 Implementation details 388
18.2 Kinematic treatment of embedded surfaces 389
18.2.1 First-order treatment 389
18.2.2 Higher-order treatment 392
18.2.3 Determination of crossed edges 394
18.3 Deactivation of interior regions 395
18.4 Extrapolation of the solution 397
18.5 Adaptive mesh refinement 397
18.6 Load/flux transfer 398
18.7 Treatment of gaps or cracks 399
18.8 Direct link to particles 400
18.9 Examples 401
18.9.1 Sod shock tube 401
18.9.2 Shuttle ascend configuration 401
18.9.3 Blast interaction with a generic ship hull 402
18.9.4 Generic weapon fragmentation 404
18.9.5 Flow past a sphere 405
18.9.6 Dispersion in an inner city 411
18.9.7 Complex endovascular devices 411
18.9.8 Flow past a VW Golf 5 411
19 TREATMENT OF FREE SURFACES 419 19.1 Interface fitting methods 419
19.1.1 Free surface discretization 421
19.1.2 Overall scheme 422
19.1.3 Mesh update 422
19.1.4 Examples for surface fitting 424
19.1.5 Practical limitations of free surface fitting 427
19.2 Interface capturing methods 429
19.2.1 Extrapolation of the pressure 432
19.2.2 Extrapolation of the velocity 432
19.2.3 Keeping interfaces sharp 432
19.2.4 Imposition of constant mass 433
19.2.5 Deactivation of air region 433
19.2.6 Treatment of bubbles 434
19.2.7 Adaptive refinement 435
19.2.8 Examples for surface capturing 435
19.2.9 Practical limitations of free surface capturing 448