File Exchange

image thumbnail

Boundary Layer App

version (63.7 KB) by Ye Cheng
This MATLAB App provides a GUI to study laminar boundary layer problem of flow over a flat plate.


Updated 01 Sep 2016

View Version History

View License

This is the 1st MATLAB App in the Virtual Thermal/Fluid Lab series.
This MATLAB App allows you to:
1. Visualize a boundary layer
2. Study the growth of boundary layer thickness in response to free-stream velocity
3. Visualize streamlines and velocity profile
4. Learn how to solve boundary layer problem numerically with TDMA
5. Look at the GUI source code and see how it is created

Check out the webinar on virtual fluid mechanics and heat transfer labs with MATLAB:

Cite As

Ye Cheng (2021). Boundary Layer App (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (20)

Brian Aufderheide

Absolutely love this! However, how to port this into current Matlab App Designer? I want to do similar work with physical simulations but using the newer App Designer and sadly almost all examples are not of the nature like this example (which is perfect). Anyway you could port this to App Designer and make it available? Or point to something in App Designer that uses ODEs or PDEs? Thanks So much!

Tricia Nguyen

Hi! How can I adapt this for the following conditions: stationary bottom plate, upper plate moving at an initial velocity U, with different pressure gradients? I'd like to observe what the plot of the velocity profile would look like against the vertical axis set by the height of the channel.

mahdi narimani

hi, how can i add the energy equation to this code and solve for the temperature profile??


hi, great work!
can u plz hepl me to find app to solve two-phase fluid flow in the pipes?
i have very important work to realise in this days. TNX

Haris Fattah



Hi, Great work!, I am trying to model Shock wave boundary layer interaction, can u plz help me the built the Matlab code. my


Hi Ye Cheng, Excellent work! Wondering if you can please solve this velocity profile/boundary layer problem numerically using finite different methods? Can you please share the Matlab code for that?

kolla VASU

can u plz give me the equations what u used in the boundary code

kolla VASU

can u plz give me the code for unsteady flow about a stagnation point on a stretching sheet in the presence of variable free stream

kolla VASU

plz give me code for this.
(X1')^(R+1)=(X2)^(R+1);(X2')^(R+1)=(X3)^(R+1);A(X2^(R+1))(I+1)+B(X2^(R+1))(I)+C(X2^(R+1))(I-1)=D;(X4')^(R+1)=(X5)^(R+1);E(X4^(R+1))(I+1)-F(X4^(R+1))(I)+G(X4^(R+1))(I-1)=0;where A=(2*lamda+eta/2*alpha_star*h+(X1^(R)(i)*h);B=2*h^2*alpha_star-4*lamda;C=(2*lamda-eta/2*alpha_star*h-((X1)^R)(i)*h);D=4*h^2*(X2^(2R+1))(I)-2*(X2^(2R))(I)*h^2-2*(lamda^2)*h^2+2*lamda*h^2*alpha_star;E=(2*lamda*h+pr*h*((X1)^R)(I)-h/2*eta*alpha_star*pr);F=4*(lamda+(h^2)*alpha_star*pr);G=(2-h*pr*((X1)^(R))(I));
boundary conditions are X2^(R+1)(0)=1;X2^(R+1)(@)=lamda;X4^(R+1)(0)=1;X4^(R+1)(@)=0;X1^(R+1)(0)=0;
where pr=0.72,h=0.01,lamda=0.1,alpha_star varies from 0 to 1.8@0.0001,eta will end when X2=lamda,X4=0;R is iteration and i is position
plz help me in this writing code

Ye Cheng

@kolla VASU, you can download all code by clicking on the "Download Zip" button.

kolla VASU

plz send the matlab code for this

kolla VASU

i have some equations how can i solve by TDMA solver code plz


Ahmad Kassaee

The idea is conveyed perfectly! This demo convinces one that teaching fluid mechanics, heat transfer and other similar courses without help of matlab could be deficient.

Great job Ye.

Ye Cheng

Click on the 'Open Code' button in the app, and you will see a script (boundaryLayerScript.m) that shows the algorithm behind and how A,B,C,D are constructed based on the x-momentum equation. This topic can be found in many textbooks, such as Computational Heat Transfer by Yogesh Jaluria (page 244, similar but not identical).

Hi, I would like to know what are the equations that you use to fill each diagonal A, B and C and also the RHS vector D.


Selcuk Fidan

MATLAB Release Compatibility
Created with R2012b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired: FloPro

Community Treasure Hunt

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

Start Hunting!