Solid Diffusion

Solid Diffusion preview image

1 collaborator

Uri_dolphin3 Uri Wilensky (Author)


chemistry and physics 

Tagged by Reuven M. Lerner about 9 years ago

Model group CCL | Visible to everyone | Changeable by group members (CCL)
Model was written in NetLogo 5.0.4 • Viewed 285 times • Downloaded 38 times • Run 0 times
Download the 'Solid Diffusion' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


This model describes how diffusion occurs between two adjacent solids.

Diffusion is one of the most important phenomena in fields such as biology, chemistry, geology, chemistry, engineering and physics. Interestingly, before becoming a famous for the Relativity Laws, Albert Einstein wrote extensively about diffusion, and was one of the first to connect diffusion to the Brownian motion of atoms.

Diffusion can take place in gases, liquids, or solids. In solids, particularly, diffusion occurs due to thermally-activated random motion of atoms - unless the material is at absolute zero temperature (zero Kelvin), individual atoms keep vibrating and eventually move within the material. One of the possible net effects of diffusion is that atoms move from regions of high concentration of one element to regions with low concentration, until the concentration is equal throughout the sample.

This model demonstrates a solid diffusion couple, such as copper and nickel. In a real laboratory, such experiment would take place at very high temperatures, for the process to take place in a reasonable amount of time (note that the diffusion coefficient varies exponentially with the inverse of the temperature). There are many mechanisms for diffusion in solids. In this model we demonstrate one of them, which is caused by missing atoms in the metal crystal. The locations, of the missing atoms are often called vacancies. Therefore, this type of diffusion mechanism is referred to as "vacancy diffusion". The extent to which the diffusion can happen depends on the temperature and the number of vacancies in the crystal.

In addition, there are various other conditions that are needed for solid diffusion to occur. Some examples of these are similar atomic size, similar crystal structure, and similar electronegativity. This model assumes all of these conditions are present.


There are two types of atoms, green and blue. At the beginning, all green atoms are on the left and the blue atoms are on the right. All the vacancies start out between the two metals. As atoms move into vacancies, the vacancies disperse. In most real-world scenarios, vacancies are scattered in the material to begin with. In this model, for simplification purposes, we assume that the materials have no vacancies in the beginning, and that all the vacancies start off in between the two materials.

In this model we also assume that the heat is evenly distributed throughout the metals. Therefore, each atom has an equal chance of breaking bonds with its neighbors and moving to a vacancy.


To run the model, first press the SETUP button, then press the GO button.

"Atoms by Column" is a distribution diagram of the two atom types. The other graph is a maximum diffusion distance, squared, versus time. If the model runs long enough, this plot will show an approximately linear relationship between the squared distance and time, following the known equation (for one-dimensional diffusion):

x2 = 2 * D * t

where x is the maximum diffusion distance, D is the diffusion coefficient, and t is elapsed time.


If you run the model for a few hundred ticks, the distribution graph should look like two interleaving curves. The far edges remain purely one color, while the middle is about 50-50.

The other graph should be generally linear. The "diffusion coefficient" of the system is proportional to the slope, and can be easily calculated using the above equation.


Let the model run for a long time. (You can use the speed slider to make the model run faster.) Do you think the metal will ever become completely diffused?

Try increasing the dimensions of the world. Does the behavior change at all?


The model uses a very simple initial state in which there is always exactly one column of vacancies and they are all located in the middle. Try adding settings that dictate how many vacancies there are and where they start out.

Give the two metals, or the two sides of the world, different characteristics. For example, a temperature difference could be simulated by making atomic movements on one side happen less often than on the other.

Try changing the crystal structure of the atoms. In close-packed atoms in two dimensions, atoms actually have six neighbors (hexagonal) instead of four (square).


This model uses a non-wrapping world.


MaterialSim Grain Growth
GasLab Two Gas


Thanks to James Newell for his work on this model.

For additional information:

Porter, D.A., and Easterling, K.E., Phase Transformations in Metals and Alloys, 2nd ed., Chapman & Hall, 1992

Shewmon, P.G., Diffusion in solids, 2nd ed., TMS, 1989


If you mention this model in a publication, we ask that you include these citations for the model itself and for the NetLogo software:

  • Wilensky, U. (2007). NetLogo Solid Diffusion model. Center for Connected Learning and Computer-Based Modeling, Northwestern Institute on Complex Systems, Northwestern University, Evanston, IL.
  • Wilensky, U. (1999). NetLogo. Center for Connected Learning and Computer-Based Modeling, Northwestern Institute on Complex Systems, Northwestern University, Evanston, IL.


Copyright 2007 Uri Wilensky.


This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License. To view a copy of this license, visit or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

Commercial licenses are also available. To inquire about commercial licenses, please contact Uri Wilensky at

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

to setup
  set-default-shape turtles "square"
  ;; make green atoms on left
  ask patches with [pxcor < 0]
    [ sprout 1 [ set color green ] ]
  ;; make blue atoms on right
  ask patches with [pxcor > 0]
    [ sprout 1 [ set color blue ] ]
  ;; plot the initial state of the system

to go
  ;; asks vacancies to ask a neighboring atom to
  ;; move into the vacancy
  ask patches with [not any? turtles-here]
    [ move-atom-to-here ]

;; chooses a neighboring atom to move onto a empty patch (vacancy)

to move-atom-to-here  ;; patch procedure
  let atom one-of turtles-on neighbors4
  if atom != nobody [
    ask atom [ move-to myself ]  ;; myself is the calling patch

;;; plotting procedures

to-report greens
  report turtles with [color = green]

to-report blues
  report turtles with [color = blue]

to plot-atoms [atoms]
  let column min-pxcor
  repeat world-width [
    let y count atoms with [pxcor = column]
    plotxy column y
    set column column + 1
    plotxy column y

; Copyright 2007 Uri Wilensky.
; See Info tab for full copyright and license.

There are 10 versions of this model.

Uploaded by When Description Download
Uri Wilensky over 9 years ago Updated to NetLogo 5.0.4 Download this version
Uri Wilensky almost 10 years ago Updated version tag Download this version
Uri Wilensky almost 10 years ago Updated to version from NetLogo 5.0.3 distribution Download this version
Uri Wilensky over 10 years ago Updated to NetLogo 5.0 Download this version
Uri Wilensky over 12 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky over 12 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky over 12 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky over 12 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky over 12 years ago Model from NetLogo distribution Download this version
Uri Wilensky over 12 years ago Solid Diffusion Download this version

Attached files

File Type Description Last updated
Solid Diffusion.png preview Preview for 'Solid Diffusion' over 9 years ago, by Uri Wilensky Download

This model does not have any ancestors.

This model does not have any descendants.