# Looking for a 2-D SIMPLE code

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

 June 11, 2020, 07:29 Looking for a 2-D SIMPLE code #1 New Member     Join Date: Aug 2014 Posts: 18 Rep Power: 11 Hi, I am looking for a SIMPLE 2-D demonstration code with following capacities: 1. 2-D lid-driven cavity and natural convection (Re value range: 1~1000) 2. based on SIMPLE algorithm 3. collocated arrangment 4. incompressible, Newtonian fluid 5. implemented using matlab Best, f

June 14, 2020, 04:24
#2
Senior Member

Troy Snyder
Join Date: Jul 2009
Location: Akron, OH
Posts: 219
Rep Power: 18
Quote:
 Originally Posted by Freewill1 Hi, I am looking for a SIMPLE 2-D demonstration code with following capacities: 1. 2-D lid-driven cavity and natural convection (Re value range: 1~1000) 2. based on SIMPLE algorithm 3. collocated arrangment 4. incompressible, Newtonian fluid 5. implemented using matlab Best, f
I do not have a matlab code to provide you.

But I do notice that you previously posted a lid-driven cavity code (written in matlab) for which you were having some difficulty.

Problematic lid-driven cavity using SIMPLE on collocated grid

I took a look at your code, and I think the issue is that you do not properly apply under-relaxation to the momentum equations. The momentum under-relaxation parameters are applied when solving the momentum equations and will therefore implictly impact the pressure-correction equation solution. They will affect the stability and convergence rates of both the momentum and pressure correction equations. See Section 6.4 in Versteeg and Malalasekera (1995 copy) for more details on this.

In your code (see link above), you apply relaxation to the u- and v-velocity components at the point at which the pressure correction equations are applied. Something like --> This is NOT correct. Note that in equation 6.15 in the aforementioned text that . The under-relaxation has already impacted the computation via the momentum equations and via the mass imbalance (source) terms within the pressure-correction equation.

Hopefully you can get your own code working as a result of this suggestion.

 June 14, 2020, 08:23 #3 New Member     Join Date: Aug 2014 Posts: 18 Rep Power: 11 Hi Troy, Thank you for your reply, I will try to fix the bug you find. Best, f

 June 17, 2020, 05:23 Bug found and fixed. #4 New Member     Join Date: Aug 2014 Posts: 18 Rep Power: 11 Indeed, a worng under-relaxation method was used. Now new code with this bug fixed are available here: Problematic lid-driven cavity using SIMPLE on collocated grid Many thanks, Troy @tas38.

 Tags collocated, lid-driven cavity, natural convection, simple