# Flow through rectangular channel using SIMPLER algorithm

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 November 19, 2022, 09:56 Flow through rectangular channel using SIMPLER algorithm #1 New Member   Apoorv Mishra Join Date: Nov 2022 Posts: 5 Rep Power: 2 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 12:17.

 November 19, 2022, 13:42 #2 Senior Member     Paolo Lampitella Join Date: Mar 2009 Location: Italy Posts: 2,014 Blog Entries: 29 Rep Power: 38 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?

 November 20, 2022, 05:23 #3 New Member   Apoorv Mishra Join Date: Nov 2022 Posts: 5 Rep Power: 2 Thanks for taking time to respond. I've edited the question with details.

November 21, 2022, 11:17
#4
Senior Member

Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,014
Blog Entries: 29
Rep Power: 38
Quote:
 Originally Posted by Mishra Apoorv 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?

November 25, 2022, 04:32
#5
New Member

Apoorv Mishra
Join Date: Nov 2022
Posts: 5
Rep Power: 2
Quote:
 Originally Posted by sbaffini 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.

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.

November 25, 2022, 16:19
#6
Senior Member

Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,014
Blog Entries: 29
Rep Power: 38
Quote:
 Originally Posted by Mishra Apoorv 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.

November 25, 2022, 17:11
#7
Senior Member

Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,290
Rep Power: 67
Quote:
 Originally Posted by Mishra Apoorv 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,

 Tags boundary condition, poiseuille flow, scilab, simpler algorithm

 Thread Tools Search this Thread Search this Thread: Advanced Search Display Modes Linear Mode

 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 OffTrackbacks are Off Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post roi247 FLUENT 5 January 30, 2020 14:59 hesamabtahi FLUENT 0 May 2, 2018 10:13 dhouha FLOW-3D 1 August 30, 2017 11:06 roi247 FLUENT 22 March 16, 2016 12:13 Matthew Roberts FLUENT 6 July 31, 2009 12:52

All times are GMT -4. The time now is 21:03.

 Contact Us - CFD Online - Privacy Statement - Top