Numerical Solutions to the Diffusion Equation

Slides:



Advertisements
Similar presentations
Random Processes Introduction (2)
Advertisements

Chapter 8 Elliptic Equation.
Instantaneous Mixing Driven Reactions. Inspiration for this Chapter Comes From In this paper the authors develop the theory we will learn here, which.
Observe Brownian motion of particles.
Coupling Continuum Model and Smoothed Particle Hydrodynamics Methods for Reactive Transport Yilin Fang, Timothy D Scheibe and Alexandre M Tartakovsky Pacific.
Brownian Motion and Diffusion Equations. History of Brownian Motion  Discovered by Robert Brown, 1827  Found that small particles suspended in liquid.
458 Meta-population models and movement (Continued) Fish 458; Lecture 19.
Transport Processes 2005/4/24 Dept. Physics, Tunghai Univ. Biophysics ‧ C. T. Shih.
Laplace Transforms Important analytical method for solving linear ordinary differential equations. - Application to nonlinear ODEs? Must linearize first.
1 MECH 221 FLUID MECHANICS (Fall 06/07) Tutorial 6 FLUID KINETMATICS.
Thermo & Stat Mech - Spring 2006 Class 27 1 Thermodynamics and Statistical Mechanics Random Walk.
Parabolic PDEs Generally involve change of quantity in space and time Equivalent to our previous example - heat conduction.
Chapter 4 Numerical Solutions to the Diffusion Equation.
Monte Carlo Methods in Partial Differential Equations.
SOLUTION FOR THE BOUNDARY LAYER ON A FLAT PLATE
Reaction-Diffusion Systems - Continued Reactive Random Walks.
Ch 8.1 Numerical Methods: The Euler or Tangent Line Method
Ch. 6 Single Variable Control
Chapter 9 Numerical Integration Flow Charts, Loop Structures Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 6 Sampling Distributions.
Chapter 1 Computing Tools Analytic and Algorithmic Solutions Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Particle Aerodynamics S+P Chap 9. Need to consider two types of motion Brownian diffusion – thermal motion of particle, similar to gas motions. –Direction.
1 Spring 2003 Prof. Tim Warburton MA557/MA578/CS557 Lecture 5a.
Ch 24 pages Lecture 7 – Diffusion and Molecular Shape and Size.
A conservative FE-discretisation of the Navier-Stokes equation JASS 2005, St. Petersburg Thomas Satzger.
A particle-gridless hybrid methods for incompressible flows
SUPA Advanced Data Analysis Course, Jan 6th – 7th 2009 Advanced Data Analysis for the Physical Sciences Dr Martin Hendry Dept of Physics and Astronomy.
 Let’s take everything we have learned so far and now add in the two other processes discussed in the introduction chapter – advection and retardation.
+ Numerical Integration Techniques A Brief Introduction By Kai Zhao January, 2011.
FLUID PROPERTIES Independent variables SCALARS VECTORS TENSORS.
CIS888.11V/EE894R/ME894V A Case Study in Computational Science & Engineering We will apply several numerical methods to find a steady state solution of.
Chapter 15 – CTRW Continuous Time Random Walks. Random Walks So far we have been looking at random walks with the following Langevin equation  is a.
1 OUTPUT ANALYSIS FOR SIMULATIONS. 2 Introduction Analysis of One System Terminating vs. Steady-State Simulations Analysis of Terminating Simulations.
ECE-7000: Nonlinear Dynamical Systems Overfitting and model costs Overfitting  The more free parameters a model has, the better it can be adapted.
Reaction-Diffusion Systems Reactive Random Walks.
Interacting Molecules in a Dense Fluid
Advanced Engineering Mathematics, 7 th Edition Peter V. O’Neil © 2012 Cengage Learning Engineering. All Rights Reserved. CHAPTER 4 Series Solutions.
Monatomic Crystals.
1 EE571 PART 3 Random Processes Huseyin Bilgekul Eeng571 Probability and astochastic Processes Department of Electrical and Electronic Engineering Eastern.
1 Spring 2003 Prof. Tim Warburton MA557/MA578/CS557 Lecture 17.
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics1 Water Computational Fluid Dynamics Volumes Lagrangian vs. Eulerian modelling Navier-Stokes equations.
Viscosità Equazioni di Navier Stokes. Viscous stresses are surface forces per unit area. (Similar to pressure) (Viscous stresses)
DYNAMIC BEHAVIOR OF PROCESSES :
Virtual University of Pakistan
Chapter 15 Panel Data Models.
Diffusion over potential barriers with colored noise
Lecture 4: Numerical Stability
Sampling Distributions
CHAPTER 12: Introducing Probability
Lecture 19 MA471 Fall 2003.
thermal conductivity of a gas
Estuarine models: what is under the hood?
Advection – Diffusion Equation
INTRODUCTORY STATISTICS FOR CRIMINAL JUSTICE Test Review: Ch. 7-9
Chapter 10: Solving Linear Systems of Equations
Quantum One.
Ensemble variance loss in transport models:
Hidden Markov Models Part 2: Algorithms
STOCHASTIC HYDROLOGY Random Processes
Observe Brownian motion of particles.
Biointelligence Laboratory, Seoul National University
Asst. Prof. Dr. Hayder Mohammad Jaffal
Objectives 6.1 Estimating with confidence Statistical confidence
Laplace Transforms Important analytical method for solving linear ordinary differential equations. - Application to nonlinear ODEs? Must linearize first.
Lesson 4: Application to transport distributions
Laplace Transforms Important analytical method for solving linear ordinary differential equations. - Application to nonlinear ODEs? Must linearize first.
Solids, Liquids and Gases
Topic 3 Discretization of PDE
Machine Learning: Lecture 5
Forecasting Plays an important role in many industries
Presentation transcript:

Numerical Solutions to the Diffusion Equation Chapter 4 Numerical Solutions to the Diffusion Equation

This chapter is inspired by

The Diffusion Equation There are many instances where it may be necessary or preferable to solve the diffusion equation numerically. Here we will explore two different approaches, one based on finite differences and one based on particle tracking methods. Many other methods exist, and if you want to know more I recommend a numerical methods class

Finite Differences Here we will explore one of the simplest finite- difference schemes out there. The basic idea is that we represent derivatives by a discrete approximation (we will use the following – again there are many possibilities)

Now Discretize your domain 1 2 N X=0 X=L We break our domain of length L into N points, each separated by distance Dx Now consider a point n and call the concentration there where j denotes time step j and n denotes space point n The discrete version of our diffusion equation for the concentration at point n is now given by

Now Discretize your domain 1 2 N X=0 X=L Rearranging Thus if we know the concentration at every point at time equal zero (initial condition) we can advance the concentration at every point by implementing the above expression in a code. Note that for n=1 and n=N we typically impose values based on boundary conditions Also note that making Dx and Dt smaller makes the approximation better so you want to pick them small enough to be reasonable, but large enough that it works quickly. However there are stability criteria that must be met (i.e. you cannot choose any combination of spatial and temporal discretization – Dx<sqrt(DDt) at least).

Now Discretize your domain 1 2 N X=0 X=L Rearranging This implementation is called explicit in time forward differences and central in space. It may not always be the best choice (but we do not have time to cover many more cases – again if you need them I encourage you to look into other options on your own or in another course). It is however straightforward to implement in any language of your choice (e.g. Matlab or even Excel – although I do not encourage you to do this in Excel)

Example Consider a domain of size 10. Numerically solve the following equation. Compare your numerical results to a Greens function solution. For small times assume that the x=10 boundary plays no role and take a semi-infinite domain. At late times it may be important so check the finite domain solution too. Test different choices of spatial and temporal discretizations. What is the steady state solution to this problem?

Great The finite difference methodology is great and widely used, but has some problems, particularly when you look at systems that include more processes such as advection (in which case you can get what is called numerical diffusion whereby the numerical method artificially imposes a diffusion that is larger than the desired actual value). What else can we do?

Now let’s consider a different Approach Let’s pretend that we can break our solute plume into a large number of discrete particles, N. Each particle represents some mass of solute m. If the total mas of the system is M and all particles carry equal mass then the mass a particle m=M/N. Now the question is, how do we move particles in such a way that will faithfully represent the process of diffusion. This is a problem that Einstein considered when studying Brownian motion and led to much of our current understanding of diffusion and the existence of molecules so let’s look at what he did first and then come back to our problem

Brownian Motion Robert Brown in 1827 observed that pollen particles in completely quiescent water executed what appeared to be a random motion. He observed the same for inorganic particles, eliminating the hypothesis that it was some life-based motion. The hypothesis was that molecules of water were randomly bombarding the bigger particle and inducing the random motion

The way Einstein saw it Consider a small particle in a fluid that is continuously being bombarded by lots and lots of molecules. Apply F=ma Friction due to viscosity Random force due to molecular bombardment

Brownian Motion Consider the case of an infinitesimally small particle (m->0) – i.e. there will be a balance between the friction force and the random molecular forces. Then Now let’s think about the random force term x(t) What characteristics should it have?

Brownian Motion On average the force should be zero, because an equal bombardment should occur statistically from all sides. The force should act over a short time and not have long time correlation. The average of the force at time t and t’ is zero, but at t=t’ a force of strength 2D applies

Mean location of a particle Integrating the equation of motion Because <x>=0 => <x>=0 – on average a particle’s mean location is 0

Variance of Particle Location Let’s look at the variance of the particle position <x2> Therefore the mean particle position is zero and the variance is 2Dt – remind you of anything?

How to Implement We can implement the governing equation with the following Langevin equation A random number with zero mean and unit variance (use for example randn in matlab)

In arbitrary dimensions Random numbers with zero mean and unit variance (different) Loop over as many steps as desired By the way – why will the above converge to a Guassian? (as it should given the solution of the diffusion equation) Also – we need not implement that the random number be normally distributed, but in the long run the distribution of particles will converge to a Gaussian – WHY?