Fast Euler and Navier-Stokes fluid flow simulation

Three m-files to realize easily simulations of fluid flow in a rectangular cavity.
Updated 28 Oct 2010

View License

Here are two examples of videos:
The colors show the vorticity of the flow.
Enter the command line:
where L and l are the width and height of the box containing the fluid and lambda_max is an integer that will be used to determine the number of degrees of freedom (the larger it is, the better the simulation will be but the longer the computation will last). As a first guess, you can try : l = 4, L = 3 and lambda_max = 60.
Once the computation is done, enter:
film = graph_flow_euler
to make a Matlab movie.

Cite As

Alexandre Munnier (2024). Fast Euler and Navier-Stokes fluid flow simulation (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2007a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Fluid Dynamics in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes