Reaction-Diffusion Systems Reactive Random Walks.

29
Reaction-Diffusion Systems Reactive Random Walks

Transcript of Reaction-Diffusion Systems Reactive Random Walks.

Page 1: Reaction-Diffusion Systems Reactive Random Walks.

Reaction-Diffusion Systems

Reactive Random Walks

Page 2: Reaction-Diffusion Systems Reactive Random Walks.

General Principle Consider a reactive system made up of species

A, B and C, where A and B can react to form C at some rate kf and C can degrade back into A and B at some rate kb

If the system is well-mixed (i.e. no spatial variability in concentration, reaction are governed by the law of mass action

kf

kb

Page 3: Reaction-Diffusion Systems Reactive Random Walks.

Let’s Start Simple – Recall Chemistry 101

A

B

C

Page 4: Reaction-Diffusion Systems Reactive Random Walks.

Question

Consider a case where you have equal amounts of A and B initially, that is CA(t=0)=CB(t=0)=C0 and no CC.

What will the system evolve to at very late (steady state) times?

What is kb=0, i.e. there is no backward reaction. How will the system evolve at all times?

at late times

Page 5: Reaction-Diffusion Systems Reactive Random Walks.

Diffusion-Reaction System

Now, rather than assuming that the system is well mixed, we allow A, B and C to move through space by diffusion, but they still react by the law of mass action

How can you solve these equations?

Page 6: Reaction-Diffusion Systems Reactive Random Walks.

Certainly Finite Differences

Explicit forward in space and time difference equation:

Works, but certain issues such as stability and numerical dispersion can be exacerbated

Page 7: Reaction-Diffusion Systems Reactive Random Walks.

How about random walks

Recall

So, let’s break A into N particles and B into N particles and let them bounce around randomly as we have done before

We know this solve the diffusion equation, but how to include reactions? What is needed?

Page 8: Reaction-Diffusion Systems Reactive Random Walks.

Let start with the easier case – CC

CC is degrading a first order rate kb. Do you remember how to incorporate this into the random walk method.

Calculate the probability of reaction during any given time step

Generate a random number Q, drawn from a uniform distribution U[0,1].

Reaction occurs

Reaction does not occur

Page 9: Reaction-Diffusion Systems Reactive Random Walks.

Conceptual Picture

How about for the bimolecular reaction A+B->C. Consider an A and a B Particle, distributed in space

(xA,yA)

(xB,yB)

All we know is the location of these two particles at time t, their diffusion coefficient and the reaction rate kf.

How do we calculate the probability of reaction for this pair in the same way as we did in previous slide.

Brainstorm it! And think about what has to happen for a reaction to occur

Page 10: Reaction-Diffusion Systems Reactive Random Walks.

Several Approaches Exist

Fixed (Hard) Radius Method

If particles are less than a distance rcrit they have probability 1 of reacting.

Question : How do we determine rcrit and make it physically consistent with what we know about A, B and C move?

Variable (Soft) Radius Method

Particles have a probability of reacting depending on how far apart they are as long as they are within some critical radius. Again, how do we determine this?

Which do you prefer?

Page 11: Reaction-Diffusion Systems Reactive Random Walks.

Neither – and either did my mate Dave

Benson & Meerschaert Algorithm

Move Particles with a random walk

Based on the distance between two particles calculate probability that they will collocate

Then based on the reaction multiply probability that reaction will occur

𝑠

A

B

Page 12: Reaction-Diffusion Systems Reactive Random Walks.

This is the cool idea

Probability of Reaction

=

Probability of Collocation

X

Probability of Reaction Given Collocation

Depends only on transport

Depends only on reactions

But what are they?

Page 13: Reaction-Diffusion Systems Reactive Random Walks.

Consider a 1d system

An A particle is located a position x1 and a B particle is located at a position x2 at time t as depicted. What is the probability they will collocate at time t+Dt.

x1x2

Consider how they move. Where will they be located at time t =Dt

s=x2-x1

Page 14: Reaction-Diffusion Systems Reactive Random Walks.

Consider a 1d system

At time t+Dt, each particle’s random position is described a Gaussian (i.e. solution of diffusion equation)

x1 x2s=x2-x1

Page 15: Reaction-Diffusion Systems Reactive Random Walks.

Consider a 1d system

At time t+Dt, each particle’s random position is described a Gaussian (i.e. solution of diffusion equation)

x1 x2

s=x2-x1

Overlap area gives probability of collocation

Page 16: Reaction-Diffusion Systems Reactive Random Walks.

Probability of Collocation

Probability of Collocation

Calculate integral directly or in Fourier Space

(convolution rule)

Page 17: Reaction-Diffusion Systems Reactive Random Walks.

What about Probability of Reaction

given collocation This is easier

Where kf is reaction ratemp is the mass of a particleDt is time step

Page 18: Reaction-Diffusion Systems Reactive Random Walks.

How the algorithm works

Page 19: Reaction-Diffusion Systems Reactive Random Walks.

Step 1 – Move Particles by Brownian Motion

Update Particle Positions by x(t+dt)=x(t)+sqrt(2Ddt)x

Random Jump Reflecting Diffusion

Page 20: Reaction-Diffusion Systems Reactive Random Walks.

Step 1 – Move Particles by Brownian Motion

Update Particle Positions by x(t+dt)=x(t)+sqrt(2Ddt)x

Random Jump Reflecting Diffusion

Page 21: Reaction-Diffusion Systems Reactive Random Walks.

Step 1 – Move Particles by Brownian Motion

Update Particle Positions by x(t+dt)=x(t)+sqrt(2Ddt)x

Random Jump Reflecting Diffusion

Page 22: Reaction-Diffusion Systems Reactive Random Walks.

Step 2 – Search for Neighbors of Opposite Particle

Particle 1

Gives distancess1s2s3

Page 23: Reaction-Diffusion Systems Reactive Random Walks.

Step 3 – Calculate Probability of RXN

Particle 1-1 Probability of Reaction

=

Probability of Collocation

X

Probability of Reaction Given Collocation

function of distanceand diffusion

function of reactionkinetics

Page 24: Reaction-Diffusion Systems Reactive Random Walks.

Step 4 – Die or Survive

Particle 1 - 1 Generate a random number 0<P<1

If P< Probability of Reaction

Kill both particles

If greater move to next blue particle

For this example let’s assume greater

Page 25: Reaction-Diffusion Systems Reactive Random Walks.

Step 4 – Die or Survive

Particle 1 - 2 Generate a random number 0<P<1

If P< Probability of Reaction (for this pair)

Kill both particles

If greater move to next blue particle

For this example let’s again assume greater

Page 26: Reaction-Diffusion Systems Reactive Random Walks.

Step 4 – Die or Survive

Particle 1 - 2 Generate a random number 0<P<1

If P< Probability of Reaction (for this pair)

Kill both particles

If less move to next blue particle

Let’s assume less now

Page 27: Reaction-Diffusion Systems Reactive Random Walks.

Step 4 – Die or Survive

Particle 1 - 2

And so on Cycling through all blues

Generate a random number 0<P<1

If P< Probability of Reaction (for this pair)

Kill both particles

If less move to next blue particle

Let’s assume less now

Page 28: Reaction-Diffusion Systems Reactive Random Walks.

Repeat for Each red Particle

Particle 2

And so on Cycling through all reds

Then back to Step One (Move Particles)

Page 29: Reaction-Diffusion Systems Reactive Random Walks.

The grand question

How do you code this?

-

Next Lecture