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

solving 2D convection-diffusion equation using finite volume method with MATLAB

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By ERIKY

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 4, 2022, 23:53
Default solving 2D convection-diffusion equation using finite volume method with MATLAB
  #1
New Member
 
Ming-Shang Chang
Join Date: Nov 2022
Posts: 1
Rep Power: 0
ERIKY is on a distinguished road
I'm currently working on an assignment which is about using Central Difference(CDS), QUICK, Upwind, and MUSCL scheme (using flux limiter) to solve the convection-diffusion equation. however when I compile the MATLAB code there seems to be some error, I do not understand why the result of CDS after Peclet number like 10 and 100 looks so horrible. Although I knew that the scheme is invalid for Peclet number over 2, it should be at least looking similar to the result under Peclet number of 2. is the structure of the code wrong or the error part or sth else? Plus, the QUICK scheme seems cannot converge, but I do not know what went wrong....

Also, does anyone know how to apply the flux limiter to the code.... I understand the theory just do not know how to transfer it into code...

The problem description and the code will be attached, genuine thankful for the assistance.
Attached Images
File Type: jpg Screenshot 2022-11-03 144604.jpg (181.7 KB, 54 views)
Attached Files
File Type: docx 2D convection-diffusion code.docx (15.7 KB, 52 views)
aerosayan likes this.
ERIKY is offline   Reply With Quote

Old   November 5, 2022, 11:56
Default
  #2
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,842
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
You should have studied the features of the CDS scheme when the cell Pe number is greater than 2. Have you first developed your homework in 1D? There are a lot of textbook where you can compare the results.
The limiter is a non linear function of the state variables that applies on the flux between two cells. You can have a look to the textbook of Ferziger, Peric and Street.
FMDenaro is offline   Reply With Quote

Old   November 24, 2022, 12:26
Default
  #3
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,842
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by LandonT.F. View Post
Can you show the sources where I can get those textbooks please? At least, one would be very welcome.

https://link.springer.com/book/10.10...-3-319-99693-6
FMDenaro is offline   Reply With Quote

Old   November 24, 2022, 15:40
Default
  #4
Senior Member
 
Sayan Bhattacharjee
Join Date: Mar 2020
Posts: 495
Rep Power: 8
aerosayan is on a distinguished road
Quote:
Originally Posted by ERIKY View Post
I do not understand why the result of CDS after Peclet number like 10 and 100 looks so horrible. Although I knew that the scheme is invalid for Peclet number over 2, it should be at least looking similar to the result under Peclet number of 2.
High Peclet numbers indicate that the convective effects dominate the flow instead of diffusive effects. Thus, when you use CDS, the physics is not well represented in the maths.

Considering a 1D flow from left to right ...

Basically, CDS takes data both from the left and right cells, and considers them to be equally important , thus it represents the physics wrong, as clearly, the importance of the upwind cell (left cell) is more than the downwind cell (right cell).

So, it fails with high Peclet numbers. What you need, is an upwind scheme.

For FEM based CFD, Galerkin formulation also has a similar issue, where the the Galerkin discretization assumes equal importance for the left and right cells. Thus methods like SUPG (Streamline Upwind Petrov Galerkin) method were introduced to mimick what upwind schemes do in FVM CFD.

Basically, both FEM and FVM based CFD solves the same problem in the same way, by introducing upwind schemes, so the physics is represented well.
aerosayan is offline   Reply With Quote

Reply

Tags
convection-diffusion, finite volume method, matlab code


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
laplacianFoam with source term Herwig OpenFOAM Running, Solving & CFD 17 November 19, 2019 13:47
Segmentation fault when using reactingFOAM for Fluids Tommy Floessner OpenFOAM Running, Solving & CFD 4 April 22, 2018 12:30
SLTS+rhoPisoFoam: what is rDeltaT??? nileshjrane OpenFOAM Running, Solving & CFD 4 February 25, 2013 04:13
Upgraded from Karmic Koala 9.10 to Lucid Lynx10.04.3 bookie56 OpenFOAM Installation 8 August 13, 2011 04:03
Orifice Plate with a fully developed flow - Problems with convergence jonmec OpenFOAM Running, Solving & CFD 3 July 28, 2011 05:24


All times are GMT -4. The time now is 23:51.