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

Problem in modeling 2D Couette flow

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree6Likes
  • 1 Post By shantanu
  • 1 Post By jatin
  • 1 Post By FMDenaro
  • 2 Post By shantanu
  • 1 Post By mulchah

Reply
 
LinkBack Thread Tools Display Modes
Old   February 16, 2013, 12:39
Default Problem in modeling 2D Couette flow
  #1
New Member
 
Shantanu Bailoor
Join Date: Feb 2013
Posts: 4
Rep Power: 4
shantanu is on a distinguished road
Hey guys, this was my first attempt at modeling incompressible flow. I've been studying J.D. Anderson's "CFD Basics and applications" and took up the Couette flow problem described in chapter 9 and tried writing code for it in Matlab. I've used a finite difference scheme and a pressure correction method that is explained in the book. Also, I've tried keeping the implementation as identical to what is described in the text. The matlab script file has been attached for reference.

The test runs for a couple of iterations but then the x-velocity near the top (moving) wall and the inlet oscillates and soon the program crashes with the velocity developing inordinate values. I'm using the following boundary conditions and I guess that's where i'm messing up:

Velocity BC:
Inlet : v = 0
Top : u = Ue, v = 0 (no-slip)
Bottom : u = v= 0 (no-slip)

Pressure BC
dp/dn = 0 (all boundaries)

Could someone help me with what I could be doing wrong?

Thank you,
Shantanu.
Attached Files
File Type: txt Couette_2d_matlab.txt (3.6 KB, 224 views)
ema_amalia likes this.

Last edited by shantanu; February 18, 2013 at 06:07.
shantanu is offline   Reply With Quote

Old   February 23, 2013, 17:25
Default
  #2
Senior Member
 
Lefteris
Join Date: Oct 2011
Location: UK, Greece
Posts: 187
Rep Power: 5
Aeronautics El. K. is on a distinguished road
Try reducing your dt (see also at the bottom of page 440 of the book you mentioned)
__________________
Lefteris

Aeronautics El. K. is offline   Reply With Quote

Old   March 11, 2013, 12:38
Default
  #3
New Member
 
Shantanu Bailoor
Join Date: Feb 2013
Posts: 4
Rep Power: 4
shantanu is on a distinguished road
@Lefteris: I tried decreasing the time step and it really worked. Of course, there was also a small change that had to be made in the for loops. Thanks a ton for bringing that to my notice. And it's funny how the value of dt used by the author, himself, did not work!

Regards,
Shantanu.
shantanu is offline   Reply With Quote

Old   October 14, 2013, 13:58
Default couette 2D flow ploting of u,v,p vs y
  #4
New Member
 
jatin kumar
Join Date: Oct 2013
Posts: 5
Rep Power: 3
jatin is on a distinguished road
hey shantanu,
I have made some changes in that couette flow coding of matlab.......
n while ploting its gving an error as-

''Attempted to access v(3,4); index out of bounds because numel(v)=1.

Error in couette_2D_flow (line 41)
vb = 0.5*(v(j+1,i+1) + v(j+1,i+2));''

pls check it find the solution if u can
see the attached file ....
Attached Files
File Type: docx Couette1_2d_matlab.docx (3.8 KB, 97 views)
ema_amalia likes this.
jatin is offline   Reply With Quote

Old   October 28, 2013, 04:47
Smile help needed
  #5
New Member
 
christy issac
Join Date: Oct 2013
Posts: 5
Rep Power: 3
chrisnitk is on a distinguished road
hi
iam working on the same problem.. iam trying to code it using c++ .. iam also suffering from the sam problem, my program crashes after 30 iterations .... i tried changing dt.. bt stil its not running 300 iterations

iam giving my programme here ....
couettenew2.c
chrisnitk is offline   Reply With Quote

Old   October 28, 2013, 04:54
Default
  #6
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 1,640
Rep Power: 23
FMDenaro will become famous soon enough
apart from the dt required for the numerical stability, don't forget to check that the divergence-free constraint is satisfied cell-by-cell since the first time-step.
chrisnitk likes this.
FMDenaro is offline   Reply With Quote

Old   October 28, 2013, 05:06
Default
  #7
New Member
 
Shantanu Bailoor
Join Date: Feb 2013
Posts: 4
Rep Power: 4
shantanu is on a distinguished road
The reason my code did not converge in the previous attempt was because I would iterate the x- and y-momentum equations only once at each pseudo-time step, and assumed that satisfying the divergence-free constraint would, lead to velocity fields which satisfy the momentum equations. This, in fact, is not so. Normally, you would want the velocity fields to satisfy the momentum equations at each iteration, irrespective of the pressure fields. It is only then that you can expect the velocity fields to eventually satisfy the continuity equation. I don't remember the value of dt that Anderson uses, but finally, the corrected code worked with anything up to 1e-3. (I don't think I tried higher values).

Hope this helps.
shantanu is offline   Reply With Quote

Old   October 28, 2013, 05:27
Default
  #8
New Member
 
christy issac
Join Date: Oct 2013
Posts: 5
Rep Power: 3
chrisnitk is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
apart from the dt required for the numerical stability, don't forget to check that the divergence-free constraint is satisfied cell-by-cell since the first time-step.
sir.
wat u meant by divergence-free constraint..??? iam a beginer sir .. it will be helpful if u explained a little more
chrisnitk is offline   Reply With Quote

Old   February 25, 2014, 06:38
Default
  #9
New Member
 
Jack
Join Date: Dec 2013
Posts: 6
Rep Power: 3
mulchah is on a distinguished road
Quote:
Originally Posted by shantanu View Post
Hey guys, this was my first attempt at modeling incompressible flow. I've been studying J.D. Anderson's "CFD Basics and applications" and took up the Couette flow problem described in chapter 9 and tried writing code for it in Matlab. I've used a finite difference scheme and a pressure correction method that is explained in the book. Also, I've tried keeping the implementation as identical to what is described in the text. The matlab script file has been attached for reference.

The test runs for a couple of iterations but then the x-velocity near the top (moving) wall and the inlet oscillates and soon the program crashes with the velocity developing inordinate values. I'm using the following boundary conditions and I guess that's where i'm messing up:

Velocity BC:
Inlet : v = 0
Top : u = Ue, v = 0 (no-slip)
Bottom : u = v= 0 (no-slip)

Pressure BC
dp/dn = 0 (all boundaries)

Could someone help me with what I could be doing wrong?

Thank you,
Shantanu.

Hey,

I can see that you are making a number of small mistakes in your code. For example, take the pressure boundary conditions. While Anderson uses the zero pressure gradient b/c on the walls in section 6.8.6 to introduce the pressure correction method, he simplifies it to p' = 0 at the top and bottom walls during the implementation of this method for Couette flow in section 9.4.1. Secondly, check your indices for u and v velocity components. You are meant to solve all interior grid points and then use the zero order interpolation where necessary. I don't think you are doing this at the moment. Third, check the order you solve the u* and v* velocity components. I think you should start iterating from the top wall where the u velocity is 1 ft/s and go down. If you do the reverse and iterate from the bottom up, you will get different results (and I don't think this is correct).

Check my code (attached). It is similar to yours but converges to the final steady state value after 300 iterations for dt = 0.001 seconds. The only thing I can't understand is why my horizontal velocity profile at K = 4 and K = 20 iterations, etc is not the same as Anderson's. The steady state is very similar however. Let me know if you can spot why that is.
Attached Files
File Type: docx Couette Flow in Matlab.docx (18.4 KB, 109 views)
ema_amalia likes this.
mulchah is offline   Reply With Quote

Old   May 2, 2014, 01:44
Default Thanks
  #10
New Member
 
Ema Amalia
Join Date: Feb 2012
Location: Bandung-Indonesia and Tokyo-Japan
Posts: 1
Rep Power: 0
ema_amalia is on a distinguished road
@Shantanu and Mulchah,

Thank you for sharing your program code, I have a plan to make a code to analyze Coutte Flow on a ribleted surface based on your code. I found that the code attached at Mulchah`s last message worked very well in Matlab 2013.

Regards,

Ema
ema_amalia is offline   Reply With Quote

Old   May 2, 2014, 02:07
Default
  #11
New Member
 
Shantanu Bailoor
Join Date: Feb 2013
Posts: 4
Rep Power: 4
shantanu is on a distinguished road
@mulchah: Thanks for your input on that code. While I'm not sure of my implementation of p' -- I had tried writing that code a very long time back -- you are right about the indices of u and v. I had tried fixing the code later and I noticed a bunch of errors and the velocity index issue was definitely one of them. The major problem was that I did not test each variable (u, v, p') for convergence and, thus, the correct solution was never attained.

@ema_amalia: That's good, best of luck.

If either of you needs the fixed version of the code, feel free to mail me.

Thanks.
shantanu is offline   Reply With Quote

Old   May 3, 2014, 00:22
Default
  #12
New Member
 
Jack
Join Date: Dec 2013
Posts: 6
Rep Power: 3
mulchah is on a distinguished road
@shantanu, please send me your version of the code. I think mine still has a tiny bug or two in it. My email is: hiten.m@gmail.com. Thanks!
mulchah is offline   Reply With Quote

Old   December 18, 2014, 08:52
Default
  #13
ORO
New Member
 
Join Date: Dec 2014
Posts: 1
Rep Power: 0
ORO is on a distinguished road
@shantanu could you please help me in what you did to satisfy the convergence criterion?
ORO is offline   Reply With Quote

Reply

Tags
boundary conditions, couette, incompressible, matlab code

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Domain format problem on airfoil flow simulation andrenonaka CFX 6 December 4, 2014 04:57
Multiphase phase (gas-solid) flow using Eulerian-Granular medel ( divergence problem) jessie FLUENT 3 May 29, 2014 11:05
Viscoelastic flow modeling in Fluent Ankur Navra FLUENT 3 July 26, 2013 05:56
transient, impregnating flow problem fgommer FLUENT 0 February 29, 2012 17:10
Poiseuille flow problem Rosie FLUENT 1 December 6, 2002 17:52


All times are GMT -4. The time now is 01:41.