File Exchange

## matlab

version 3.0.0.0 (4.05 KB) by Hassan Khawaja

### Hassan Khawaja (view profile)

CFD solution using SIMPLE

Updated 18 Nov 2019

This work presents a method of solution of fundamental governing equations of computational fluid dynamics (CFD) using Semi-Implicit Method for Pressure-Linked Equations (SIMPLE) in MATLAB®. The fundamental governing equations of fluid mechanics are based on three laws of conservation, referred to the law of conservation of mass, the law of conservation of momentum and law of conservation of energy. Continuity equation represents the law of conservation of mass, Navier-Stokes equations represents the law of conservation of momentum, and energy equation represents the law of conservation of energy. In SIMPLE, the continuity and Navier-Stokes equations are required to be discretized and solved in a semi-implicit way. This article presents discretization and method of solution applied to the flow around a 2-D square body. Code is written in MATLAB®. The results show the pressure and velocity fields of the converged solution.

### Cite As

Hassan Khawaja (2020). matlab (https://www.github.com/hassan-khawaja/matlab), GitHub. Retrieved .

Hassan Khawaja

### Hassan Khawaja (view profile)

Yes, you can use the code for other objects. See attached code for parallel plates. Please mind that this code does not resolve the boundary layer.

sree bhargavi

### sree bhargavi (view profile)

can we use this code for other objects in the model

Ryan Palmer

### Ryan Palmer (view profile)

Changing the density or viscosity of the solution has no effect. Looking through the code, these are defined and allocated yet not used anywhere else other than to set the ratio variable (which is also unused).

Nice looking solution/code otherwise.

Ludwing Sánchez

Lindsey Amos

### Lindsey Amos (view profile)

Line 155 throws an error if Nx and Ny are not equal. Because dp1 is [Nx Nx] dimension, but p has dimension [Ny Nx]