CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Boundary Layer over a surface

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 22, 2018, 10:07
Default Boundary Layer over a surface
  #1
New Member
 
Asif Shahriar Nafi
Join Date: Dec 2015
Location: Conway, SC, USA
Posts: 8
Rep Power: 11
asifnafi is on a distinguished road
Hi,
I am trying to solve this problem numerically (Boundary Layer over a flat plate, see attached).
Matlab code:

nx=2001;ny=51;
xmax=1; ymax=0.25; vis = 1.4e-5;
dx = xmax/(nx-1);dy = ymax / (ny - 1);
%grid
u = nan (nx,ny); v = nan (nx,ny);

%Boundary condition
u(1, : ) = 0; v(1,: ) = 0; u(nx,: ) = 10;

%calc

for p = 1:nx-1
for k = 2:ny-1
u(p+1,k)= u(p,k) + (vis*dx / u(p,k)*(dy^2)) * (u(p,k+1) - 2*u(p,k) ...
+ u(p,k-1)) - (v(p,k)*dx / 2*u(p,k)*dy) * (u(p,k+1) - u(p,k-1));

v(p+1,k) = v(p+1,k-1) - 0.5* dy * ((u(p+1,k) - u(p,k))/dx + ...
(u(p+1,k-1) - u(p,k-1))/dx);

end
end

But i dont get any value of u and v. I would very much appreciate your help
Attached Images
File Type: jpg BL over a surface.jpg (21.5 KB, 18 views)

Last edited by asifnafi; March 22, 2018 at 12:15. Reason: typo
asifnafi is offline   Reply With Quote

Old   March 26, 2018, 10:36
Default
  #2
Member
 
Philipp Wiedemer
Join Date: Dec 2016
Location: Munich, Germany
Posts: 42
Rep Power: 10
MangoNrFive is on a distinguished road
Well you're dividing by u(p,k) in your formula for u(p+1,k) but your boundary condition is set to zero. As a result you get a NaN because the numerator is zero aswell (0/0 = NaN in Matlab). This NaN gets then propagated through your whole calculation because you always have NaN's from the row before (If you have a NaN in the formula the result will be a NaN aswell). Maybe you have the indices mixed up or something.
MangoNrFive is offline   Reply With Quote

Old   March 26, 2018, 11:40
Default
  #3
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,896
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
You can solve this problem in a simplified equation using the von Mises transformation
FMDenaro is online now   Reply With Quote

Old   April 29, 2020, 23:27
Default
  #4
New Member
 
Colin
Join Date: Apr 2020
Posts: 7
Rep Power: 6
cothiele is on a distinguished road
Quote:
Originally Posted by MangoNrFive View Post
Well you're dividing by u(p,k) in your formula for u(p+1,k) but your boundary condition is set to zero. As a result you get a NaN because the numerator is zero aswell (0/0 = NaN in Matlab). This NaN gets then propagated through your whole calculation because you always have NaN's from the row before (If you have a NaN in the formula the result will be a NaN aswell). Maybe you have the indices mixed up or something.
would you have to change your boundary condition or start at the next step?
cothiele is offline   Reply With Quote

Reply

Tags
boundary layer, fdm, flat plate, numerical simulation


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Centrifugal fan j0hnny CFX 13 October 1, 2019 14:55
Question about adaptive timestepping Guille1811 CFX 25 November 12, 2017 18:38
Basic Nozzle-Expander Design karmavatar CFX 20 March 20, 2016 09:44
[snappyHexMesh] Layers don't fully surround surface EVBUCF OpenFOAM Meshing & Mesh Conversion 14 August 20, 2012 05:31
Convective Heat Transfer - Heat Exchanger Mark CFX 6 November 15, 2004 16:55


All times are GMT -4. The time now is 13:48.