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

Flow through rectangular channel using SIMPLER algorithm

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 19, 2022, 10:56
Red face Flow through rectangular channel using SIMPLER algorithm
  #1
New Member
 
Apoorv Mishra
Join Date: Nov 2022
Posts: 5
Rep Power: 4
Mishra Apoorv is on a distinguished road

I am new to the community and CFD itself and am working on my first CFD program in Scilab based on the SIMPLER algorithm i.e. modeling a flow through a rectangular cross section channel. I want to get a Poiseuilli kind of flow profile but I'm stuck at a couple of boundary conditions.

I have given a dirichlet type of Boundary condition i.e. constant velocity inlet at the face of the inlet and no slip at the 4 walls but I'm not understanding what should be the y and z (perpendicular to the length of channel) direction velocities (v & w respectively) at the inlet and outlet of the channel.


It's a 3D staggered grid arrangement like the image below (image just for illustration), the black points being the points for pressure.

https://drive.google.com/file/d/1oBm...ew?usp=sharing



Let's say the red velocities on the extreme left are the constant u inlet velocities and the right ones being the outlet. So, for such an arrangement, there exists a series of v velocities (green) on the left of the inlet and also on the right of the outlet out of the main domain. For the no slip boundary conditions at the walls I did,

v( :,:,1 ) = -v( :,:,2); &
v(:,:,npz+1) = -v(:,:,npz); (npz = (no. of pressure elements along z direction) + 1)

and similar for u & w.


But what should be the condition for v and w at the inlet?
I've tried v(1,:,: ) = -v(2,:,: ) & same for w since both should be 0 at inlet face but it doesn't work and the solution seem to diverge after just the first iteration.


Also I just want to give the constant inlet velocity as the initial condition so is there any need to specify pressure as boundary condition anywhere? Because as opposed to SIMPLE, SIMPLER requires an initial guessed velocity field and no pressure guess.

Any help will be appreciated.

Last edited by Mishra Apoorv; November 20, 2022 at 13:17.
Mishra Apoorv is offline   Reply With Quote

Old   November 19, 2022, 14:42
Default
  #2
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,195
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Let's split what you want from how you implement it.

At inlet, assuming an incompressible flow, you should assign all the velocity components, and having v and w as 0 is probably what you want.

For the implementation,.it depends from what code you have. Is this a staggered finite difference code?
sbaffini is offline   Reply With Quote

Old   November 20, 2022, 06:23
Default
  #3
New Member
 
Apoorv Mishra
Join Date: Nov 2022
Posts: 5
Rep Power: 4
Mishra Apoorv is on a distinguished road
Thanks for taking time to respond.
I've edited the question with details.
Mishra Apoorv is offline   Reply With Quote

Old   November 21, 2022, 12:17
Default
  #4
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,195
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Quote:
Originally Posted by Mishra Apoorv View Post
Thanks for taking time to respond.
I've edited the question with details.
I haven't used staggered stuff in more than a decade, so I can only say that what you have shown of your implementation seems correct to me. Yet, that's just the textbook part of a whole code, the error might be everywhere.

Have you tested the code in 2D, or even 1D using symmetry bc and just one cell in that direction? Have you tested the code on any other case?
sbaffini is offline   Reply With Quote

Old   November 25, 2022, 05:32
Default
  #5
New Member
 
Apoorv Mishra
Join Date: Nov 2022
Posts: 5
Rep Power: 4
Mishra Apoorv is on a distinguished road
Quote:
Originally Posted by sbaffini View Post
I haven't used staggered stuff in more than a decade, so I can only say that what you have shown of your implementation seems correct to me. Yet, that's just the textbook part of a whole code, the error might be everywhere.

Have you tested the code in 2D, or even 1D using symmetry bc and just one cell in that direction? Have you tested the code on any other case?
Yes I've tested the code for the 1D case and the problem is the same. I've managed to narrow the causes for it, like I think the code for pseudo velocity computation is the one which messes the whole solution though the algorithm is correct theoretically. As mentioned earlier, it gives satisfactory output (i.e. correctly applied boundary condition and roughly parabolic nature of velocity profile could be seen) at the first and second iteration but starts giving random values, even negative thereafter.


https://drive.google.com/file/d/1Rwg...ew?usp=sharing



Here I'm attaching my code for reference. If you have any insights or have worked with SIMPLER before, then please suggest how to troubleshoot such issues and if there's any good source to study the coding for CFD/FVM that you know of, then please mention it.



Thank you.
Mishra Apoorv is offline   Reply With Quote

Old   November 25, 2022, 17:19
Default
  #6
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,195
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Quote:
Originally Posted by Mishra Apoorv View Post
Yes I've tested the code for the 1D case and the problem is the same. I've managed to narrow the causes for it, like I think the code for pseudo velocity computation is the one which messes the whole solution though the algorithm is correct theoretically. As mentioned earlier, it gives satisfactory output (i.e. correctly applied boundary condition and roughly parabolic nature of velocity profile could be seen) at the first and second iteration but starts giving random values, even negative thereafter.


https://drive.google.com/file/d/1Rwg...ew?usp=sharing



Here I'm attaching my code for reference. If you have any insights or have worked with SIMPLER before, then please suggest how to troubleshoot such issues and if there's any good source to study the coding for CFD/FVM that you know of, then please mention it.



Thank you.
I can't really help you here, as I am not really acquainted with the SIMPLER method. Have you tried with other SIMPLE variants? Clearly, if it doesn't work in 1D, where you should get a constant velocity, there must be a problem in something larger than simply bc.

The way these things are debugged is to focus on the most simple problem that doesn't work, possibly on the coarsest possible grid, and then analyze the algo step by step, comparing at each step what you get with what you expect. At some point you must find something that doesn't work, then you investigate its input. If it is legit than you have found your bug, otherwise you proceed backward until the input to a line is legit but the output isn't.
sbaffini is offline   Reply With Quote

Old   November 25, 2022, 18:11
Default
  #7
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
Quote:
Originally Posted by Mishra Apoorv View Post



But what should be the condition for v and w at the inlet?
I've tried v(1,:,: ) = -v(2,:,: ) & same for w since both should be 0 at inlet face but it doesn't work and the solution seem to diverge after just the first iteration.


Any help will be appreciated.



Why? You should suppose that this is a Dirichlet condition corresponding to a flow having only one velocity component, the one in streamwise direction,
FMDenaro is offline   Reply With Quote

Reply

Tags
boundary condition, poiseuille flow, scilab, simpler algorithm


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
Applyinga one phase LES to rectangular channel flow roi247 FLUENT 5 January 30, 2020 15:59
modeling entering two phase flow in open channel flow hesamabtahi FLUENT 0 May 2, 2018 11:13
How to validate a 3D poiseuille flow in a rectangular channel? dhouha FLOW-3D 1 August 30, 2017 12:06
Using LES simulating flow through a rectangular channel roi247 FLUENT 22 March 16, 2016 13:13
VOF modelling open channel river flow Matthew Roberts FLUENT 6 July 31, 2009 13:52


All times are GMT -4. The time now is 16:04.