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

matlab code for channel flow

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By mrxD
  • 2 Post By Alex C.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 12, 2014, 12:44
Default matlab code for channel flow
  #1
New Member
 
Join Date: Aug 2014
Posts: 3
Rep Power: 11
mrxD is on a distinguished road
hey all
i'm working on matlab code for instationary channel flow with given boundary condition:

Inflow: u(t=0) = 0, v(t=0)=0 and P= f(t) > 1
Walls: u = 0, v = 0
Ouflow: free outflow dudx = 0, dvdx = 0 and P = 1

at the end i need the velocity of u.

i failed to modify the programm "MIT18086" because of the given boundary pressure.

or for the simplicity i could assume that the pressure is linear decreasing from in- to outflow and use the equation du/dx+dv/dy=0 to calculate v. and then insert to the navierstokes and try to calculate that but then i have a problem with v*du/dx and u*du/dy

anyone ideas or solution for this problem?

thanks
Tolawak Gobena likes this.

Last edited by mrxD; August 13, 2014 at 04:13.
mrxD is offline   Reply With Quote

Old   October 5, 2015, 17:07
Default
  #2
Member
 
mechiebud
Join Date: Jan 2015
Posts: 49
Rep Power: 11
mechiebud is on a distinguished road
Quote:
Originally Posted by mrxD View Post
hey all
i'm working on matlab code for instationary channel flow with given boundary condition:

Inflow: u(t=0) = 0, v(t=0)=0 and P= f(t) > 1
Walls: u = 0, v = 0
Ouflow: free outflow dudx = 0, dvdx = 0 and P = 1

at the end i need the velocity of u.

i failed to modify the programm "MIT18086" because of the given boundary pressure.

or for the simplicity i could assume that the pressure is linear decreasing from in- to outflow and use the equation du/dx+dv/dy=0 to calculate v. and then insert to the navierstokes and try to calculate that but then i have a problem with v*du/dx and u*du/dy

anyone ideas or solution for this problem?

thanks
hey could you please send me your program of channel flow I need it as college assignment.
mechiebud is offline   Reply With Quote

Old   October 5, 2015, 22:05
Default
  #3
Member
 
Join Date: Jul 2013
Posts: 55
Rep Power: 12
Alex C. is on a distinguished road
Quote:
Originally Posted by mechiebud View Post
hey could you please send me your program of channel flow I need it as college assignment.
You will learn a lot more from your assignment if you do it yourself.
mechiebud and Jbsl like this.
Alex C. is offline   Reply With Quote

Old   October 6, 2015, 02:16
Default
  #4
Member
 
mechiebud
Join Date: Jan 2015
Posts: 49
Rep Power: 11
mechiebud is on a distinguished road
yes I know that. But since I missed my classes I am unable to start this one. The lid driven cavity and alternate directional implicit problem I solved myself.
mechiebud is offline   Reply With Quote

Old   October 6, 2015, 02:16
Default
  #5
Member
 
mechiebud
Join Date: Jan 2015
Posts: 49
Rep Power: 11
mechiebud is on a distinguished road
yes I know that. But since I missed my classes I am unable to start this one. The lid driven cavity and alternate directional implicit problem I solved myself.
mechiebud is offline   Reply With Quote

Old   October 6, 2015, 06:35
Default
  #6
Member
 
Kaya Onur Dag
Join Date: Apr 2013
Posts: 94
Rep Power: 13
kaya is on a distinguished road
Quote:
Originally Posted by mrxD View Post
hey all
i'm working on matlab code for instationary channel flow with given boundary condition:

Inflow: u(t=0) = 0, v(t=0)=0 and P= f(t) > 1
Walls: u = 0, v = 0
Ouflow: free outflow dudx = 0, dvdx = 0 and P = 1

at the end i need the velocity of u.

i failed to modify the programm "MIT18086" because of the given boundary pressure.

or for the simplicity i could assume that the pressure is linear decreasing from in- to outflow and use the equation du/dx+dv/dy=0 to calculate v. and then insert to the navierstokes and try to calculate that but then i have a problem with v*du/dx and u*du/dy

anyone ideas or solution for this problem?

thanks
Quote:
Originally Posted by mechiebud View Post
hey could you please send me your program of channel flow I need it as college assignment.


if you guys get stuck somewhere specific on the development satge, I think I can help but I am not sure if I got your problem.
kaya is offline   Reply With Quote

Old   October 8, 2015, 02:29
Default
  #7
Member
 
mechiebud
Join Date: Jan 2015
Posts: 49
Rep Power: 11
mechiebud is on a distinguished road
Thanks kaya. I am doing a 2D laminar flow on a channel using SMAC. I am unable o initialize the pressure.Could you please guide me through that.
mechiebud is offline   Reply With Quote

Old   October 8, 2015, 05:20
Default
  #8
Member
 
Kaya Onur Dag
Join Date: Apr 2013
Posts: 94
Rep Power: 13
kaya is on a distinguished road
Sorry I can't help you with SMAC since I never worked with that.

I think you're not using MIT18086? According to its manual, it doesn't use SMAC but a projection method for pressure coupling. I think it solves the momentum equations and finds an intermediate velocity ( which doesn't satisfy continuity at this stage). And with a pressure correction ( which is found by taking divergence of this intermediate velocity --> poisson equation) the intermediate velocity is updated to the u^(t+1). I saw that they put the matlab code in the course's webpage.
kaya is offline   Reply With Quote

Old   October 8, 2015, 05:25
Default
  #9
Member
 
Kaya Onur Dag
Join Date: Apr 2013
Posts: 94
Rep Power: 13
kaya is on a distinguished road
see the page 4
http://math.mit.edu/~gs/cse/codes/mi...vierstokes.pdf
kaya is offline   Reply With Quote

Old   October 8, 2015, 05:34
Default
  #10
Member
 
mechiebud
Join Date: Jan 2015
Posts: 49
Rep Power: 11
mechiebud is on a distinguished road
Thanks a lot for your response. Yes I have seen that code but I need to do it using SMAC. Since I am new at CFD I am facing certain certain challenges. Anyways I'll try to put more effort.Thanks again..
mechiebud is offline   Reply With Quote

Old   October 13, 2015, 16:41
Default
  #11
Member
 
mechiebud
Join Date: Jan 2015
Posts: 49
Rep Power: 11
mechiebud is on a distinguished road
Hi Kaya, Could you please give e some idea regarding the boundary conditions. Like what pressure and velocity boundary conditions should I use?
mechiebud is offline   Reply With Quote

Old   October 13, 2015, 17:43
Default
  #12
Member
 
Kaya Onur Dag
Join Date: Apr 2013
Posts: 94
Rep Power: 13
kaya is on a distinguished road
maybe no slip at the walls with neumann pressure and periodic at the inlet outlet of the channel ?
kaya is offline   Reply With Quote

Old   October 14, 2015, 16:38
Default
  #13
Member
 
mechiebud
Join Date: Jan 2015
Posts: 49
Rep Power: 11
mechiebud is on a distinguished road
In periodic boundary what initial values of u,v and p should I give at the left and right boundaries to initiate my simulation?
mechiebud is offline   Reply With Quote

Old   October 14, 2015, 17:24
Default
  #14
Member
 
Kaya Onur Dag
Join Date: Apr 2013
Posts: 94
Rep Power: 13
kaya is on a distinguished road
you can initialize your velo. field with analytical poiseuille flow solution which you can find somewhere in the middle of Frank white's text book. should be located on the top of a left page .. and then you can specify a constant pressure derivative
kaya is offline   Reply With Quote

Old   March 29, 2020, 19:55
Default
  #15
New Member
 
Shafee
Join Date: Mar 2020
Posts: 1
Rep Power: 0
ss477 is on a distinguished road
Were you successful in changing the boundary conditions to achieve chanel flow
ss477 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
Matlab code for pipe flow cici Main CFD Forum 72 May 12, 2017 18:05
Couette Flow in Matlab using Pressure Correction Method mulchah Main CFD Forum 4 February 25, 2014 05:41
Can anyone help locating an error in my 2-D MATLAB SIMPLE code? Hoggs17 Main CFD Forum 7 July 9, 2013 03:02
Give me some advice CFD in Fortran code or Matlab code. tringuyenttt Main CFD Forum 4 May 29, 2013 08:32
What is the Better Way to Do CFD? John C. Chien Main CFD Forum 54 April 23, 2001 08:10


All times are GMT -4. The time now is 07:53.