Part II: Finite Difference/Volume Discretisation for CFD



Similar documents
FINITE DIFFERENCE METHODS

Verifying Numerical Convergence Rates

Module 5: Solution of Navier-Stokes Equations for Incompressible Flow Using SIMPLE and MAC Algorithms Lecture 27:

Advanced CFD Methods 1

Express Introductory Training in ANSYS Fluent Lecture 1 Introduction to the CFD Methodology

Spatial Discretisation Schemes in the PDE framework Peano for Fluid-Structure Interactions

Linköping University Electronic Press

APPENDIX 3 CFD CODE - PHOENICS

Divergence-Free Elements for Incompressible Flow on Cartesian Grids

Iterative Solvers for Linear Systems

Differential Relations for Fluid Flow. Acceleration field of a fluid. The differential equation of mass conservation

Dimensionless form of equations

1 The basic equations of fluid dynamics

CFD simulations using an AMR-like approach in the PDE Framework Peano

OpenFOAM Optimization Tools

A CODE VERIFICATION EXERCISE FOR THE UNSTRUCTURED FINITE-VOLUME CFD SOLVER ISIS-CFD

The finite element immersed boundary method: model, stability, and numerical results

Introduction to the Finite Element Method

Numerical Analysis of the Jeans Instability

ρe tot ρu ρv ρw ρ q = ρh tot v ρuv f y = ρv 2 + P ρwv ρv

SIXTY STUDY QUESTIONS TO THE COURSE NUMERISK BEHANDLING AV DIFFERENTIALEKVATIONER I

Interactive simulation of an ash cloud of the volcano Grímsvötn

CFD modelling of floating body response to regular waves

ME6130 An introduction to CFD 1-1

MEL 807 Computational Heat Transfer (2-0-4) Dr. Prabal Talukdar Assistant Professor Department of Mechanical Engineering IIT Delhi

How To Write A Program For The Pd Framework

FORCED AND NATURAL CONVECTION HEAT TRANSFER IN A LID-DRIVEN CAVITY

Modeling of Earth Surface Dynamics and Related Problems Using OpenFOAM

Customer Training Material. Lecture 2. Introduction to. Methodology ANSYS FLUENT. ANSYS, Inc. Proprietary 2010 ANSYS, Inc. All rights reserved.

Physics of the Atmosphere I

Introduction to CFD Basics

Computational fluid dynamics (CFD) 9 th SIMLAB Course

Lecture 3 Fluid Dynamics and Balance Equa6ons for Reac6ng Flows

Heat Exchangers. Heat Exchanger Types. Heat Exchanger Types. Applied Heat Transfer Part Two. Topics of This chapter

CFD SIMULATION OF SDHW STORAGE TANK WITH AND WITHOUT HEATER

Numerical Methods for Differential Equations

A New Cement to Glue Nonconforming Grids with Robin Interface Conditions: The Finite Element Case

Renormalization of the Numerical Diffusion for an Upwind Finite Volume Method. Application to the Simulation of Kelvin-Helmholtz Instability

Experiences Extending the CFD Solver of the PDE Framework Peano

Hydrodynamics of stellar explosions

Lecture 10: What is a Function, definition, piecewise defined functions, difference quotient, domain of a function

N 1. (q k+1 q k ) 2 + α 3. k=0

Multi-Block Gridding Technique for FLOW-3D Flow Science, Inc. July 2004

MATHEMATICAL MODELS OF LIFE SUPPORT SYSTEMS Vol. I - Mathematical Models for Prediction of Climate - Dymnikov V.P.

Lecture 16 - Free Surface Flows. Applied Computational Fluid Dynamics

Lecture 6 - Boundary Conditions. Applied Computational Fluid Dynamics

Heat Transfer by Free Convection

Lecture 17: Conformal Invariance

ALL GROUND-WATER HYDROLOGY WORK IS MODELING. A Model is a representation of a system.

Parallel 3D Image Segmentation of Large Data Sets on a GPU Cluster

Time domain modeling

Coupling Forced Convection in Air Gaps with Heat and Moisture Transfer inside Constructions

39th International Physics Olympiad - Hanoi - Vietnam Theoretical Problem No. 3

Notes: Most of the material in this chapter is taken from Young and Freedman, Chap. 12.

Convection in water (an almost-incompressible fluid)

TFAWS AUGUST 2003 VULCAN CFD CODE OVERVIEW / DEMO. Jeffery A. White. Hypersonic Airbreathing Propulsion Branch

Domain Decomposition Methods. Partial Differential Equations

Chapter 8: Flow in Pipes

Purdue University - School of Mechanical Engineering. Objective: Study and predict fluid dynamics of a bluff body stabilized flame configuration.

5.4 The Heat Equation and Convection-Diffusion

Data Mining: Algorithms and Applications Matrix Math Review

Diffusion: Diffusive initial value problems and how to solve them

Frequency-domain and stochastic model for an articulated wave power device

In other words the graph of the polynomial should pass through the points

The Navier Stokes Equations

Chapter 5 Adaptive Mesh, Embedded Boundary Model for Flood Modeling

Second Order Linear Partial Differential Equations. Part I

O.F.Wind Wind Site Assessment Simulation in complex terrain based on OpenFOAM. Darmstadt,

TWO-DIMENSIONAL FINITE ELEMENT ANALYSIS OF FORCED CONVECTION FLOW AND HEAT TRANSFER IN A LAMINAR CHANNEL FLOW

CFD Based Air Flow and Contamination Modeling of Subway Stations

Review of Vector Analysis in Cartesian Coordinates

COMPARISON OF SOLUTION ALGORITHM FOR FLOW AROUND A SQUARE CYLINDER

Inner Product Spaces

Real-Time Fluid Dynamics for Games. Jos Stam Research Alias wavefront

Basic Equations, Boundary Conditions and Dimensionless Parameters

HEAT TRANSFER CODES FOR STUDENTS IN JAVA

1 Finite difference example: 1D implicit heat equation

Feature Commercial codes In-house codes

11 Navier-Stokes equations and turbulence

Instantaneous Rate of Change:

NUMERICAL SIMULATION OF REGULAR WAVES RUN-UP OVER SLOPPING BEACH BY OPEN FOAM

Fourth-Order Compact Schemes of a Heat Conduction Problem with Neumann Boundary Conditions

Paper Pulp Dewatering

Including thermal effects in CFD simulations

A Multigrid Tutorial part two

Høgskolen i Narvik Sivilingeniørutdanningen STE6237 ELEMENTMETODER. Oppgaver

Finite Volume Methods

MATHEMATICS FOR ENGINEERING DIFFERENTIATION TUTORIAL 1 - BASIC DIFFERENTIATION

A Fast Double Precision CFD Code using CUDA

The EOQ Inventory Formula

Lecture 4 Classification of Flows. Applied Computational Fluid Dynamics

Lecture 3. Turbulent fluxes and TKE budgets (Garratt, Ch 2)

EXAMPLE: Water Flow in a Pipe

SECTION VI: FLOOD ROUTING. Consider the watershed with 6 sub-basins. Q 1 = Q A + Q B (Runoff from A & B)

Manufacturing Equipment Modeling

Transcription:

Part II: Finite Difference/Volume Discretisation for CFD Finite Volume Metod of te Advection-Diffusion Equation A Finite Difference/Volume Metod for te Incompressible Navier-Stokes Equations Marker-and-Cell Metod, Staggered Grid Spatial Discretisation of te Continuity Equation Spatial Discretisation of te Momentum Equations Time Discretisation Corin Projection Implementation Aspects Module 9: Case Study Computational Fluid Dynamics, Winter 013/014 19

Finite Volume Metod Advection-Diffusion Equation compute tracer concentration q wit diffusion β and convection v: βq xx + vq) x = 0 on Ω = 0, 1) wit boundary conditions q0) = 1 and q1) = 0. equidistant grid points x i = i, grid cells [x i, x i+1 ] back to representation via conservation law for one grid cell): xi+1 x i x x i+1 F x) dx = Fx) = 0 x i wit Fx) = F qx)) = βq x x) + vqx). we need to compute te flux F at te boundaries of te grid cells; owever, assume qx) piecewise constant witin te grid cells Module 9: Case Study Computational Fluid Dynamics, Winter 013/014 0

Finite Volume Metod Advection-Diffusion Equation ) wanted: compute Fx i ) wit Fqx)) = βq x x) + vqx) were qx) := q i for eac Ω i = [x i, x i+1 ] computing te diffusive flux is straigtforward: options for advective flux vq: symmetric flux: βq x xi+1 = β qx i+1) qx i ) upwind flux: vq xi+1 = vqx i) + vqx i+1 ) vq xi+1 = { vqxi ) if v > 0 vqx i+1 ) if v < 0 Module 9: Case Study Computational Fluid Dynamics, Winter 013/014 1

Finite Volume Metod Advection-Diffusion Equation 3) system of equations: for all i x i+1 F x) = F x i+1 ) Fx i ) = 0 x i for symmetric flux: β qx i+1) qx i ) + qx i 1 ) + v qx i+1) qx i 1 ) = 0 leads to non-pysical beaviour as soon as β < v observe signs of matrix elements!) system of equations for upwind flux assume v > 0): β qx i+1) qx i ) + qx i 1 ) + v qx i) qx i 1 ) = 0 stable, but overly diffusive solutions positive definite matrix) Module 9: Case Study Computational Fluid Dynamics, Winter 013/014

Marker-and-Cell Metod Staggered Grid Marker-and-Cell metod Harlow and Welc, 1965): discretization sceme: Finite Differences can be sown to be equivalent to Finite Volumes, owever based on a so-called staggered grid: Cartesian grid rectangular grid cells), wit cell centres at x i,j := i, j), e.g. pressure located in cell centres velocities tose in normal direction) located on cell edges Module 9: Case Study Computational Fluid Dynamics, Winter 013/014 3

Spatial Discretisation Continuity Equation: mass conservation: discretise u evaluate derivative at cell centres, allows central derivatives: u) i,j = u x + v i,j y u i,j u i 1,j + v i,j v i,j 1 i,j remember: u i,j and v i,j located on cell edges notation: u) i,j := u) xi,j evaluate expression at cell centre x i,j ) Module 9: Case Study Computational Fluid Dynamics, Winter 013/014 4

Spatial Discretisation Pressure Terms note: velocities located on midpoints of cell edges u v t =..., i+ 1,j t =... i,j+ 1 = all derivatives need to be approximated at midpoints of cell edges! pressure term p: central differences for first derivatives as pressure is located in cell centres) p x p i+1,j p i,j p, i+ 1,j y p i,j+1 p i,j i,j+ 1 Module 9: Case Study Computational Fluid Dynamics, Winter 013/014 5

Spatial Discretisation Diffusion Term for diffusion term u: use standard 5- or 7-point stencil D: 3D: u i,j u i 1,j + u i,j 1 4u i,j + u i+1,j + u i,j+1 u i,j,k u i 1,j,k + u i,j 1,k + u i,j,k 1 6u i,j,k + u i+1,j,k + u i,j+1,k + u i,j,k+1 Module 9: Case Study Computational Fluid Dynamics, Winter 013/014 6

Spatial Discretisation Convection Terms treat derivatives of nonlinear terms u ) u: central differences for momentum equation in x-direction): u u u i+1,j u i 1,j x u i,j, v u i+ 1,j y v u i,j+1 u i,j 1 xi+ i+ 1,j 1,j wit v ) xi+ = 1 1 4 vi,j + v i,j 1 + v i+1,j + v i+1,j 1,j upwind differences for momentum equation in x-direction): u u u i,j u i 1,j x u i,j, v u xi+ y v u i,j u i,j 1 xi+ 1 1 xi+,j 1,j,j if u i,j > 0 and v xi+ 1,j > 0 mix of central and upwind differences possible and used Module 9: Case Study Computational Fluid Dynamics, Winter 013/014 7

Time Discretisation recall te incompressible Navier-Stokes equations: u = 0 t u + u ) u = p + 1 Re u + f note te role of te unknowns: or 3 equations for velocities x, y, and z component) resulting from momentum conservation 4t equation mass conservation) to close te system; required to determine pressure p owever, p does not occur explicitly in mass conservation possible approac: Corin s projection metod p acts as a variable to enforce te mass conservation as side condition Module 9: Case Study Computational Fluid Dynamics, Winter 013/014 8

Time Discretisation Corin Projection continuous NSE: ) ρ t u + u ) u + p µ u = f u = 0 semi-discrete NSE after spatial discretisation): A u + D u + C u ) u M T p = f, 3) derive semi-discrete continuity equation 4) w.r.t. t: M u = 0, 4) M u = 0. 5) formally invert Eq. 3) w.r.t. u and insert into 5) discrete pressure Poisson equation PPE): MA 1 M T ) p = MA 1 f + D u + C u ) u ), 6) } {{ } =:Q Module 9: Case Study Computational Fluid Dynamics, Winter 013/014 9

Time Discretisation Corin Projection updating te velocities: discretise time wit explicit metod explicit Euler, e.g.): u n+1) u n) τ =... update velocity correctly : solve momentum equations 3) use pressure p of PPE solution to compute discrete pressure gradients M T p : u n+1) = u n) + τ D u n) C u n) ) u n) + f n) + M T p ) costs: solve 1 linear system of equations in eac time step! Module 9: Case Study Computational Fluid Dynamics, Winter 013/014 30

Implementation geometry representation as a flag field Marker-and-Cell) flag field as an array of booleans: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 input data boundary conditions) and output data computed results) as arrays Module 9: Case Study Computational Fluid Dynamics, Winter 013/014 31

Implementation ) Lab course Scientific Computing Computational Fluid Dynamics : modular C/C++ code parallelization: simple data parallelism, domain decomposition straigtforward MPI-based parallelization excange of gost layers) target arcitectures: parallel computers wit distributed memory clusters possible extensions: free-surface flows te falling drop ) multigrid solver for te pressure equation eat transfer Module 9: Case Study Computational Fluid Dynamics, Winter 013/014 3

Part III: Te Sallow Water Equations and Finite Volumes Revisited Te Sallow Water Equations Modelling Scenario: Tsunami Simulation Finite Volume Discretisation Central and Upwind Fluxes Lax-Friedrics Flux Towards Tsunami Simulation Wave Speed of Tsunamis Treatment of Batymetry Data Module 9: Case Study Computational Fluid Dynamics, Winter 013/014 33

Te Sallow Water Equations t u v + x u u + 1 g + y uv v uv = St, x, y) v + 1 g Comments on modelling: generalized D yperbolic PDE: q =, u, v) T t q + x Fq) + y Gq) = St, x, y) derived from conservations laws for mass and momentum may be derived by vertical averaging from te 3D incompressible Navier-Stokes equations compare to Euler equations: density ρ vs. water dept Module 9: Case Study Computational Fluid Dynamics, Winter 013/014 34

Modelling Scenario: Tsunami Simulation Te Ocean as Sallow Water?? compare orizontal 1000 km) to vertical 5 km) lengt scale wave lengts large compared to water dept vertical flow may be neglected; movement of te entire water column Module 9: Case Study Computational Fluid Dynamics, Winter 013/014 35

Modelling Scenario: Tsunami Simulation Te Ocean as Sallow Water?? compare orizontal 1000 km) to vertical 5 km) lengt scale wave lengts large compared to water dept vertical flow may be neglected; movement of te entire water column Module 9: Case Study Computational Fluid Dynamics, Winter 013/014 35

Modelling Scenario: Tsunami Simulation Te Ocean as Sallow Water?? compare orizontal 1000 km) to vertical 5 km) lengt scale wave lengts large compared to water dept vertical flow may be neglected; movement of te entire water column Module 9: Case Study Computational Fluid Dynamics, Winter 013/014 35

Modelling Scenario: Tsunami Simulation Te Ocean as Sallow Water?? compare orizontal 1000 km) to vertical 5 km) lengt scale wave lengts large compared to water dept vertical flow may be neglected; movement of te entire water column Module 9: Case Study Computational Fluid Dynamics, Winter 013/014 35

Modelling Scenario: Tsunami Simulation ) Tsunami Modelling wit te Sallow Water equations: source term Sx, y) includes batymetry data i.e., elevation of ocean floor) Coriolis forces, friction, etc., as possible furter terms boundary conditions are difficult: coastal inundation, outflow at domain boundaries Module 9: Case Study Computational Fluid Dynamics, Winter 013/014 36

Modelling Scenario: Tsunami Simulation ) Tsunami Modelling wit te Sallow Water equations: source term Sx, y) includes batymetry data i.e., elevation of ocean floor) Coriolis forces, friction, etc., as possible furter terms boundary conditions are difficult: coastal inundation, outflow at domain boundaries Module 9: Case Study Computational Fluid Dynamics, Winter 013/014 36

Modelling Scenario: Tsunami Simulation ) Tsunami Modelling wit te Sallow Water equations: source term Sx, y) includes batymetry data i.e., elevation of ocean floor) Coriolis forces, friction, etc., as possible furter terms boundary conditions are difficult: coastal inundation, outflow at domain boundaries Module 9: Case Study Computational Fluid Dynamics, Winter 013/014 36

Modelling Scenario: Tsunami Simulation ) Tsunami Modelling wit te Sallow Water equations: source term Sx, y) includes batymetry data i.e., elevation of ocean floor) Coriolis forces, friction, etc., as possible furter terms boundary conditions are difficult: coastal inundation, outflow at domain boundaries Module 9: Case Study Computational Fluid Dynamics, Winter 013/014 36

Finite Volume Discretisation discretise system of PDEs t q + x Fq) + y Gq) = St, x, y) wit q := u F q) := v u u + 1 g Gq) := uv v uv v + 1 g basic form of numerical scemes: Q n+1) i,j = Q n) i,j τ F n) i+ 1,j F n) i 1,j ) τ G n) i,j+ 1 ) G n) i,j 1 were F n) i+ 1 Gn),j,,... approximate te flux functions F q) and i,j+ 1 Gq) at te grid cell boundaries Module 9: Case Study Computational Fluid Dynamics, Winter 013/014 37

Central and Upwind Fluxes define fluxes F n) i+ 1 Gn),j,,... via 1D numerical flux function F: i,j+ 1 F n) i+ 1 central flux: F n) i+ 1 = F Q n) i, Q n) ) i+1 = F Q n) i, Q n) ) 1 i+1 := G n) j 1 F Q n) i = F Q n) j 1, ) Qn) j ) n) ) ) + F Q i+1 leads to unstable metods for convective transport upwind flux ere, for -equation, F ) = u): F n) i+ 1 = F { n) i, n) ) u i if u i+ 1 i+1 := u i+1 if u i+ 1 > 0 < 0 stable, but includes artificial diffusion Module 9: Case Study Computational Fluid Dynamics, Winter 013/014 38

Local) Lax-Friedrics Flux classical Lax-Friedrics metod uses as numerical flux: F n) = F Q n) i+ 1 i, Q n) ) 1 i+1 := F Q n) ) n) i + F Q i+1) ) n) ) Q i+1 τ Qn) i can be interpreted as central flux plus diffusion flux: τ n) Q i+1 ) Qn) i = τ Qn) wit diffusion coefficient τ, were c := τ velocity one grid cell per time step ) i+1 Qn) i is some kind of idea of local Lax-Friedrics metod: use te appropriate velocity F n) i+ 1 := 1 F Q n) i ) n) ) ) + F Q i+1 a i+ 1 n) Q i+1 ) Qn) i Module 9: Case Study Computational Fluid Dynamics, Winter 013/014 39

Wave Speed of Tsunamis consider te 1D case t ) u + x u ) u + 1 g = 0 wit q = q 1, q ) T :=, u) T, we obtain ) q1 + q t q x q /q 1 + 1 gq 1 ) = 0 write in convective form: t q1 q ) + f x q1 q ) = 0 wit ) ) f f1 / q = 1 f 1 / q 0 1 = f / q 1 f / q q /q 1 + gq 1 q /q 1 = 0 ) 1 u + g u Module 9: Case Study Computational Fluid Dynamics, Winter 013/014 40

Wave Speed of Tsunamis ) compute eigenvectors and eigenvalues of f : λ 1/ = u ± ) g r 1/ 1 = u ± g and ten wit f = RΛR 1, were R := r 1, r ) and Λ := diagλ 1, λ ), we can diagonalise te PDE: ) w1 + Λ ) w1 = 0, w = R 1 q t w x w for small canges in and small velocities, we tus obtain tat waves are advected i.e., travel) at speed λ 1/ ± g recall local Lax-Friedrics metod: F n) i+ 1 := 1 coose a i+ 1 F Q n) i = max{λ k } ) n) ) ) + F Q i+1 a i+ 1 Q n) i Q n) ) i 1 Module 9: Case Study Computational Fluid Dynamics, Winter 013/014 41

Sallow Water Equations wit Batymetry b t u + x v u u + 1 g + y uv v uv = v + 1 g 0 gb) x gb) y Questions for numerics: treat b) x and b) y as source terms or include tese into flux computations? preserve certain properties of solutions e.g., lake at rest Module 9: Case Study Computational Fluid Dynamics, Winter 013/014 4

Sallow Water Equations wit Batymetry ) Consider Lake at Rest Scenario: at rest : velocities u = 0 and v = 0 examine local Lax-Friedrics flux in equation: F n) i+ 1 = 1 u) n) i ) + u) n) i+1 a i+ 1 n) i+1 ) n) i = 0 F n) i+ 1 F n) i 1 = a i+ 1 n) i+1 ) a i 1 n) i + n) i n) i 1) = 0 note: a i± 1 g and if b i 1 b i b i+1 ten i 1 i i+1 tus: lake at rest not an equilibrium solution for local Lax-Friedrics flux Additional problems: complicated numerics close to te sore in particular: wetting and drying inundation of te coast) Module 9: Case Study Computational Fluid Dynamics, Winter 013/014 43

References and Literature Course material is mostly based on: R. J. LeVeque: Finite Volume Metods for Hyperbolic Equations, Cambridge Texts in Applied Matematics, 00. M. Griebel, T. Dornseifer and T. Neunoeffer: Numerical Simulation in Fluid Dynamics: A Practical Introduction, SIAM Monograps on Matematical Modeling and Computation, SIAM, 1997. Sallow Water Code SWE: ttp://www5.in.tum.de/swe/ Module 9: Case Study Computational Fluid Dynamics, Winter 013/014 44