Virtual engineering lab

2D Dye Transport & Conservation

Advect and diffuse dye in a prescribed divergence-free velocity field, inspect snapshots, and check scalar conservation.

Fluid Mechanics / Numerical MethodsintermediateValidated educational model
Learning mode

Guided laboratory

Use the checklist when you want a structured lab. Explore mode leaves the instruments unrestricted.

Set up → solve → verify

Build your numerical experiment

Read the equations

Start with an example. Change one setting at a time and compare accuracy, conservation, and computation cost.

Boundary conditions. Periodic square; prescribed flow is unaffected by dye concentration.

Physical length of the periodic domain.
unitless
Uniform cells; resolution increases both accuracy and computational cost.
Uniform flow uses u = U, v = U/2; vortex flow varies in space.
Zero removes physical diffusion; numerical diffusion may remain.
The last step lands at this physical time.
unitless
Automatic time steps use this fraction of the applicable explicit stability bound.

Choose an example or use the defaults, then run. Larger grids may take several seconds.

Keep this experiment

Valid settings are saved on this device. Project JSON preserves physical inputs and display units. Restore it and run again for fresh results.

Settings stay in this browser. Simulations run locally.

Measurements

Instrument readings

Scalar balance error
Recorded from the current completed simulation.
Minimum concentration
Recorded from the current completed simulation.
Theory

Equations and model

A passive scalar in prescribed flow

Dye does not alter the velocity, pressure, or buoyancy. Upwind advective face fluxes and centered diffusion cancel between neighboring periodic cells. The vortex is prescribed and divergence-free.

ct+(uc)=ν2c,u=0\frac{\partial c}{\partial t}+\nabla\cdot(\mathbf u c)=\nu\nabla^2c,\qquad\nabla\cdot\mathbf u=0u=Usin(2πxL)cos(2πyL),v=Ucos(2πxL)sin(2πyL)u=U\sin\left(\frac{2\pi x}{L}\right)\cos\left(\frac{2\pi y}{L}\right),\quad v=-U\cos\left(\frac{2\pi x}{L}\right)\sin\left(\frac{2\pi y}{L}\right)

An exact uniform-flow comparison

The uniform flow uses u = U and v = U/2. A cosine pattern translates and decays exactly; the lab compares its cell averages. Vortex and localized-spot cases have balance and bounds checks but no claimed exact error.

c=1+12e2νk2tcos[k(xUt)]cos[k(yUt/2)],k=2πLc=1+\frac12 e^{-2\nu k^2t}\cos[k(x-Ut)]\cos[k(y-Ut/2)],\quad k=\frac{2\pi}{L}M(t)=i,jcˉij(t)ΔxΔy=M(0)M(t)=\sum_{i,j}\bar c_{ij}(t)\,\Delta x\Delta y=M(0)
Validation

Independent checks

Numerical balance or equation residualNot run

Review conservation, boundary, entropy, or residual checks.

Expected
Simulated
Error
Tolerance
0%

Run the experiment to perform this check.

Reference, bounds, or convergenceNot run

Review the specific check and its limits; this is not a universal accuracy certificate.

Expected
Simulated
Error
Tolerance
0%

Run the experiment to perform this check.

Engineering interpretation

Run the experiment to generate an engineering interpretation.

Assumptions and limitations
Assumptions
  • Periodic square; prescribed flow is unaffected by dye concentration.
  • Constant properties; uniform one- or two-dimensional meshes.
  • Physical quantities stored in SI. Changing display units preserves the simulation.
Limitations
  • Educational numerical verification does not certify a physical design.
  • No arbitrary CAD geometry, turbulence, compressibility, multiphase flow, or free surfaces.
  • Grid resolution, bounded computation, and reference limits are reported explicitly.
Local experiment export

Save your measurements and setup

Exports are generated in your browser. No account or server upload is required.

Settings JSON
Current parameters and instrument controls, including waveform, output enable, scope coupling, timebase, trigger, and cursors when present. Data labs also include the dataset, mappings, exclusions, budget, or propagation setup.
Measurements CSV
Completed instrument readings with labels, units, and descriptions.
Plot PNG
The current canvas-based scope, transient, sweep, or statistics visualization when available.
Summary
Markdown report with objectives, setup, measurements, validation, interpretation, assumptions, and graded guided concept-check results.

Ready to export the current local experiment state.

Learning objectives

What this experiment should establish

  • Verify uniform flow.
  • Inspect snapshots.
  • Stir a spot.
  • Compare mixing.
Check your understanding

Questions to answer from the experiment

  1. Does dye concentration change the prescribed vortex?
  2. What happens to dye leaving the right boundary?
  3. Which case has a displayed exact time-dependent reference?
  4. What does the saved-frame slider change?
Continue learning

Sources and model review

Reviewed 2026-09-19. The educational model exposes its assumptions and validation; source references do not imply external certification.