Diffusion from the Atomistic to Continuum Scale
Explore ways to measure and model diffusion computationally, starting with molecular dynamics in a web app and then moving to a Fickian continuum description.
Overview
Explore diffusion at multiple lengthscales, no coding experience required! Students will start by collecting their "experimental" data using a 2D molecular dynamics (MD) web app and by stepping through this notebook, will see how one can extract a diffusivity from mean squared displacement across particles.
Next, they will connect this to the continuum (Fick's Laws) description and investigate how the intuitive notion of diffusion (how material "spreads out") connects to the atomistic picture from Brownian motion.
Along the way, there are prompts to reflect on both the conceptual content as well as the complementarity between the experimental and computational paradigms.
Scientific Learning Objectives
- Observe diffusive processes in an atomistic simulation
- Explain how we can compute a diffusivity from the slope of MSD vs. time
- Connect these atomistic mechanisms to the continuum (Fickian) description
Cyberinfrastructure Learning Objectives
- Handle tabular data
- Interact with a literate programming environment (Jupyter)
- Interpret parameters from a model fit
- Consider complementarity between computational and experimental paradigms
Prerequisites
Scientific Prerequisites:
- High school chemistry/physics
- High school algebra/precalc
Programming Prerequisites:
- No prior programming experience required
Course Materials
Diffusion Computational Lab
Explore diffusion computationally at atomistic and continuum lengthscales.
Learning Objectives:
- Understand how we measure and model diffusion computationally at both atomistic and continuum scales
- Consider complementarity between computational and experimental paradigms
Student Repository
Complete Student Materials
Download or clone the complete repository with all notebooks, datasets, and supporting files.
View Repository Launch on ChemComputeInstructor Materials
Complete Instructor Package
Solutions for all notebooks, teaching notes, assessment rubrics, and additional examples.
Instructor ResourcesRequires instructor verification. Request access if you don't have permission.
Instructor Notes
This activity is designed as a lab activity to expose students to some techniques and capabilities of computational materials science with no programming prerequisites. That is, all they have to do with this Jupyter notebook is run existing cells of code and in some cases paste in data or change one number. My goals were to get the students thinking about how computation as a paradigm is distinct from pure theory and can complement both theory and experiment, e.g. by probing scales of length and time inaccessible in a physical lab, or through massive replication through automation.
When I piloted this activity (in Carnegie Mellon's introductory materials science course), it was actually before they had seen anything about diffusion in the associated lecture. I think it could work well in either scenario, though, it would just affect how technical one should expect the students to get in their responses to the reflection prompts, and also what context would be needed in the prelab mini-lecture. My pilot audience was also extremely heterogeneous in programming background, some first-year undergraduates with essentially no experience, and some more senior computer science students, and it worked just fine.
For my course, the deliverable was a standard lab memo that included responses to the reflection prompts within the notebook, as well as this additional prompt: "Please also write at least a few sentences reflecting on computation as an "experimental" paradigm generally. How do you see it as similar to or different from experiments? What can we learn about diffusion more easily from one approach compared to the other?"
Logistical tips, and things to emphasize in prelab mini-lecture:
• Demonstrate launching the notebook in chosen platform (I suggest ChemCompute), including setting the correct runtime!
• Demonstrate using the online MD tool and getting the density up high enough (easiest technique is to use the "freeze" button and then drag the number slider up repeatedly)
• Since the first two setup cells to install and import packages will take a few minutes to run, try to make sure students get those going first and then start reading and exploring the MD engine, etc.
Some student "gotchas" I ran into a few times:
• Not setting the correct runtime (e.g. they're in Python instead of Julia) so none of the code runs
• Not evaluating the cells after pasting their data in
• Data formatting issues due to either not pasting in the full contents of the data dump, resetting stats during data collection, etc.
Possibilities to "level up" this activity for more advanced students:
• Connect to 2D Lennard-Jones phase diagram (conditions here are in the two-phase solid-liquid region!) and thinking about why solid ends up in middle of box and liquid along the edges (see e.g. [here](https://www.researchgate.net/publication/49750821/figure/fig1/AS:667216336936969@1536088179352/Phase-diagram-of-2D-Lennard-Jones-solid-as-given-in-9-The-first-order-boundaries-are.png))
• "Skeletonize" some of the code cells and ask students to fill in some of the analysis or visualization themselves
• Get more in-depth into what's going on with the MD, understand why temperature drifts, etc.
• Have them repeat the second portion at another temperature and think about how/why the results change
• Dive more into some of the PDE stuff at the end