Numerical Methods for PDEs. SSC Workgroup Meetings Juan J. Alonso October 8, SSC Working Group Meetings, JJA 1

Similar documents
Multigrid Algorithms for Three-Dimensional RANS Calculations - The SUmb Solver

Airfoil Design Optimization Using Reduced Order Models Based on Proper Orthogonal Decomposition

Debojyoti Ghosh. Adviser: Dr. James Baeder Alfred Gessow Rotorcraft Center Department of Aerospace Engineering

Realistic Animation of Fluids

Introduction to Multigrid and its Parallelization

Implementation of an integrated efficient parallel multiblock Flow solver

Solving Partial Differential Equations on Overlapping Grids

An Investigation of Directional-Coarsening And Line-Implicit Smoothing Applied to Agglomeration Multigrid

NIA CFD Seminar, October 4, 2011 Hyperbolic Seminar, NASA Langley, October 17, 2011

Nonoscillatory Central Schemes on Unstructured Triangulations for Hyperbolic Systems of Conservation Laws

Studies of the Continuous and Discrete Adjoint Approaches to Viscous Automatic Aerodynamic Shape Optimization

A Hybrid Cartesian Grid and Gridless Method for Compressible Flows

Computation of Fictitious Gas Flow with Euler Equations

The gas-kinetic methods have become popular for the simulation of compressible fluid flows in the last

Computational Fluid Dynamics for Engineers

High-Order Navier-Stokes Simulations using a Sparse Line-Based Discontinuous Galerkin Method

2.7 Cloth Animation. Jacobs University Visualization and Computer Graphics Lab : Advanced Graphics - Chapter 2 123

3D ADI Method for Fluid Simulation on Multiple GPUs. Nikolai Sakharnykh, NVIDIA Nikolay Markovskiy, NVIDIA

The 3D DSC in Fluid Simulation

PROGRAMMING OF MULTIGRID METHODS

A Two-Dimensional Multigrid-Driven Navier-Stokes Solver for Multiprocessor Architectures

On the high order FV schemes for compressible flows

A MULTI-DOMAIN ALE ALGORITHM FOR SIMULATING FLOWS INSIDE FREE-PISTON DRIVEN HYPERSONIC TEST FACILITIES

1.2 Numerical Solutions of Flow Problems

The Immersed Interface Method

Acceleration of a 2D Euler Flow Solver Using Commodity Graphics Hardware

A fully implicit Navier-Stokes algorithm for unstructured grids incorporating a two-equation turbulence model

Solution of 2D Euler Equations and Application to Airfoil Design

Multigrid Pattern. I. Problem. II. Driving Forces. III. Solution

FAST ALGORITHMS FOR CALCULATIONS OF VISCOUS INCOMPRESSIBLE FLOWS USING THE ARTIFICIAL COMPRESSIBILITY METHOD

Robustness improvement of polyhedral mesh method for airbag deployment simulations. TU Delft

We present a high-order accurate space-time discontinuous Galerkin method for solving two-dimensional

Analysis of the Adjoint Euler Equations as used for Gradient-based Aerodynamic Shape Optimization

Numerical Methods in Aerodynamics. Fluid Structure Interaction. Lecture 4: Fluid Structure Interaction

Discontinuous Galerkin Spectral Element Approximations for CFD

Recent progress in the area of meshless methods for CFD computations has shown great promise in terms

Modeling External Compressible Flow

Numerical Analysis of Shock Tube Problem by using TVD and ACM Schemes

Numerical Simulation of Coupled Fluid-Solid Systems by Fictitious Boundary and Grid Deformation Methods

Hybrid Simulation of Wake Vortices during Landing HPCN-Workshop 2014

Tutorial 1. Introduction to Using FLUENT: Fluid Flow and Heat Transfer in a Mixing Elbow

Interface and Boundary Schemes for High-Order Methods

Non-Newtonian Transitional Flow in an Eccentric Annulus

weighted minimal surface model for surface reconstruction from scattered points, curves, and/or pieces of surfaces.

Faculty of Mechanical and Manufacturing Engineering, University Tun Hussein Onn Malaysia (UTHM), Parit Raja, Batu Pahat, Johor, Malaysia

STAR-CCM+: Wind loading on buildings SPRING 2018

Multi-Element High-Lift Configuration Design Optimization Using Viscous Continuous Adjoint Method

The Development of a Navier-Stokes Flow Solver with Preconditioning Method on Unstructured Grids

Immersed Boundary Method and Chimera Method applied to Fluid-

Possibility of Implicit LES for Two-Dimensional Incompressible Lid-Driven Cavity Flow Based on COMSOL Multiphysics

Algorithmic Developments in TAU

A Multigrid Block LU-SGS Algorithm for Euler Equations on Unstructured Grids

The purpose of this tutorial is to illustrate how to set up and solve a problem using the. Moving Deforming Mesh (MDM) using the layering algorithm.

Two-dimensional laminar shock wave / boundary layer interaction

Application of coupled solver technology to CFD modeling of multiphase flows with CFX

Strömningslära Fluid Dynamics. Computer laboratories using COMSOL v4.4

Mesh-Free Applications for Static and Dynamically Changing Node Configurations

Exploring unstructured Poisson solvers for FDS

Optimization with Gradient and Hessian Information Calculated Using Hyper-Dual Numbers

ITU/FAA Faculty of Aeronautics and Astronautics

Verification of Moving Mesh Discretizations

Implementing third order compressible flow solver for hexahedral meshes in OpenFoam

An Optimization Method Based On B-spline Shape Functions & the Knot Insertion Algorithm

Unstructured Mesh Generation for Implicit Moving Geometries and Level Set Applications

Compressible Flow in a Nozzle

SELECTIVE ALGEBRAIC MULTIGRID IN FOAM-EXTEND

A high order moving boundary treatment for compressible inviscid flows 1. Abstract

Development of an Integrated Computational Simulation Method for Fluid Driven Structure Movement and Acoustics

Introduction to C omputational F luid Dynamics. D. Murrin

computational Fluid Dynamics - Prof. V. Esfahanian

A higher-order finite volume method with collocated grid arrangement for incompressible flows

Sensitivity Analysis for the Compressible Navier-Stokes Equations Using a Discontinuous Galerkin Method

Parallel Algorithms: Adaptive Mesh Refinement (AMR) method and its implementation

Analysis, extensions and applications of the Finite-Volume Particle Method (FVPM) PN-II-RU-TE Synthesis of the technical report -

An adaptive discretization of compressible flow using a multitude of moving Cartesian grids

ADJOINT methods for sensitivity analysis involving partial

A High-Order Accurate Unstructured GMRES Solver for Poisson s Equation

FOURTH ORDER COMPACT FORMULATION OF STEADY NAVIER-STOKES EQUATIONS ON NON-UNIFORM GRIDS

Computational Study of Laminar Flowfield around a Square Cylinder using Ansys Fluent

Development of mesh refinement methods at CFD codes for computational fluid mechanics problems DIPLOMA THESIS

An Upwind Multigrid Method for Solving Viscous Flows on Unstructured Triangular Meshes

Development of a Computational Framework for Block-Based AMR Simulations

A COUPLED FINITE VOLUME SOLVER FOR THE SOLUTION OF LAMINAR TURBULENT INCOMPRESSIBLE AND COMPRESSIBLE FLOWS

ACCELERATION OF A COMPUTATIONAL FLUID DYNAMICS CODE WITH GPU USING OPENACC

An Embedded Cartesian Grid Euler Solver with Radial Basis Function for Boundary Condition Implementation

Unstructured Grid Numbering Schemes for GPU Coalescing Requirements

The Level Set Method. Lecture Notes, MIT J / 2.097J / 6.339J Numerical Methods for Partial Differential Equations

Partial Differential Equations

NUMERICAL VISCOSITY. Convergent Science White Paper. COPYRIGHT 2017 CONVERGENT SCIENCE. All rights reserved.

Adjoint Solver Workshop

A linear solver based on algebraic multigrid and defect correction for the solution of adjoint RANS equations

Multi-Mesh CFD. Chris Roy Chip Jackson (1 st year PhD student) Aerospace and Ocean Engineering Department Virginia Tech

Numerical Simulations of Fluid-Structure Interaction Problems using MpCCI

SHOCK WAVES IN A CHANNEL WITH A CENTRAL BODY

STABILIZED FINITE ELEMENT METHOD WITH AN ALE STRATEGY TO SOLVE MOVING BOUNDARIES PROBLEMS

Large-scale Gas Turbine Simulations on GPU clusters

39th AIAA Aerospace Sciences Meeting and Exhibit January 8 11, 2001/Reno, NV

Flux Vector Splitting Methods for the Euler Equations on 3D Unstructured Meshes for CPU/GPU Clusters

Driven Cavity Example

CUDA. Fluid simulation Lattice Boltzmann Models Cellular Automata

Transcription:

Numerical Methods for PDEs SSC Workgroup Meetings Juan J. Alonso October 8, 2001 SSC Working Group Meetings, JJA 1

Overview These notes are meant to be an overview of the various memory access patterns in typical Partial Differential Equation (PDE) solvers in the physical sciences. Although our experience has been mostly in fluids and structures, the comments should be applicable to other systems governed by PDEs. The comments in these slides are based on our experience with the following types of flow solvers: 1. Single-block structured. 2. Multiblock structured. 3. Tetrahedral unstructured. SSC Working Group Meetings, JJA 2

4. Cartesian unstructured. Only a few comments about Cartesian unstructured methods will be made (for DoE Adaptive Mesh Refinement - AMR applications.) SSC Working Group Meetings, JJA 3

ABird seyeviewofapde Regardless of the physical system you want to solve, a large majority of the PDEs in the physical sciences can be written in the following form w t + R(w) =0, (1) where w is the vector of dependent variables and R is a typically non-linear vector function called the residual. The equation is solved in a domain of finite size subject to some boundary conditions. The domain is discretized using a mesh of some type and the flow variables are stored at either the nodes or the cell centers. R(w) results from the process of semidiscretization by which all of the spatial derivatives are discretized, while the time derivatives are not. All of the first, second, or higher order spatial derivatives of the dependent variables are discretized using some stencil and lumped into R(w). SSC Working Group Meetings, JJA 4

How Do You Write a PDE solver? 2 Min Crash Course Just follow the recipe: 1. Choose a suitable spatial discretization. 2. For all nodes in the mesh, calculate the spatial residual according to the discretization chosen. 3. Update our current guess of the solution w using either a time-stepping scheme or some sort of matrix factorization. 4. Repeat until converged. SSC Working Group Meetings, JJA 5

Euler Equations in 2D For example, the 2D compressible, Euler (inviscid) equations can be used as an approximation to the behavior of a flow. Let p, ρ, u, v, H, and E denote the pressure, density, cartesian velocity components, total enthalpy, and total energy respectively. Consider a control volume Ω with boundary Ω. The equations of motion of the fluid can then be written in integral form as d dt Ω w dx dy + Ω (f dy g dx) =0, (2) SSC Working Group Meetings, JJA 6

where w is the vector of flow variables ρ ρu w = ρv ρe, and f, g are the Euler flux vectors f = ρ(u x t ) ρu(u x t )+p ρv(u x t ) ρe(u x t )+pu, g = ρ(v y t ) ρu(v y t ) ρv(v y t )+p ρe(v y t )+pv. Also, for an ideal gas, the equation of state may be written as p =(γ 1) ρ [ E 1 ] 2 (u2 + v 2 ). SSC Working Group Meetings, JJA 7

Applying Equation 2 independently to each cell in the mesh we obtain a set of ordinary differential equations of the form d dt (w ij V ij )+R(w ij )=0, (3) where V ij is the volume of the i, j cell and the residual R(w ij ) is obtained by evaluating the flux integral in Equation 2. Note that if you used the Reynolds Averaged Navier-Stokes (RANS) equations, the only thing you need to do is to add another portion of the residual R(w). Once the residual has been calculated, it can be used to update the current guess for the solution w using Equation 1. This process is repeated iteratively until convergence is reached. SSC Working Group Meetings, JJA 8

Applicability Notice that this decription of semi-discrete PDEs is applicable to 1. Euler and RANS solvers. 2. LES (Large Eddy Simulation) procedures. 3. Finite Element methods. and largely any PDE solution method that is matrix-free and that doesn t use numerical techniques such as FFTs, etc. For purposes of SSC, the most important thing is to ask ourselves the following questions: SSC Working Group Meetings, JJA 9

1. How is the memory access pattern affected by the stencil of the semidiscretization? 2. How does the choice of mesh topology affect these memory accesses? 3. Once a node in the mesh (discrete memory location) is touched, what are the operations that typically need to be performed on it? It turns out that the stencil of the spatial discretization and the mesh choices are fundamental to understanding how memory is accessed. SSC Working Group Meetings, JJA 10

Single-Block Structured Discretization Figure 1: Structured Mesh Usually for domains that are not geometrically complex (although flow may be). SSC Working Group Meetings, JJA 11

Typical codes: FLO87, FLO107, DNS, development codes for testing various ideas, etc. Mesh ordering follows logical structure of an n-dimensional array: neighbors (important in computing the residual) can be easily accessed by unit shifts on array indices. Connectivity of the mesh is implicit in the data structure. For cache optimization purposes, varying stride in each coordinate direction is important. SSC Working Group Meetings, JJA 12

Multi-Block Structured Discretization Figure 2: Multiblock Structured Mesh Around an Airplane Geometrically complex domains. SSC Working Group Meetings, JJA 13

Typical codes: FLO107-MB, TFLO, etc. Mesh ordering within each block follows logical structure of an n- dimensional array: neighbors (important in computing the residual) can be easily accessed by unit shifts on array indices. Connectivity of each block is implicit in the data structure. Inter-block connectivity must be supplied by user and defines the way in which all blocks are attached to each other. Halo communication typically used to isolate blocks. SSC Working Group Meetings, JJA 14

Tetrahedral Unstructured Discretization Figure 3: Unstructured Tetrahedral Mesh Around A320 Used for domains with high geometric complexity (full aircraft, combustors, etc.) SSC Working Group Meetings, JJA 15

Typical codes: AIRPLANE, combustor LES code, etc. Mesh locations follow no particular order. In fact, mesh can be reordered to improve cache performance. Connectivity of the mesh must be supplied by user. Mapping of mesh to data structure fundamental to achieve high performance in a variety of computers. SSC Working Group Meetings, JJA 16

AMR Cartesian Discretization Figure 4: AMR Cartesian Mesh Used for domains with high geometric complexity (full aircraft, combustors, etc.) but typically only for either Euler flows or domains with complex fluid phenomena but Cartesian boundaries. SSC Working Group Meetings, JJA 17

Typical codes: DoE codes, ASCI Chicago, CART3D. Mesh locations are structured but the underlying data structure is usually of the tree type. Connectivity of the mesh is inherent in data structure but not trivial. Mapping of mesh to data structure fundamental to achieve high performance in a variety of computers. SSC Working Group Meetings, JJA 18

Stencils in Various Types of Meshes Single-block structured and multi-block structured codes usually have a one- or two layer stencil structure. That means that in 2D all nodes/cells that adjoin the node/cell in question are likely to belong to the stencil. Examples later on. The situation in unstructured meshes is similar, although, due to the nature of the mesh, a little more random SSC Working Group Meetings, JJA 19

Note that in a node-based unstructured mesh solver, if a double halo is required, one may need to reach 2 edges over. Depending on the edge connectivity (and its incidence order) one may need a large amount of data. SSC Working Group Meetings, JJA 20

Operations/Work Required For a typical solver like TFLO, the following operations need to be performed, every iteration, for every cell in the mesh (TFLO is a cellcentered code.) Inviscid fluxes Artificial dissipation fluxes SSC Working Group Meetings, JJA 21

Viscous fluxes Time-step computation Residual smoothing SSC Working Group Meetings, JJA 22

Solution update Other operations need to be considered such as 1. Multigrid 2. Interpolation between meshes for multiphysics computations (DoE) 3. Matrix factorization steps (ADI and similar). Similar to Residual Smoothing. 4. Local and global preconditioning (fall in the classes described above). SSC Working Group Meetings, JJA 23

5. Advanced artificial dissipation algorithms. SSC Working Group Meetings, JJA 24

Code Excerpts Subroutine EFLUX from FLO82 (2D Euler solver for airfoils) C C C FLUX IN THE J DIRECTION DO 30 J=2,JL DO 30 I=2,IL XX = X(I,J,1) -X(I-1,J,1) YX = X(I,J,2) -X(I-1,J,2) PA = P(I,J+1) +P(I,J) QSP = (XX*W(I,J+1,3) -YX*W(I,J+1,2))/W(I,J+1,1) QSM = (XX*W(I,J,3) -YX*W(I,J,2))/W(I,J,1) FS(I,J,1) = QSP*W(I,J+1,1) +QSM*W(I,J,1) FS(I,J,2) = QSP*W(I,J+1,2) +QSM*W(I,J,2) -YX*PA FS(I,J,3) = QSP*W(I,J+1,3) +QSM*W(I,J,3) +XX*PA FS(I,J,4) = QSP*(W(I,J+1,4) +P(I,J+1)) +QSM*(W(I,J,4) +P(I,J)) SSC Working Group Meetings, JJA 25

C C C 30 CONTINUE ACCUMULATE THE FLUX IN THE J DIRECTION DO 40 N=1,4 DO 40 J=2,JL DO 40 I=2,IL DW(I,J,N) = DW(I,J,N) +FS(I,J,N) -FS(I,J-1,N) 40 CONTINUE SSC Working Group Meetings, JJA 26

Key Issues/Questions In order to determine the features of a language that allows for all of these types of operations, we must be able to handle 1. All types (or a generalization) of the local stencils described earlier. 2. Ability to handle not just scalars, but also vector fields. 3. Rewrite code in such a way that all operations are performed one point at a time (outer loop on mesh nodes/cells, not operations!) 4. Must conceptualize the ability to do non-local operations (multigrid, residual smoothing, ADI). SSC Working Group Meetings, JJA 27

5. Must efficiently implement shifts in all coordinate directions so that data accesses with non-unity stride are fast. 6. For unstructured/cartesian AMR meshes, only real option is to copy small chunks of data obtained by domain decomposition (graph partitioning/graph coloring) and make sure that operations are performed efficiently within each chunk. 7. Others? SSC Working Group Meetings, JJA 28