AC274: Finite Differences for Classical Fields

Slides:



Advertisements
Similar presentations
Time averages and ensemble averages
Advertisements

Finite Difference Discretization of Hyperbolic Equations: Linear Problems Lectures 8, 9 and 10.
Joint Mathematics Meetings Hynes Convention Center, Boston, MA
Chapter 8 Elliptic Equation.
Quantum One: Lecture 3. Implications of Schrödinger's Wave Mechanics for Conservative Systems.
Numerical Uncertainty Assessment Reference: P.J. Roache, Verification and Validation in Computational Science and Engineering, Hermosa Press, Albuquerque.
Numerical Integration of Partial Differential Equations (PDEs)
No friction. No air resistance. Perfect Spring Two normal modes. Coupled Pendulums Weak spring Time Dependent Two State Problem Copyright – Michael D.
Atms 4320 Lab 2 Anthony R. Lupo. Lab 2 -Methodologies for evaluating the total derviatives in the fundamental equations of hydrodynamics  Recall that.
1 EE 616 Computer Aided Analysis of Electronic Networks Lecture 12 Instructor: Dr. J. A. Starzyk, Professor School of EECS Ohio University Athens, OH,
Introduction to Numerical Methods I
Ordinary Differential Equations (ODEs) 1Daniel Baur / Numerical Methods for Chemical Engineers / Implicit ODE Solvers Daniel Baur ETH Zurich, Institut.
2. Solving Schrödinger’s Equation Superposition Given a few solutions of Schrödinger’s equation, we can make more of them Let  1 and  2 be two solutions.
Numerical Methods for Partial Differential Equations CAAM 452 Spring 2005 Instructor: Tim Warburton.
Numerical Methods for Partial Differential Equations CAAM 452 Spring 2005 Lecture 2 Instructor: Tim Warburton.
Numerical Methods for Partial Differential Equations CAAM 452 Spring 2005 Lecture 6 Various Finite Difference Discretizations for the Advection Equations.
Numerical Methods for Partial Differential Equations
1 The Spectral Method. 2 Definition where (e m,e n )=δ m,n e n = basis of a Hilbert space (.,.): scalar product in this space In L 2 space where f * :
Finite Differences Finite Difference Approximations  Simple geophysical partial differential equations  Finite differences - definitions  Finite-difference.
Simulating Electron Dynamics in 1D
What is a model Some notations –Independent variables: Time variable: t, n Space variable: x in one dimension (1D), (x,y) in 2D or (x,y,z) in 3D –State.
Lecture 3.
1 EEE 431 Computational Methods in Electrodynamics Lecture 4 By Dr. Rasime Uyguroglu
7. Introduction to the numerical integration of PDE. As an example, we consider the following PDE with one variable; Finite difference method is one of.
Engineering Analysis – Computational Fluid Dynamics –
CIS888.11V/EE894R/ME894V A Case Study in Computational Science & Engineering We will apply several numerical methods to find a steady state solution of.
Lecture 21-22: Sound Waves in Fluids Sound in ideal fluid Sound in real fluid. Attenuation of the sound waves 1.
AMS 691 Special Topics in Applied Mathematics Lecture 8
The story so far… ATM 562 Fovell Fall, Convergence We will deploy finite difference (FD) approximations to our model partial differential equations.
Lecture 2. Finite Difference (FD) Methods Conservation Law: 1D Linear Differential Equation:
Lecture Objectives: - Numerics. Finite Volume Method - Conservation of  for the finite volume w e w e l h n s P E W xx xx xx - Finite volume.
1 EEE 431 Computational Methods in Electrodynamics Lecture 13 By Dr. Rasime Uyguroglu
General Considerations
1 Week 11 Numerical methods for ODEs 1.The basics: finite differences, meshes 2.The Euler method.
INTEGRATOR CLASSIFICATION & CHARACTERISTICS
1.1 Basic Concepts. Modeling
Numerical Solutions to the Diffusion Equation
Lecture 4 Complex numbers, matrix algebra, and partial derivatives
Digital and Non-Linear Control
EEE 431 Computational Methods in Electrodynamics
Lecture 4: Numerical Stability
Introduction to Numerical Methods I
Convection-Dominated Problems
Chapter 30.
Modeling of Traffic Flow Problems
Time Dependent Two State Problem
CHAPTER 5 The Schrodinger Eqn.
§7-4 Lyapunov Direct Method
ECE 576 – Power System Dynamics and Stability
Lecture 19 MA471 Fall 2003.
Description and Analysis of Systems
Convergence in Computational Science
CHAPTER 5 The Schrodinger Eqn.
Ensemble variance loss in transport models:
2. Solving Schrödinger’s Equation
Quantum One.
CSE 245: Computer Aided Circuit Simulation and Verification
Finite Volume Method for Unsteady Flows
Objective Numerical methods Finite volume.
Adaptive Perturbation Theory: QM and Field Theory
Thermal Energy & Heat Capacity:
Chapter 4. Time Response I may not have gone where I intended to go, but I think I have ended up where I needed to be. Pusan National University Intelligent.
Comparison of CFEM and DG methods
MATH 175: Numerical Analysis II
An optimized implicit finite-difference scheme for the two-dimensional Helmholtz equation Zhaolun Liu Next, I will give u an report about the “”
Linear Vector Space and Matrix Mechanics
Chapter 6. STABILITY Good relationships nurture you. They help you find yourself and who you are. I don’t mean just relationships with boys or men. Relationships.
Chapter 2 A Survey of Simple Methods and Tools
EE 616 Computer Aided Analysis of Electronic Networks Lecture 12
Presentation transcript:

AC274: Finite Differences for Classical Fields Sauro Succi We shall cover three broad classes of PDE’s: Transport: Advection-Diffusion-Reaction equations Porous media, environment, you_name_it Conservation: Continuity equation Ubiquituos! Gas-dynamics: Burgers equation Shock waves, Cosmological fluids, Growth phenomena …

The Four Levels MACRO Continuum Fields Probability distributions MESO Particles (atoms/molecules MICRO Complex Fields QUANTUM Wash out Irrelevant details (tube/baby problem)

Finite Differences for Transport PDE’s

Finite Differences for Classical Fields Transport PDE’s: Outline We introduce the basic criteria of space-time finite-difference Discretization of PDE’s. For the sake of simplicity, we explicitly refer to simple Diffusion –Advection-Reaction equations in d=1 spatial dimensions. In the process of discussing actual examples, we shall also introduce the general (and very important) notion of stability analysis through inspection of the Discrete Dispersion Relation. Generalizations to the broader class of ADR (Advection-Diffusion-Reaction) equations in d>1 are left as an exercise. They are conceptually straightforward but require some extra-coding, hence it is an excellent exercise.

PDE’s for transport phenomena Diffusion Equation Advection-Diffusion Equation Advection-Diffusion-Reaction Equation

Transport: analytic solutions Linear homogeneous: similarity group Translation Dilatation Growth/Decay Inhomogenous, non-linear: broken syms This is where numerics takes over analytics!

Spacetime crystal Uniform (for simplicity)

Finite-Difference Schemes The Discrete Derivative is by no means unique! Higher accuracy is obtained by using larger sets of discrete points = STENCIL

Consistency Continuum limit: The discrete operators must reduce to their continuum form: smoothly. The rate of error decay defines the order of accuracy (first, second ….)

Computational molecules (stencils) Differential operators become SPARSE MATRICES

Discrete Time: Forward Euler

Discrete derivatives = Sparse matrices 1 0=N N N+1=1

2D stencils

Non uniform lattices The coefficients a,b,c, pick-up a dependence on the position {a_j,c_j,b_j}, but the The matrix structure stays the same because LOCALITY is what matters. Accuracy is affected though, usually one order less and sometimes even stability. Let us see why:

Non uniform lattices Uniform limit a+b+c =0 still, but the diagonal is non-zero. What does this mean?

Accuracy Taylor-expand to second order: Zeroth order accuracy: OK OK First order accuracy: OK Second order accuracy : No, unless UNIFORM! BOTTOMLINE: Even the centered derivative is only first order accurate Serious problem? No, if you don’t insist on point-like convergence…

PDE’s in 1d: Transfer matrix Using local (nearest-neighbor) stencils and fwd Euler in time: Computational Molecule: Compact matrix form: (Tridiagonal) T_ij is appropriately called Transfer Matrix, as it transfers state at time n (Present) to time n+1 (Future).

Now to actual equations Diffusion Equation

Diffusion Equation d=1 Analytical solution: Dispersion Relation: Frequency vs Wavenumber (see later)

Discrete Time: Forward Euler

Discrete space: centered Handier notation In general tridiagonal form:

DE: Centered-Euler This is known as diffusive Courant-Friedrich-Levy (CFL) number. Key to stability. Transfer matrix: Note that a+b+c=1 by mass conservation.

Dispersion Relation The Dispersion Relation tells how different wavelengths propagate in space. It says ALL about linear systems. The solution is expressed as a superposition of plane-waves (exponential). Since the problem is linear we can focus on a single plane wave: The real part tells the propagation speed of the signal: The imaginary part tells the growth/decay rate Stable Unstable

Discrete Fourier space Low k High k

Discrete range and continuum limit In the limit kd ->0 thewave does not “see” discreteness anymore

DE: continuum DR For plane waves the following handy replacement rules hold: One-line algebra delivers: Namely: No propagation All wavelengths decay (absolute stability) the shortest decay quadratically fast Any consistent discretization must reproduce the above relations in the continuum limit:

Discrete vs Continuum DR The Discrete DR necessarily deviates from this, esp at high-k, since short wavelengths see the lattice. We are mostly interested in long wavelengths

Discrete vs Continuum DR Two main sources of discretization error: Real(omega), Phase Errors: Dispersion Imag(omega), Amplitude Errors: Numerical Diffusion Dispersion means that the plane wave propagates at a different speed Than continuum one, thus leading to distorsions in the profile and eventually Unphysical oscillations (Gibbs oscillations) Positive numerical diffusion leads to excessive damping. Negative numerical diffusion leads to artificial growth: Numerical instability

General DDR Useful manipulations: Divide second by first: with By squaring both sides and summing up:

General DDR We can draw some general conclusions: If a=b there cannot be any propagation (this is the case for pure Diffusion) 2) If b-a>0 the scheme cannot be stable for any h (this is the case for pure Advection with centered differences)

From General to DE DDR DE: Exact at any k By squaring both sides and summing up: with

Diffusion DDR: Stability (-2<X<0) The discrete stability condition reads: (Since X<0) (Since |X|<2) This is the diffusive CFL condition

DDR: continuum limit Exact at any k Continuum limit: The continuum limit is recovered: accurate to 2° order. The stability analysis shows that discretization errors canNOT trigger instability at any wavenumber

Stability/Realizability Probabilistic interpretation (a+b+c=1) Probability of moving up in time from left Probability of moving up in time from right Probability of moving up in time from center Much swifter: Realizability (all coeffs must be non-negative):

Let’s add some “wind” Advection-Diffusion Equation

AD Equation For the simple case U=const, the analytical solution reads: The AD dispersion relation: Propagation

Numerical dispersion: Gibbs phenomena

positive = overdamping Numerical Diffusion: positive = overdamping

Centered FD+Euler

ADE: Centered-Euler Two CFL’s

Stability vs Realizability Note that the limit D=0 (pure advection) is always UNSTABLE! Adv/Dif is measured by the cell-Peclet number:

Time-step constraints DIFFUSION is much more constraining than ADVECTION ! Upon refining the grid by a factor 2, advection requires dt/2, diffusion requires dt/4. Other time-discretizations are used for diffusion, So-called implicit methods. See the quantum mechanics lectures

Advection-Diffusion-Reaction A lot of applications in science and engineering (combustion, crystal growth, population bacteria dynamics

Important dim-less groups Peclet = Advection/Diffusion Pe>>1 for macroflows, and Pe<<1 for nanoflows Air: D=10^-6 m2/s. L=1m, U=1 m/s gives Pe=10^5… Water: D=10^-5 m2/s, L=10^-6, U=10^-3, gives Pe=10^-4 Damkohler = Chemistry/Diffusion Da>>1 for flames, and Da<<1 for well-stirred reactors With L=1m, D=10^-6, r<10^-6 react/s is well stirred, but at small scales lower reactivity can still yield high Da.

ADR Equation For the ideal case U=const and linear chemistry: The analytical solution is: In general, chemistry “wants” homogeneous states such that: This may have multiple solutions (fixed points): how do they manage to coexist?

The conflict (frustration) is resolved through INTERFACES Interface width: Infinitely fast chemistry (Da to infinity)

Logistic equation: population growth Capacity:

ADR Equation: analytics For the ideal case U=const and Chemical reactions Select the unstable modes (morphogenesis) Large scales grow: k<sqrt(r/D) Small scale decay: k>sqrt(r/D)

ADR: Centered-Euler Three CFL’s:

Cell dim-less groups Peclet=Advection/Diffusion Large Peclet stand for strong diffusion vs weak advection (microscopic transport) Damkohler=Reaction/Diffusion CFL: At the mesh-size scales the dimensionless number should not exceed O(1)

A nice research project Can yield quite complex behavior: Show movie of bacterial growth Growth up to a/b Decay to zero, extinction Random a(x) with <a> <0 but fluctuations with a(x)>o; Islands of growth (oasis) surrounded by an ocean of decay (desert). Q: Probability of survival? Show movies!

Boundary Conditions They strongly affect the solutions: BC select the bulk solutions compatible with the environmental constraints

Boundary Conditions: Dirichlet With explicit methods (present depends on past only) easy: Dirichlet: Bulk: j=2,N-1 Boundaries: j=1, j=N are taken by the BC specification: The bulk gives a (N-2)x(N-2) matrix:

Boundary Conditions: periodic 1 N

Full stability analysis (incl. Boundary) Find the numerical eigenvalues of the Transfer matrix For tridiagonal systems the eigenvalues are known analytically. For instance Diffusion Matrix {1,-2,1} gives In general, however, they must be found via numerical Eigenvalue solvers.

Assignements 1. Write a computer program to solve the 1d ADR with constant coefficients (periodic boundaries) 2. Same in 2D 3. Same in 3D (for the brave) 4. Include heterogenoeus reactions

End of the lecture