Skip to content

Toy examples of 2D finite difference solutions for steady incompressible flow and Stokes flow.

License

Notifications You must be signed in to change notification settings

LuoXueling/ComputationalFluidMechanicsSimpleExamples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Examples of Computational Fluid Mechanics

This a coursework in 2021 when I was an undergraduate student at Shanghai Jiao Tong University. It implements two 2D finite difference solutions of (i) steady incompressible flow around a circular cylinder (Laplace equation) and (ii) a water tank above a moving plate (Stokes flow using stream function and vorticity equation).

Steady incompressible flow around a circular cylinder (Laplace equation)

The Laplace equation

$$ \frac{\partial^2 \Psi}{\partial x^2}+\frac{\partial^2 \Psi}{\partial y^2}=0 $$

is solved using finite difference method (rectangular mesh).

(Left bottom: Change of $\Psi$ in each iteration. Left top: Flow field. Right top: velocity. Right mid: u. Right bottom: v)

A water tank above a moving plate

The Stokes flow satisfies

$$ \begin{align*} &\frac{\partial^2 \xi}{\partial x^2}+\frac{\partial^2 \xi}{\partial y^2}=0 \\ &\frac{\partial^2 \Psi}{\partial x^2}+\frac{\partial^2 \Psi}{\partial y^2}=-\xi \\ &\Psi=0,\frac{\partial \Psi}{\partial y}=U=1 \text{ at the bottom}\\ &\Psi=0,\xi=0 \text{ at the surface}\\ &\Psi=0,\frac{\partial \Psi}{\partial x}=0 \text{ at walls}\\ \end{align*} $$

The vorticity $\xi$ is solved first and then the stream function $\Psi$ is solved.

(Left: Vorticity and change of vorticity in each iteration. Mid: Stream function, velocity vector, and change of stream function in each iteration. Right top: u. Right bottom: v)

About

Toy examples of 2D finite difference solutions for steady incompressible flow and Stokes flow.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages