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

Matlab code for pipe flow

Register Blogs Community New Posts Updated Threads Search

Like Tree6Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 3, 2015, 10:41
Default Hello
  #61
New Member
 
deewakar
Join Date: Dec 2011
Posts: 18
Rep Power: 15
alligngr8 is on a distinguished road
Hi Hou

I have sent you a mail.

Thanks
alligngr8 is offline   Reply With Quote

Old   April 3, 2015, 10:44
Default
  #62
Member
 
Prasanth P
Join Date: May 2009
Posts: 30
Rep Power: 17
prasanthnitt is on a distinguished road
I have used SIMPLE long back and so I am not familiar with the details. The pressure outflow boundary conditions can be tricky. Incase of divergence of the poisson solver I would recommend that you validate your code for the simple lic driven cavity case where the velocity and pressure boundary conditions are well defined. Your pressure boundary conditions seems to be okay, there could be a typo in your code.
Does it blow up in the very first time step? You could add the mass deficit term to the velocity boundary and set dp/dn=0 at the out flow boundary. This is what is done in fractional step method. And dont set your v velocity outflow as zero, set it as dv/dn=0. v=0 should be an outcome and not something that you impose at the outflow.
prasanthnitt is offline   Reply With Quote

Old   April 3, 2015, 10:49
Default
  #63
New Member
 
deewakar
Join Date: Dec 2011
Posts: 18
Rep Power: 15
alligngr8 is on a distinguished road
Quote:
Originally Posted by prasanthnitt View Post
I have used SIMPLE long back and so I am not familiar with the details. The pressure outflow boundary conditions can be tricky. Incase of divergence of the poisson solver I would recommend that you validate your code for the simple lic driven cavity case where the velocity and pressure boundary conditions are well defined. Your pressure boundary conditions seems to be okay, there could be a typo in your code.
Does it blow up in the very first time step? You could add the mass deficit term to the velocity boundary and set dp/dn=0 at the out flow boundary. This is what is done in fractional step method. And dont set your v velocity outflow as zero, set it as dv/dn=0. v=0 should be an outcome and not something that you impose at the outflow.
Hi
if I set dv/dn =0 , this will imply dv/dx =0 for 2D flow. But from where this condition arises.? If I am not wrong then du/dx=0 from no stress and then I will get dv/dy=0 from continuity. But from where I will get dv/dx=0.

when solving for lid driven cavity, do I need to extend velocity and pressure domain outside boundary.?
alligngr8 is offline   Reply With Quote

Old   April 3, 2015, 12:07
Default
  #64
Member
 
shahrooz
Join Date: Aug 2011
Posts: 41
Rep Power: 15
shahrooz.omd is on a distinguished road
Quote:
Originally Posted by alligngr8 View Post
Hi
if I set dv/dn =0 , this will imply dv/dx =0 for 2D flow. But from where this condition arises.? If I am not wrong then du/dx=0 from no stress and then I will get dv/dy=0 from continuity. But from where I will get dv/dx=0.

when solving for lid driven cavity, do I need to extend velocity and pressure domain outside boundary.?
dv/dx + du/dy = 0, if du/dy = 0 then dv/dx = 0. in this case u = 0 and du/dy = 0

however i think I didn't get what you really are asking.
shahrooz.omd is offline   Reply With Quote

Old   April 3, 2015, 12:13
Default
  #65
New Member
 
deewakar
Join Date: Dec 2011
Posts: 18
Rep Power: 15
alligngr8 is on a distinguished road
Hello
I was asking about how dv/dn = 0 at outlet.
alligngr8 is offline   Reply With Quote

Old   April 3, 2015, 15:32
Default
  #66
Member
 
shahrooz
Join Date: Aug 2011
Posts: 41
Rep Power: 15
shahrooz.omd is on a distinguished road
Quote:
Originally Posted by alligngr8 View Post
Hello
I was asking about how dv/dn = 0 at outlet.
You need to do a scale analysis on continuity equation. Scale of v will be DU/L when L is large enough v reduces to zero and continuity equation will be du/dx= 0. You can find more detailed explanation in adrian bejan's book titled convection heat transfer.
shahrooz.omd is offline   Reply With Quote

Old   April 3, 2015, 16:31
Default
  #67
New Member
 
deewakar
Join Date: Dec 2011
Posts: 18
Rep Power: 15
alligngr8 is on a distinguished road
Quote:
Originally Posted by shahrooz.omd View Post
You need to do a scale analysis on continuity equation. Scale of v will be DU/L when L is large enough v reduces to zero and continuity equation will be du/dx= 0. You can find more detailed explanation in adrian bejan's book titled convection heat transfer.
Hi,
Since I am solving flow between parallel plates, then for fully developed case du/dx wil be zero.

How does scale of v gives dv/dx=0 at outlet this is what I was asking. I think it should be either dv/dy=0 at outlet or v=0.
alligngr8 is offline   Reply With Quote

Old   April 3, 2015, 20:09
Default
  #68
Member
 
shahrooz
Join Date: Aug 2011
Posts: 41
Rep Power: 15
shahrooz.omd is on a distinguished road
Quote:
Originally Posted by alligngr8 View Post
Hi,
Since I am solving flow between parallel plates, then for fully developed case du/dx wil be zero.

How does scale of v gives dv/dx=0 at outlet this is what I was asking. I think it should be either dv/dy=0 at outlet or v=0.
when v = 0 at that region then dv/dx=0, it's obvious. but for boundary condition v=0 is more proper imo.

Last edited by shahrooz.omd; April 4, 2015 at 04:42.
shahrooz.omd is offline   Reply With Quote

Old   April 5, 2015, 05:04
Default
  #69
Member
 
Prasanth P
Join Date: May 2009
Posts: 30
Rep Power: 17
prasanthnitt is on a distinguished road
Quote:
Originally Posted by alligngr8 View Post
Hi
if I set dv/dn =0 , this will imply dv/dx =0 for 2D flow. But from where this condition arises.? If I am not wrong then du/dx=0 from no stress and then I will get dv/dy=0 from continuity. But from where I will get dv/dx=0.

when solving for lid driven cavity, do I need to extend velocity and pressure domain outside boundary.?
If your channel is long enough you can set either dv/dn=0 or v=0, both should give you the same answer. ONce the flow is fully developed the flow quantities dont change in the streamwise direction. If your channel is not long enough then you will face problems specifying the outflow bcn.
For lid driven cavity, anything you extend beyond the physical domain size would be ghost cells and would depend on how you implement the bondary conditions. Since you are doing FVM you can directly set the fluxes to be zero at the boundaries and so extension beyond the boundary can be avoided. I hope this helps.
prasanthnitt is offline   Reply With Quote

Old   October 23, 2015, 08:28
Default
  #70
New Member
 
Join Date: Jun 2015
Posts: 1
Rep Power: 0
nazia is on a distinguished road
I need a matlab code for solving incompressible flow in a tube can anybody help me?
Mustapha Khalifa likes this.
nazia is offline   Reply With Quote

Old   March 23, 2016, 14:32
Default
  #71
New Member
 
Join Date: Mar 2016
Posts: 2
Rep Power: 0
sisy is on a distinguished road
Hello I need a matlab code for Roe linearization for 1D shallow water equation with entropy fix.
Is there any one who can help me?
sisy is offline   Reply With Quote

Old   March 24, 2017, 13:40
Default
  #72
New Member
 
Join Date: Mar 2017
Posts: 1
Rep Power: 0
Mass is on a distinguished road
Hi everybody,

I am using the Dr. Seibold code for solving the N.S. in 2D.
I am going to solve the Navier-Stokes for a 2D rectangular domain where the Dirichlet boundary conditions are applied at north, south and west sides; but on the east-side two boundary conditions should be applied. Part of the east-side has no-slip condition (Dirichlet B.C.) and for the rest of it (dv/dx)=f(y) is held, where v is the vertical (in y-direction) component of the velocity vector.
I know how to modify the "boundary conditions" section of the code, where "vE" is specified, to have part of the east-side to follow no slip condition; but I need help about how to apply the Neumann B.C. for the rest of its length.

Thanks
Mass is offline   Reply With Quote

Old   May 12, 2017, 19:05
Default
  #73
New Member
 
umair tariq
Join Date: May 2017
Posts: 1
Rep Power: 0
umair_tariq is on a distinguished road
Quote:
Originally Posted by cici View Post
Hi All,

I have written a MATLAB code for a 2-D lid driven cavity problem, and it works fast and well, the results are consistent with experimental data. But this code does not work for the duct flow, which is also a classic example in many references.

I wonder it is due to the change of the definition of boundary conditions or the scheme itself. What is the main issue behind this.

Thanks.
where is the code you have mentioned ?
umair_tariq 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
code for SIMPLE algorithm - 2D Lid driven cavity flow problem - Collocated grid h_amooie OpenFOAM Programming & Development 1 January 22, 2022 12:33
need 3D cylindrical source code for laminar flow S. D. Ding Main CFD Forum 0 July 23, 2002 03:01
What is the Better Way to Do CFD? John C. Chien Main CFD Forum 54 April 23, 2001 09:10
fluid flow fundas ram Main CFD Forum 5 June 17, 2000 22:31
Flow visualization vs. Calculated flow patterns Francisco Saldarriaga Main CFD Forum 1 August 3, 1999 00:18


All times are GMT -4. The time now is 22:00.