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

Problematic lid-driven cavity using SIMPLE on collocated grid

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Freewill1

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 27, 2020, 11:13
Question Problematic lid-driven cavity using SIMPLE on collocated grid
  #1
New Member
 
Freewill1's Avatar
 
Join Date: Aug 2014
Posts: 18
Rep Power: 11
Freewill1 is on a distinguished road
Dear all,

I tried the lid-driven cavity case by solving 2-D imcompressible steady Navier-Stokes equation using SIMPLE algorithm.

Basically, I followed Versteeg & Malalasekera's textbook (Versteeg & Malalasekera 2007, An Introduction to Computational Fluid Dynamics: The Finite Volume Method, Pearson Education, 2nd ed.) step by step, except for using of the collocated grid.

For simplicity, detailed calculation can be seen in the attached flow chart.

In my codes, the momentum interpolation is preoperly working (because face values u_w_star, u_e_star, v_s_star, v_n_star match node values u_star, u_star, v_star, v_star well).

Results seems normal and the codes behaves properly, but only very SMALL value of pressure under-relaxtion factor is allowed to keep SIMPLE iteration convergent.

It seems that large pressure correction (P', serveral order of magnitude higher than correction of velocoity u', v') in the Step-2 is yield when solve continuity equation, but I don't know why.

Can anybody help me?

I modularized the codes including:
1. Cavity_steady_2D.m - main
2. solveStokesEqXTVD.m - solve the x-momentum equation to get u*, u*_pseudo
3. solveStokesEqYTVD.m - solve the y-momentum equation to get v*, v*_pseudo
4. solveContinuityEq.m - solve the continuity Eq. and get correction value P' of P
5. getVelCorrections.m - get corrections u', v' for u, v
6. correctVelocityPressure.m - correct u, v, P
Intermediate variables are shown. Codes are attached.

Best,

Fw.
Attached Images
File Type: png Figuire 1.png (128.6 KB, 72 views)
File Type: png Figuire 2.png (53.5 KB, 53 views)
Attached Files
File Type: pdf flow chart.pdf (171.6 KB, 67 views)
File Type: zip codes.zip (20.1 KB, 51 views)

Last edited by Freewill1; June 10, 2020 at 10:30. Reason: Updating data
Freewill1 is offline   Reply With Quote

Old   June 17, 2020, 05:14
Smile Bug found and fixed.
  #2
New Member
 
Freewill1's Avatar
 
Join Date: Aug 2014
Posts: 18
Rep Power: 11
Freewill1 is on a distinguished road
Bug found and fixed with the help of tas38 here:

https://www.cfd-online.com/Forums/cfd-freelancers/227828-looking-2-d-simple-code.html

Quote:
Originally Posted by tas38 View Post
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 u = u^* + \alpha_u u' --> This is NOT correct. Note that in equation 6.15 in the aforementioned text that u = u^* + u'. The under-relaxation \alpha_u has already impacted the computation u^* via the momentum equations and u' 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.
New code are attached here for people who may need, although looks a little bit tedious.
Attached Files
File Type: zip code_relaxation_fixed.zip (19.3 KB, 76 views)
commatrix likes this.
Freewill1 is offline   Reply With Quote

Old   May 25, 2023, 00:18
Default
  #3
New Member
 
Join Date: May 2023
Posts: 1
Rep Power: 0
commatrix is on a distinguished road
Thank you very much for sharing Freewill1! I am a cfd beginner and looking for a code of a simple algorithm. And you made me understand where the velocity under-relaxtion work.
commatrix is offline   Reply With Quote

Reply

Tags
collocated, lid-driven cavity, simple


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 11:33
Lid Driven Cavity (SIMPLE) deepmorzaria Main CFD Forum 15 April 26, 2020 12:00
Lid Driven Cavity and Turbulent Flow Mayzie12 FLUENT 1 November 8, 2017 06:28
Lid Driven Cavity - SIMPLE(R) calmbeep CFD Freelancers 1 June 30, 2016 04:37
Lid driven cavity in Fortran Dhairya Main CFD Forum 4 June 29, 2016 01:25


All times are GMT -4. The time now is 12:25.