Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com APPLIED COMPUTATIONAL FLUID DYNAMICS TECHNIQUES Applied Computational Fluid Dynamics Techniques: An Introduction Based on Finite Element Methods, Second Edition. Rainald Löhner © 2008 John Wiley & Sons, Ltd. ISBN: 978-0-470-51907-3 Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com APPLIED COMPUTATIONAL FLUID DYNAMICS TECHNIQUES AN INTRODUCTION BASED ON FINITE ELEMENT METHODS Second Edition Rainald Löhner Center for C omputational Fluid Dynamics, Department of Computational and Data Sci ences, College of Sciences, George Mason University, Fairfax, Virginia, USA John Wiley & Sons, Ltd Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com Copyright c 2008 John Wiley & Sons Ltd, The Atrium, Southern Gate, Chichester, West Sussex PO19 8SQ, England Telephone (+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 or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, 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 Publisher should 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 or registered trademarks of their respective owners. The Publisher is not associated with any product or vendor mentioned in this book. This publication is designed to provide accurate and authoritative information in regard to the subject matter covered. It is sold on the understanding that the Publisher is not engaged in rendering professional services. If professional advice or other expert assistance is required, the services of a competent professional 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 129809 John 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 may not 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 at least two trees are planted for each one used for paper production. Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com CONTENTS FOREWORD TO THE SECOND EDITION xiv ACKNOWLEDGEMENTS xvii 1 INTRODUCTION AND GENERAL CONSIDERATIONS 1 1.1 TheCFDcode 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 Representationofagrid 7 2.2 Deriveddatastructuresforstaticdata 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 Edgesofanelement 16 2.3 Derived data structures for dynamic data . 17 2.3.1 N-trees 18 2.4 Sortingandsearching 19 2.4.1 Heaplists 19 2.5 Proximityinspace 22 2.5.1 Bins 22 2.5.2 Binarytrees 26 2.5.3 Quadtreesandoctrees 28 2.6 Nearest-neighbours and graphs . . 30 2.7 Distancetosurface 30 3 GRID GENERATION 35 3.1 Descriptionofthedomaintobegridded 37 3.1.1 Analyticalfunctions 37 3.1.2 Discretedata 37 3.2 Variationofelementsizeandshape 38 3.2.1 Internal measures of grid quality . 39 3.2.2 Analyticalfunctions 39 3.2.3 Boxes 39 Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com vi CONTENTS 3.2.4 Point/line/surface sources . 39 3.2.5 Background grids . . 42 3.2.6 ElementsizeattachedtoCADdata 43 3.2.7 Adaptive background grids . 43 3.2.8 Surface gridding with adaptive background grids 45 3.3 Elementtype 46 3.4 Automatic grid generation methods . 47 3.5 Other grid generation methods . . . 49 3.6 Theadvancingfronttechnique 51 3.6.1 Checking the intersection of faces . 52 3.6.2 Datastructurestominimizesearchoverheads 56 3.6.3 Additionaltechniquestoincreasespeed 56 3.6.4 Additional techniques to enhance reliability . . . 58 3.7 Delaunay triangulation . . . 59 3.7.1 Circumspherecalculations 61 3.7.2 Datastructurestominimizesearchoverheads 62 3.7.3 Boundary recovery . 63 3.7.4 Additionaltechniquestoincreasespeed 63 3.7.5 Additional techniques to enhance reliability and quality . 64 3.8 Gridimprovement 65 3.8.1 Removalofbadelements 66 3.8.2 Laplaciansmoothing 67 3.8.3 Gridoptimization 67 3.8.4 Selectivemeshmovement 67 3.8.5 Diagonal swapping . 68 3.9 Optimal space-filling tetrahedra . . 70 3.10Gridswithuniformcores 72 3.11Volume-to-surfacemeshing 73 3.12Navier–Stokesgriddingtechniques 75 3.12.1 DesigncriteriaforRANSgridders 77 3.12.2 Smoothingofsurfacenormals 79 3.12.3 Pointdistributionalongnormals 81 3.12.4 Subdivision of prisms into tetrahedra . . . . . . 81 3.12.5 Elementremovalcriteria 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 Maximumcompactiontechniques 93 3.13.5 Arbitraryobjects 96 3.13.6 Deposition patterns . 96 3.14Applications 98 3.14.1 Space shuttle ascend configuration . 99 3.14.2 PilotejectingfromF18 100 3.14.3 Circle of Willis . . . 103 3.14.4 Generic submarine body . . 105 Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com CONTENTS vii 3.14.5 Ahmed car body . 105 3.14.6 Truck 105 3.14.7 PointcloudforF117 106 3.14.8 Hopper filled with beans/ellipsoids 107 3.14.9 Cubefilledwithspheresofdifferentsizes 107 4 APPROXIMATION THEORY 109 4.1 Thebasicproblem 109 4.1.1 Point fitting . . . . 110 4.1.2 Weighted residual methods 110 4.1.3 Least-squaresformulation 112 4.2 Choiceoftrialfunctions 112 4.2.1 Constanttrialfunctionsinonedimension 112 4.2.2 Lineartrialfunctionsinonedimension 113 4.2.3 Quadratictrialfunctionsinonedimension 114 4.2.4 Lineartrialfunctionsintwodimensions 115 4.2.5 Quadratictrialfunctionsintwodimensions 117 4.3 Generalpropertiesofshapefunctions 118 4.4 Weighted residual methods with local functions . 118 4.5 Accuracyandeffort 119 4.6 Gridestimates 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 ThePoissonoperator 124 5.2.1 Minimizationproblem 125 5.2.2 Anexample 126 5.2.3 Tutorial:codefragmentforheatequation 128 5.3 Recoveryofderivatives 130 5.3.1 Firstderivatives 131 5.3.2 Secondderivatives 131 5.3.3 Higherderivatives 132 6 DISCRETIZATION IN TIME 133 6.1 Explicitschemes 133 6.2 Implicitschemes 135 6.2.1 Situationswhereimplicitschemespayoff 136 6.3 Awordofcaution 136 Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com viii CONTENTS 7 SOLUTION OF LARGE SYSTEMS OF EQUATIONS 137 7.1 Directsolvers 137 7.1.1 Gaussianelimination 137 7.1.2 Croutelimination 139 7.1.3 Choleskyelimination 140 7.2 Iterativesolvers 140 7.2.1 Matrixpreconditioning 141 7.2.2 Globalizationprocedures 147 7.3 Multigrid methods . . . . . 153 7.3.1 The multigrid concept . . . 154 7.3.2 Injectionandprojectionoperators 155 7.3.3 Gridcycling 157 7.3.4 Algorithmiccomplexityandstoragerequirements 157 7.3.5 Smoothing 158 7.3.6 Anexample 159 8 SIMPLE EULER/NAVIER–STOKES SOLVERS 161 8.1 Galerkinapproximation 162 8.1.1 EquivalencywithFVM 164 8.2 Lax–Wendroff(Taylor–Galerkin) 164 8.2.1 Expediting the RHS evaluation . . . 165 8.2.2 Linearelements(triangles,tetrahedra) 166 8.3 Solvingfortheconsistentmassmatrix 167 8.4 Artificial viscosities . . . . . 167 8.5 Boundary conditions . . . . 169 8.6 Viscousfluxes 172 9 FLUX-CORRECTED TRANSPORT SCHEMES 175 9.1 Algorithmicimplementation 176 9.1.1 The limiting procedure . . . 176 9.2 Steepening 178 9.3 FCTforTaylor–Galerkinschemes 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 Shocktube 181 9.6.2 Shockdiffractionoverawall 182 9.7 Summary 183 10 EDGE-BASED COMPRESSIBLE FLOW SOLVERS 187 10.1TheLaplacianoperator 188 10.2Firstderivatives:firstform 190 10.3Firstderivatives:secondform 191 10.4Edge-basedschemesforadvection-dominatedPDEs 193 10.4.1 Exact Riemann solver (Godunov scheme) . . . . 194 10.4.2 ApproximateRiemannsolvers 195 Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com CONTENTS ix 10.4.3 Scalarlimiteddissipation 197 10.4.4 Scalardissipationwithpressuresensors 197 10.4.5 Scalar dissipation without gradients . . . 198 10.4.6 Taylor–Galerkinschemes 199 10.4.7 Flux-correctedtransportschemes 199 11 INCOMPRESSIBLE FLOW SOLVERS 201 11.1Theadvectionoperator 201 11.1.1 Integrationalongcharacteristics 202 11.1.2 Taylor–Galerkin 202 11.1.3 Edge-basedupwinding 203 11.2Thedivergenceoperator 203 11.3 Artificial compressibility . 206 11.4Temporaldiscretization:projectionschemes 206 11.5Temporaldiscretization:implicitschemes 208 11.6Temporaldiscretizationofhigherorder 209 11.7 Acceleration to the steady state . . 210 11.7.1 Localtimestepping 210 11.7.2 Reducedpressureiterations 210 11.7.3 Substeppingfortheadvectionterms 211 11.7.4 Implicittreatmentoftheadvectionterms 211 11.8Projectivepredictionofpressureincrements 212 11.9Examples 213 11.9.1 vonKarmanvortexstreet 213 11.9.2 NACA0012 wing . 216 11.9.3 LPD-17topsideflowstudy 218 11.9.4 DARPASUBOFFmodel 223 11.9.5 Generic submarine forebody vortex flow study . . . . 225 12 MESH MOVEMENT 227 12.1TheALEframeofreference 227 12.1.1 Boundary conditions . . . 228 12.2Geometricconservationlaw 228 12.3Meshmovementalgorithms 229 12.3.1 Smoothingofthevelocityfield 230 12.3.2 Smoothingofthecoordinates 233 12.3.3 Prescriptionviaanalyticfunctions 235 12.4Regionofmovingelements 235 12.5PDE-baseddistancefunctions 236 12.5.1 Eikonalequation 237 12.5.2 Laplaceequation 237 12.6Penalizationofdeformedelements 238 12.7SpecialmovementtechniquesforRANSgrids 239 12.8Rotatingparts/domains 240 Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com x CONTENTS 12.9Applications 241 12.9.1 Multiple spheres . . 241 12.9.2 PilotejectionfromF18 242 12.9.3 Driftingfleetofships 242 13 INTERPOLATION 245 13.1Basicinterpolationalgorithm 246 13.2Fastest1-timealgorithm:bruteforce 247 13.3 Fastest N-timealgorithm:octreesearch 247 13.4 Fastest known vicinity algorithm: neighbour-to-neighbour . . . 249 13.5Fastestgrid-to-gridalgorithm:advancing-frontvicinity 250 13.5.1 Layeringofbrute-forcesearches 252 13.5.2 Inside-outinterpolation 253 13.5.3 Measuringconcavity 253 13.5.4 Vectorization 254 13.6Conservativeinterpolation 257 13.6.1 Conservative and monotonic interpolation . . . . 259 13.7 Surface-grid-to-surface-grid interpolation . 261 13.8Particle–gridinterpolation 265 14 ADAPTIVE MESH REFINEMENT 269 14.1Optimal-meshcriteria 270 14.2Errorindicators/estimators 271 14.2.1 Errorindicatorscommonlyused 272 14.2.2 Problems with multiple scales . . . 275 14.2.3 Determinationofelementsizeandshape 276 14.3Refinementstrategies 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.4Tutorial:h-refinementwithtetrahedra 286 14.4.1 Algorithmicimplementation 287 14.5Examples 291 14.5.1 Convectionbetweenconcentriccylinders 291 14.5.2 Shock-objectinteractionintwodimensions 294 14.5.3 Shock–object interaction in three dimensions . . 296 14.5.4 Shock–structureinteraction 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 Pointrenumbering 301 15.1.3 Reordering of nodes within elements . . . . . . 306 15.1.4 Renumbering of edges according to points . . . . 306 Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com [...]... At the same time, algorithm development continues to Applied Computational Fluid Dynamics Techniques: An Introduction Based on Finite Element Methods, Second Edition Rainald Löhner © 2008 John Wiley & Sons, Ltd ISBN: 978-0-470-51907-3 Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com 2 APPLIED COMPUTATIONAL FLUID DYNAMICS TECHNIQUES Table 1.1 Increase of problem size Size Dimension... would be inpoel(1,9)=7, inpoel(2,9)=8, inpoel(3,9)=13 Applied Computational Fluid Dynamics Techniques: An Introduction Based on Finite Element Methods, Second Edition Rainald Löhner © 2008 John Wiley & Sons, Ltd ISBN: 978-0-470-51907-3 Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com 8 APPLIED COMPUTATIONAL FLUID DYNAMICS TECHNIQUES 13 12 10 9 7 6 1 11 3 2 13 9 4 1 12 8 2 10... http://www.simpopdf.com 1 INTRODUCTION AND GENERAL CONSIDERATIONS Before going into a detailed description of applied Computational Fluid Dynamics (CFD) techniques, it seems proper to define its place among related disciplines CFD is part of computational mechanics, which in turn is part of simulation techniques Simulation is used by engineers and physicists to forecast or reconstruct the behaviour of an... but also influences to a large extent the algorithms employed and the way codes are written Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com 4 APPLIED COMPUTATIONAL FLUID DYNAMICS TECHNIQUES (e) Visualization techniques The vast amounts of data produced by modern simulations need to be displayed in a sensible way This not only refers to optimal algorithms to filter and traverse... topics and disciplines required to carry out a CFD run in the order they appear or are required during a run: Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com 6 APPLIED COMPUTATIONAL FLUID DYNAMICS TECHNIQUES (a) data structures (to represent, manage, generate and refine a mesh); (b) grid generation (to create a mesh); (c) approximation theory and flow solvers (to solve the PDEs,... second pass the elements surrounding points are stored in esup1 The algorithmic implementation is as follows Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com 10 APPLIED COMPUTATIONAL FLUID DYNAMICS TECHNIQUES Element Pass 1: Count the number of elements connected to each point Initialize esup2(1:npoin+1)=0 do ielem=1,nelem do inode=1,nnode ! Update storage counter, storing ahead... an exhaustive comparison is carried out in order to see if the same point has been stored more than once Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com 12 APPLIED COMPUTATIONAL FLUID DYNAMICS TECHNIQUES 2.2.3 ELEMENTS SURROUNDING ELEMENTS A very useful data structure for particle-in-cell (PIC) codes, the tracking of particles for streamline and streakline visualization, and... one type of element and vector machines, is to obtain all the neighbours of the faces coalescing at a point Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com 14 APPLIED COMPUTATIONAL FLUID DYNAMICS TECHNIQUES at once For the case of tetrahedra and hexahedra, this implies obtaining three neighbours for every point visited with esup1 and esup2 The coding of such an algorithm is not... illustrated in Figure 2.6 13 6 1 7 2 12 9 8 3 11 4 Figure 2.6 Interior faces left after the first pass 10 5 Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com 16 APPLIED COMPUTATIONAL FLUID DYNAMICS TECHNIQUES These faces are removed in a second step Step 2: Remove doubly defined faces This may be accomplished using a linked list that stores the faces surrounding each point, and... data each time a new item is introduced A better way of dealing with dynamically changing data is the N-tree Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com 18 APPLIED COMPUTATIONAL FLUID DYNAMICS TECHNIQUES 2.3.1 N-TREES Suppose the following problem is given: find all the faces that surround a given point One could use a linked list fsup1, fsup2 as shown above to solve the problem . Split Unregistered Version - http://www.simpopdf.com APPLIED COMPUTATIONAL FLUID DYNAMICS TECHNIQUES Applied Computational Fluid Dynamics Techniques: An Introduction Based on Finite Element Methods,. http://www.simpopdf.com APPLIED COMPUTATIONAL FLUID DYNAMICS TECHNIQUES AN INTRODUCTION BASED ON FINITE ELEMENT METHODS Second Edition Rainald Löhner Center for C omputational Fluid Dynamics, Department of Computational. into a detailed description of applied Computational Fluid Dynamics (CFD) techniques, it seems proper to define its place among related disciplines. CFD is part of computational mechanics, which