Skip to content

robert-trirop/MATLAB-2D-Fluid-Simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

MATLAB 2D Fluid Simulation

This repository contains the MATLAB code for a fluid simulation, originally coded in 2017 and featured in this YouTube video.

Fluid Simulation

Overview

The code simulates fluid flow using a combination of the finite difference method and the Runge-Kutta method for particle advection. The main functionalities include:

  • Initialization of velocity, pressure fields, and particle positions.
  • Application of a divergence-free condition to the velocity field using the Jacobi method.
  • Self-advection of the velocity fields using the Lagrangian-Eulerian approach.
  • Particle advection using the Runge-Kutta 4th order method.
  • Visualization of particle positions over time to show the fluid flow.

License

This project is licensed under the MIT License - see the MATLAB_2D_Fluid_Simulation.m file for details.

How to Use

  1. Clone the repository.
  2. Open MATLAB_2D_Fluid_Simulation.m in MATLAB.
  3. Run the script to see the fluid simulation.
  4. Close the figure window to stop the simulation.

Acknowledgments

This code was put together using knowledge I accumulated from the internet and my studies. If you use this code for your own animations, please give credit to the original author.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages