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

Example code for 2D linear convection on unstructured triangular grids

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By arjun

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 1, 2022, 20:00
Default Example code for 2D linear convection on unstructured triangular grids
  #1
Senior Member
 
Sayan Bhattacharjee
Join Date: Mar 2020
Posts: 495
Rep Power: 8
aerosayan is on a distinguished road
Hello everyone,

I'm looking for a simple code example for only 2D linear convection on unstructured triangular grids. Not convection-diffusion. Only linear convection, and nothing else. I understand how to solve convection diffusion on 2D structured grids with FTBS scheme, but I don't understand how to solve them on unstructured triangular grids. Since every example for unstructured grid shows combined convection-diffusion, it kind of becomes hard to understand the basic concept.
aerosayan is offline   Reply With Quote

Old   August 2, 2022, 08:38
Default
  #2
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,152
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
What is your difficulty? Because, in general, it really sums up to simply not using the diffusion part from the convection-diffusion example.

For explicit schemes, of course, there are caveats, and not all the convective schemes are compatible with all the time advancement schemes. But, for a classical, implicit, cell-centered, finite volume discretization on unstructured grids, you really just need to neglect diffusion from a convection-diffusion example.
sbaffini is offline   Reply With Quote

Old   August 3, 2022, 13:09
Default
  #3
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,273
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
I think you can derive by simply setting diffusion coefficient D=0.


On unstructured grids the face values will be from left if the fluxes are positive and from the right if fluxes are negative.

In the end you will get the sources computed as

Src_left -= phi_upwind * flux

Src_right += phi_upwind * flux


In the end you loop through all the cells and add

Src += phi * mass_imbalance


This is how the source terms are computed in Wildkatze.
aerosayan likes this.
arjun is offline   Reply With Quote

Reply


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
boundedness of TVD in 3D unstructured grids Lydia OpenFOAM Programming & Development 4 July 9, 2014 16:31
unstructured grids, future trend? Anna Tian Main CFD Forum 1 April 6, 2014 14:54
BC implementation on unstructured grids sunny Main CFD Forum 1 October 10, 2004 07:27
Free Boundary Flows on Unstructured Grids George Main CFD Forum 8 March 5, 2002 12:10
unstructured vs. structured grids Frank Muldoon Main CFD Forum 1 January 5, 1999 10:09


All times are GMT -4. The time now is 06:56.