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

Poiseuille flow using MATLAB

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 5, 2017, 12:32
Default Poiseuille flow using MATLAB
  #1
New Member
 
Join Date: Nov 2017
Posts: 1
Rep Power: 0
Aldou is on a distinguished road
Hi, I am newcomer in CFD. I try to write script for channel flow using Lattice Bolzmann method in MATLAB. My problem is I cannot get the right figure of stream lines (picture enclosed). I keep getting strange behaviour at the inlet and dont know why. As BC on the walls I use Zou-He non-slip condition. As inlet BC I use velocity condition (not fully developed velocity profile...only parametr I know is inlet velocity in x direction along the inlet, y direction is supposed to be 0). As outlet BC I use zero velocity gradient. If someone knew why is it so please give me an advice.

D2Q9 scheme
6 2 5
3 9 1
7 4 8

(500=M x 20=N) lattice nodes
.____________________ \downarrowoutlet
.
.
.
. <- inlet + corner nodes
.
.
.____________________ \uparrow outlet


just to be precise in the distribution function: f("row","column","number of dist.fcn.")

%north bounce back (Zou-He non-slip)
Code:
 
f(N,2:M,4) = f(N,2:M,2);
f(N,2:M,7) = f(N,2:M,5) + 0.5*(f(N,2:M,1) - f(N,2:M,3));
f(N,2:M,8) = f(N,2:M,6) - 0.5*(f(N,2:M,1) - f(N,2:M,3));
%south bounce back (Zou-He non-slip)
Code:
f(1,2:M,2) = f(1,2:M,4);
f(1,2:M,5) = f(1,2:M,7) - 0.5*(f(1,2:M,1) - f(1,2:M,3));
f(1,2:M,6) = f(1,2:M,8) + 0.5*(f(1,2:M,1) - f(1,2:M,3));
% inlet velocity BC with corner node treatment
Code:
Ro_in(:) = (f(2:N-1,1,9)+f(2:N-1,1,2)+f(2:N-1,1,4)+2*(f(2:N-1,1,3)+f(2:N-1,1,6)+f(2:N-1,1,7)))/(1-u_lb);
f(2:N-1,1,1) = f(2:N-1,1,3) + (2*Ro_in(:)*u_lb)/3;
f(2:N-1,1,5) = f(2:N-1,1,7) - 0.5*(f(2:N-1,1,2) - f(2:N-1,1,4)) + (Ro_in(:)*u_lb)/6;
f(2:N-1,1,8) = f(2:N-1,1,6) + 0.5*(f(2:N-1,1,2) - f(2:N-1,1,4)) + (Ro_in(:)*u_lb)/6;

%left bottom corner
Code:
f(1,1,1) = f(1,1,3);
f(1,1,2) = f(1,1,4);
f(1,1,5) = f(1,1,7);
f(1,1,6) = 0.5*(Ro_in(1) - (f(1,1,9)+f(1,1,1)+f(1,1,2)+f(1,1,3)+f(1,1,4)+f(1,1,5)+f(1,1,7)));
f(1,1,8) = f(1,1,6);
%left top corner
Code:
f(N,1,1) = f(N,1,3);
f(N,1,4) = f(N,1,2);
f(N,1,8) = f(N,1,6);
f(N,1,5) = 0.5*(Ro_in(length(Ro_in)) - (f(N,1,9)+f(N,1,1)+f(N,1,2)+f(N,1,3)+f(N,1,4)+f(N,1,6)+f(N,1,8)));
f(N,1,7) = f(N,1,5);
%outlet zero velocity gradient
Code:
f(:,M,3) = f(:,M-1,3);
f(:,M,6) = f(:,M-1,6);
f(:,M,7) = f(:,M-1,7);

...then i compute velocity and density from every lattice node, define new distribution functions and repeat cycle.

I hope my problem is cleared and thanks for helping.
Attached Images
File Type: jpg stream.jpg (42.4 KB, 8 views)
File Type: jpg velocity.jpg (88.6 KB, 13 views)
Aldou is offline   Reply With Quote

Reply


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
Boundary conditions for flow in nozzle kgevers FLUENT 0 July 26, 2015 12:46
MATLAB code for flow around Square Cross-section JungleCrow Main CFD Forum 6 July 15, 2015 00:00
Using cavity case to a Poiseuille flow ashbab OpenFOAM Pre-Processing 1 June 27, 2015 07:01
Outlet BC for disturbed Poiseuille flow murx CFX 10 February 22, 2012 13:55
Spectral methods need help - Poiseuille flow vetnav Main CFD Forum 0 February 5, 2010 13:51


All times are GMT -4. The time now is 11:39.