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

2D unstructured mesher in F90

Register Blogs Community New Posts Updated Threads Search

Rate this Entry

2D unstructured mesher in F90

Posted August 9, 2012 at 09:23 by truffaldino

This is 2D unstructured mesher.

tri_mesh.f90 is a mesher and the rest are input files

Example 1: Cavity flow driven by upper cavity wall

file: cavity_bc.txt

Example 2: flow past NACA 0012 airfoil

files: NACA0012_bc.txt - airfoil
wt_bc.txt - wind tunnel
wake_bc.txt -wake

Description of the program is placed in the header of tri_mesh.f90
Attached Files
File Type: f tri_mesh.f (100.5 KB, 16943 views)
File Type: txt cavity_bc.txt (65 Bytes, 16922 views)
File Type: txt NACA0012_bc.txt (16.6 KB, 16916 views)
File Type: txt wt_bc.txt (184 Bytes, 17203 views)
File Type: txt wake_bc.txt (5.5 KB, 16863 views)
Posted in Uncategorized
Views 3211 Comments 3 Edit Tags Email Blog Entry
« Prev     Main     Next »
Total Comments 3

Comments

  1. Old Comment
    thx for your nice work truffaldino! the code help me a lot :-)
    can you please tell me some detail information about the algorithm in subroutine get_tree_and_table, i know you used quad-tree to split the area(im not sure about the details, this part confused me too),but what really puzzles me is how to use quad-tree to distinguish the area inside or outside the domain which need meshing, Can you give me some details about these, or give me some references. thx alot
    permalink
    Posted August 23, 2014 at 14:39 by fireflies fireflies is offline
    Updated August 23, 2014 at 15:12 by fireflies (need more details)
  2. Old Comment
    truffaldino's Avatar
    Hello fireflies,

    I have written this program several years ago and can barely remember what is inside. Let us try to recall...

    The main idea of the algorithm was to initially distribute points according to desired density inside domain. Then do the domain triangulation on these points with help of Delaunay algorithm and then deform the mesh according to this article ("DistMesh" algorithm)

    http://persson.berkeley.edu/pub/persson04mesh_col.pdf

    The quadtree is needed only on initial stage of point distribution. The distances to the domain boundary are computed with the help of subroutines dist get_distances etc just by computing distances from the point to all segments of the boundary and computing the total angle spanned by boundary with the center at a given point: If the angle is 0 then the point is outside the domain: if it is 2*Pi it is inside the domain. Total angle is computed by summing up the contribution from each segment of the bounday.

    About tree and table: I should refresh all details in memory, but as far as I can remember the table is something like the inverse tree. It seems I was trying to pack the tree in 1D array and then inverse tree restored the tree point from its number in this array.

    I should take look at this program once more to restore details in memory

    Truffaldino
    permalink
    Posted August 24, 2014 at 12:00 by truffaldino truffaldino is offline
    Updated August 24, 2014 at 17:28 by truffaldino
  3. Old Comment
    I got it! you are such a nice man! many many thanks for your patience to answer, great help for me :)
    permalink
    Posted August 25, 2014 at 14:05 by fireflies fireflies is offline
 

All times are GMT -4. The time now is 02:59.