CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Meshing & Mesh Conversion

2D adaptive Mesh Refinement

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

Like Tree11Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   June 5, 2013, 13:44
Default 2D adaptive Mesh Refinement
  #1
New Member
 
Join Date: Jan 2013
Posts: 1
Rep Power: 0
baco is on a distinguished road
Hello Foamers,

i am new here.

i am not sure if it is right posting my problem in this forum... i hope it is ok.
I did create an adaptive mesh using dynamicRefineFvMesh. I adapted the hexRef8 class for splitting cells in 2D. Now i started my solver and the cell refinement runs good (the mesh check is OK) and now the big BUT it comes ...
Always if the mesh changes the calculations will be solved in 3D, i.e. the vector of velocity is directed in the 3.dimension.
And now comes sth weird. If i stop the calculation and then i re-start it from the last timestep then the calculation is correctly calculated in 2D. What is the problem, i have absolutely no idea.

many thanks
baco is offline   Reply With Quote

Old   June 7, 2013, 03:11
Default
  #2
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,240
Blog Entries: 1
Rep Power: 18
nimasam is on a distinguished road
dear buddy, maybe you want to share your code and one test case here, maybe we can help you to solve the problem
__________________
Telegram channel (https://telegram.me/openfoam4Iranian)
My Weblog in Persian(http://openfoam.blogfa.com/)
My Personal Website (http://nimasamkhaniani.ir/)
nimasam is offline   Reply With Quote

Old   July 17, 2013, 14:45
Default
  #3
Member
 
Haomin Yuan
Join Date: Jan 2012
Location: Madison, Wisconsin, USA
Posts: 57
Rep Power: 7
yhaomin2007 is on a distinguished road
Hey,

As far as I know, the cut engine hexRef8 is only capable to cut cell into 8 subcells, which means it is 3 dimensions. I have seen a paper talking about cut cells in to 2 subcells, I think you look it up here:
http://publications.lib.chalmers.se/...173/174173.pdf

Another question is, what solver are u using? I am now trying to implement AMR into steady solver.But I met some problems.
francescomarra likes this.
yhaomin2007 is offline   Reply With Quote

Old   July 28, 2013, 10:04
Default
  #4
New Member
 
Johannes P
Join Date: Feb 2012
Posts: 8
Rep Power: 7
pjohannes183 is on a distinguished road
I'm also working on a 2D adaptive mesh refinement with a dynamicFvMesh. Does anybody have an idea whether it's good to start modifying the hexRef8 class, keeping its low-level style (which is really complicated) or if one could adapt hexRef8, keep using all its nice features and just plug in simpler mesh modification operations?

I successfully managed to do exactly the refinement I want using multiDirRefinement which gives me the type of meshes I want BUT It still lacks all the other capabilities which are needed for a dynamic mesh (like: field mapping, keeping track of the refinement history, allowing unrefinement etc.)

What I'd like to do is: take hexRef8 and rewrite it partially, using the code from multiDirRefinement, thus turning it into a hexRef4 or hexRef2.

Does anybody have a good idea how to start?
pjohannes183 is offline   Reply With Quote

Old   May 31, 2016, 10:00
Default
  #5
New Member
 
Join Date: Mar 2015
Posts: 16
Rep Power: 4
K.C. is on a distinguished road
Have you seen this thesis? (http://digitalcommons.mtu.edu/cgi/vi...8&context=etds)
Especially Apendix B.

It seems like the 2D adaptive mesh refinement we are looking for.
K.C. is offline   Reply With Quote

Old   July 19, 2016, 14:39
Default
  #6
New Member
 
Jakub Pola
Join Date: Feb 2011
Posts: 22
Rep Power: 8
stainboy is on a distinguished road
Hi,

does anyone of you managed to implement the 2D engine for dynamic local mesh refinement?

I'm trying to do it according to mentioned paper: [Ahmad Baniabedalruhman] http://digitalcommons.mtu.edu/etds/1005/[/URL]

I'm currently struggling with the code from appendix B related to splitting of internal faces. Does anyone know how the variable anchorPointJ should be initialized? It is appearing on the page 173 when author is proposing the algorithm for splitting internal faces.

Regards,
Jakub.
stainboy is offline   Reply With Quote

Old   July 20, 2016, 04:46
Default
  #7
New Member
 
Join Date: May 2016
Posts: 2
Rep Power: 0
Hannes89 is on a distinguished road
Hi Jakub,

I am also currently trying to get the adaptive mesh refinement to run in 2D following the Baniabedalruhman thesis.

It seems to me that the modifications are neither complete nor all correct.
With some modifications, I was able to compile the new library but my code crashes during the first refinement step.

For the anchorPointJ I have added:
label anchorPointJ = anchors.otherVertex(anchorPointI);


Send me a PM if you are interested in a discussion

Hannes
mm.abdollahzadeh likes this.
Hannes89 is offline   Reply With Quote

Old   July 21, 2016, 11:40
Default
  #8
New Member
 
Join Date: Mar 2016
Posts: 7
Rep Power: 3
catelyn is on a distinguished road
Hi Hannes89,

I am interested in adaptive mesh refinement.
I found and fixed some problems, but I still don't understand how to declare:
-anchorPointJ
-isDivisibleFace
-isDivisibleEdge.

Did you solve the problems?
Could you help me?

Regards,
Carmelina
catelyn is offline   Reply With Quote

Old   July 21, 2016, 14:47
Default
  #9
New Member
 
Jakub Pola
Join Date: Feb 2011
Posts: 22
Rep Power: 8
stainboy is on a distinguished road
Catelyn,

together with Hannes89, we are trying to implement this solution. You can join us if you want. The more the better

On monday I will try to give you some hints regarding those variables.

Regards,
Jakub.
catelyn likes this.
stainboy is offline   Reply With Quote

Old   July 25, 2016, 06:02
Default
  #10
New Member
 
Join Date: May 2016
Posts: 2
Rep Power: 0
Hannes89 is on a distinguished road
Hi Catelyn,

the isDivisible variables should be boolean lists, holding a value for every face and edge, that can be declared like this:

boolList isDivisibleFace(mesh_.nFaces(),false);
boolList isDivisibleEdge(mesh_.nEdges(),false);

Regarding the anchorPointJ. I am not so sure about the algorithm implemented in the PhD thesis and can not give you a definitive answer.
I am currently trying to rewrite this bit of the code.

Hannes
RBJ and mm.abdollahzadeh like this.
Hannes89 is offline   Reply With Quote

Old   July 25, 2016, 06:10
Default
  #11
New Member
 
Jakub Pola
Join Date: Feb 2011
Posts: 22
Rep Power: 8
stainboy is on a distinguished road
Hi,

here are my thoughts regarding variables you asked.
  • isDivisibleFace - this is a bool list pointing if the face can be splitted. Faces on the empty boundary should be divided to four new faces, the others into two. I would use boolList at first glance, later it could be changed to PackedBoolList. The size is nFaces(). So the full declaration will be:

    Code:
    boolList isDivisibleFace(mesh_.nFaces(), 0)
  • isDivisibleEdge - here similarly it is a list which index corresponds to edge index in the mesh. If the isDivisibleEdge[index] = true then edge number equal ti index can be splitted for creating new faces in the mesh.

    Code:
    boolList isDivisibleEdge(mesh_.nEdges(), 0)

When it comes to anchorPointJ, we don't know yet what it should be.

Kuba.
mm.abdollahzadeh likes this.
stainboy is offline   Reply With Quote

Old   July 26, 2016, 05:30
Default
  #12
New Member
 
Join Date: Mar 2016
Posts: 7
Rep Power: 3
catelyn is on a distinguished road
Thank you all,
I realized they were boolean variables but I have a too approximate knowledge in programming.
I wrote to Dr. Baniabedalruhman, I'll keep you posted if I receive any answers.

Catelyn
catelyn is offline   Reply With Quote

Old   November 13, 2016, 00:44
Talking 2d amr
  #13
New Member
 
XuDongNa
Join Date: Feb 2012
Location: Harbin Heilongjiang Province,China
Posts: 11
Rep Power: 7
supersoldier is on a distinguished road
Send a message via ICQ to supersoldier
Quote:
Originally Posted by catelyn View Post
Thank you all,
I realized they were boolean variables but I have a too approximate knowledge in programming.
I wrote to Dr. Baniabedalruhman, I'll keep you posted if I receive any answers.

Catelyn
Have you succeed? , recently I also refer to Dr .Baniabedalruhman's thesis for 2D AMR, but still a lot of problems? How to define the variable of anchorPointJ ? Coud you give me some hints how to make the 2D AMR run successfully,please? Thank you.
supersoldier is offline   Reply With Quote

Old   November 14, 2016, 11:26
Default
  #14
New Member
 
Join Date: Mar 2016
Posts: 7
Rep Power: 3
catelyn is on a distinguished road
Quote:
Originally Posted by supersoldier View Post
Have you succeed? , recently I also refer to Dr .Baniabedalruhman's thesis for 2D AMR, but still a lot of problems? How to define the variable of anchorPointJ ? Coud you give me some hints how to make the 2D AMR run successfully,please? Thank you.
No, I didn't, and he didn't reply.

Catelyn
catelyn is offline   Reply With Quote

Old   November 20, 2016, 10:47
Default
  #15
New Member
 
XuDongNa
Join Date: Feb 2012
Location: Harbin Heilongjiang Province,China
Posts: 11
Rep Power: 7
supersoldier is on a distinguished road
Send a message via ICQ to supersoldier
I have study the codes at Appendix B in the thesis of http://digitalcommons.mtu.edu/cgi/vi...8&context=etds. I changed the codes as the thesis suggest, but when I run my 2d heat transfer case, there's error. And I output the debug informaion, I found basically those values are right.

I find the error was occur in the function createInternalFaces ( original in file hexRef8.C for 3D ,but I change this file hexRef4.C for 2D) .

The "if (edgeMidPointI==-1)" judgement ,which I think is the key problem, because for 2D problem ,the value of edgeMidPointI of empaty boundary 's edge are not -1, but the value of edgeMidPointI of internal edges are -1, so when loop the interal edge this judgement is right, it will output the wrong message,and stop the programm.

So, I look into the function of storeMidPointInfo, I want to do some change, but I do not unstand its theory. I will continue to handle this problem. Is there anyone can give me some help how to sovle this problem?

If I successed to run the 2D AMR , I will show the codes!





supersoldier is offline   Reply With Quote

Old   November 30, 2016, 09:52
Default
  #16
New Member
 
Luca Cornolti
Join Date: Jun 2016
Location: Switzerland
Posts: 6
Rep Power: 3
Luca Cornolti is on a distinguished road
Hi,

I recently started to work on this problem too. I tried to implement the (in)famous code described in Dr. Baniabedalruhman's thesis in Openfoam 3.2 extend, whose dynamicMesh libraries are very close to the "standard" version.

As already reported, the description of the code in the thesis is quite incomplete. After some modification, I reached the same point of XuDongNa: when runiing the solver, the refinement process stops when the first cell is split as the createInternalFaces function sends an error because the edgeMidPointl is not set.

Unfortunately, I don't have much time to work on this.
Where you able to solve the problem?
Luca Cornolti is offline   Reply With Quote

Old   December 13, 2016, 06:19
Default
  #17
Senior Member
 
mahdi abdollahzadeh
Join Date: Mar 2011
Location: Covilha,Portugal
Posts: 151
Rep Power: 8
mm.abdollahzadeh is on a distinguished road
Dear All

Here is the code and a case following the introduction of the Ahmad thesis, It doesnt run!
here is the error it looks like that spilitting the faces and edges are done correctly, however, it has errors when creating the internal faces.

Quote:


hexRef82D::consistentRefinement : Changed 0 refinement levels due to 2:1 conflicts.
Selected 12 cells for refinement out of 405.
hexRef82D::setRefinement : Checking initial mesh just to make sure
hexRef82D::setRefinement : Checking initial mesh just to make sure
hexRef82D::checkMesh : Using matching tolerance smallDim:8.2603e-07
hexRef82D::checkMesh : Returning
hexRef82D::checkRefinementLevels : Checking 2:1 refinement level
hexRef82D::setRefinement : Allocating 12 cell midpoints.
hexRef82D::setRefinement : Allocating 12 cell midpoints.
hexRef82D::setRefinement : Dumping 12 cells to split to cellSet "/home/mahdi/foam/foam-extend-3.2/tutorials/multiphase/interDyMFoam/ras/laminar/damBreak/constant/polyMesh/sets/splitCells"
hexRef82D::setRefinement : Allocating edge midpoints.
hexRef82D::setRefinement : Allocating edge midpoints.
hexRef82D::setRefinement : Dumping edge centres to split to file "/home/mahdi/foam/foam-extend-3.2/tutorials/multiphase/interDyMFoam/ras/laminar/damBreak/edgeMidPoint.obj"
hexRef82D::setRefinement : Allocating face midpoints.
hexRef82D::setRefinement : Allocating face midpoints.
hexRef82D::setRefinement : Dumping 56 faces to split to faceSet "/home/mahdi/foam/foam-extend-3.2/tutorials/multiphase/interDyMFoam/ras/laminar/damBreak/constant/polyMesh/sets/splitFaces"
hexRef82D::setRefinement : Finding cell anchorPoints (8 per cell)

hexRef82D::setRefinement :Points so far:8(354 365 366 355 519 520 531 530)
hexRef82D::setRefinement :Points so far:8(355 366 367 356 520 521 532 531)
hexRef82D::setRefinement :Points so far:8(364 375 376 365 529 530 541 540)
hexRef82D::setRefinement :Points so far:8(365 376 377 366 530 531 542 541)
hexRef82D::setRefinement :Points so far:8(366 377 378 367 531 532 543 542)
hexRef82D::setRefinement :Points so far:8(367 378 379 368 532 533 544 543)
hexRef82D::setRefinement :Points so far:8(375 386 387 376 540 541 552 551)
hexRef82D::setRefinement :Points so far:8(376 387 388 377 541 542 553 552)
hexRef82D::setRefinement :Points so far:8(377 388 389 378 542 543 554 553)
hexRef82D::setRefinement :Points so far:8(378 389 390 379 543 544 555 554)
hexRef82D::setRefinement :Points so far:8(387 398 399 388 552 553 564 563)
hexRef82D::setRefinement :Points so far:8(388 399 400 389 553 554 565 564)

he
hexRef82D::setRefinement : Adding cells (1 per anchorPoint)
hexRef82D::setRefinement : Marking faces to be handled
hexRef82D::setRefinement : Splitting faces
hexRef82D::setRefinement : Splitting faces
Split face2:313 verts:4(354 519 520 355) into quad:4(519 944 912 354)
Split face2:313 verts:4(354 519 520 355) into quad:4(355 912 944 520)
Split face2:315 verts:4(355 520 521 356) into quad:4(520 946 914 355)
Split face2:315 verts:4(355 520 521 356) into quad:4(356 914 946 521)
Split face2:330 verts:4(354 365 530 519) into quad:4(354 913 945 519)
Split face2:330 verts:4(354 365 530 519) into quad:4(530 945 913 365)
Split face2:331 verts:4(364 529 530 365) into quad:4(529 949 917 364)
Split face2:331 verts:4(364 529 530 365) into quad:4(365 917 949 530)
Split face2:332 verts:4(355 366 531 520) into quad:4(355 915 947 520)
Split face2:332 verts:4(355 366 531 520) into quad:4(531 947 915 366)
Split face2:333 verts:4(365 530 531 366) into quad:4(530 951 919 365)
Split face2:333 verts:4(365 530 531 366) into quad:4(366 919 951 531)
Split face2:334 verts:4(356 367 532 521) into quad:4(356 916 948 521)
Split face2:334 verts:4(356 367 532 521) into quad:4(532 948 916 367)
Split face2:335 verts:4(366 531 532 367) into quad:4(531 953 921 366)
Split face2:335 verts:4(366 531 532 367) into quad:4(367 921 953 532)
Split face2:337 verts:4(367 532 533 368) into quad:4(532 955 923 367)
Split face2:337 verts:4(367 532 533 368) into quad:4(368 923 955 533)
Split face2:348 verts:4(364 375 540 529) into quad:4(364 918 950 529)
Split face2:348 verts:4(364 375 540 529) into quad:4(540 950 918 375)
Split face2:350 verts:4(365 376 541 530) into quad:4(365 920 952 530)
Split face2:350 verts:4(365 376 541 530) into quad:4(541 952 920 376)
Split face2:351 verts:4(375 540 541 376) into quad:4(540 958 926 375)
Split face2:351 verts:4(375 540 541 376) into quad:4(376 926 958 541)
Split face2:352 verts:4(366 377 542 531) into quad:4(366 922 954 531)
Split face2:352 verts:4(366 377 542 531) into quad:4(542 954 922 377)
Split face2:353 verts:4(376 541 542 377) into quad:4(541 960 928 376)
Split face2:353 verts:4(376 541 542 377) into quad:4(377 928 960 542)
Split face2:354 verts:4(367 378 543 532) into quad:4(367 924 956 532)
Split face2:354 verts:4(367 378 543 532) into quad:4(543 956 924 378)
Split face2:355 verts:4(377 542 543 378) into quad:4(542 962 930 377)
Split face2:355 verts:4(377 542 543 378) into quad:4(378 930 962 543)
Split face2:356 verts:4(368 379 544 533) into quad:4(368 925 957 533)
Split face2:356 verts:4(368 379 544 533) into quad:4(544 957 925 379)
Split face2:357 verts:4(378 543 544 379) into quad:4(543 964 932 378)
Split face2:357 verts:4(378 543 544 379) into quad:4(379 932 964 544)
Split face2:368 verts:4(375 386 551 540) into quad:4(375 927 959 540)
Split face2:368 verts:4(375 386 551 540) into quad:4(551 959 927 386)
Split face2:370 verts:4(376 387 552 541) into quad:4(376 929 961 541)
Split face2:370 verts:4(376 387 552 541) into quad:4(552 961 929 387)
Split face2:371 verts:4(386 551 552 387) into quad:4(551 967 935 386)
Split face2:371 verts:4(386 551 552 387) into quad:4(387 935 967 552)
Split face2:372 verts:4(377 388 553 542) into quad:4(377 931 963 542)
Split face2:372 verts:4(377 388 553 542) into quad:4(553 963 931 388)
Split face2:373 verts:4(387 552 553 388) into quad:4(552 968 936 387)
Split face2:373 verts:4(387 552 553 388) into quad:4(388 936 968 553)
Split face2:374 verts:4(378 389 554 543) into quad:4(378 933 965 543)
Split face2:374 verts:4(378 389 554 543) into quad:4(554 965 933 389)
Split face2:375 verts:4(388 553 554 389) into quad:4(553 970 938 388)
Split face2:375 verts:4(388 553 554 389) into quad:4(389 938 970 554)
Split face2:376 verts:4(379 390 555 544) into quad:4(379 934 966 544)
Split face2:376 verts:4(379 390 555 544) into quad:4(555 966 934 390)
Split face2:377 verts:4(389 554 555 390) into quad:4(554 972 940 389)
Split face2:377 verts:4(389 554 555 390) into quad:4(390 940 972 555)
Split face2:390 verts:4(387 398 563 552) into quad:4(387 937 969 552)
Split face2:390 verts:4(387 398 563 552) into quad:4(563 969 937 398)
Split face2:392 verts:4(388 399 564 553) into quad:4(388 939 971 553)
Split face2:392 verts:4(388 399 564 553) into quad:4(564 971 939 399)
Split face2:393 verts:4(398 563 564 399) into quad:4(563 974 942 398)
Split face2:393 verts:4(398 563 564 399) into quad:4(399 942 974 564)
Split face2:394 verts:4(389 400 565 554) into quad:4(389 941 973 554)
Split face2:394 verts:4(389 400 565 554) into quad:4(565 973 941 400)
Split face2:395 verts:4(399 564 565 400) into quad:4(564 975 943 399)
Split face2:395 verts:4(399 564 565 400) into quad:4(400 943 975 565)
Split face:1151 verts:4(364 375 376 365) into quad:4(364 918 976 917)
Split face:1151 verts:4(364 375 376 365) into quad:4(375 926 976 918)
Split face:1151 verts:4(364 375 376 365) into quad:4(376 920 976 926)
Split face:1151 verts:4(364 375 376 365) into quad:4(365 917 976 920)
Split face:1152 verts:4(375 386 387 376) into quad:4(375 927 977 926)
Split face:1152 verts:4(375 386 387 376) into quad:4(386 935 977 927)
Split face:1152 verts:4(375 386 387 376) into quad:4(387 929 977 935)
Split face:1152 verts:4(375 386 387 376) into quad:4(376 926 977 929)
Split face:1165 verts:4(354 365 366 355) into quad:4(354 913 978 912)
Split face:1165 verts:4(354 365 366 355) into quad:4(365 919 978 913)
Split face:1165 verts:4(354 365 366 355) into quad:4(366 915 978 919)
Split face:1165 verts:4(354 365 366 355) into quad:4(355 912 978 915)
Split face:1166 verts:4(365 376 377 366) into quad:4(365 920 979 919)
Split face:1166 verts:4(365 376 377 366) into quad:4(376 928 979 920)
Split face:1166 verts:4(365 376 377 366) into quad:4(377 922 979 928)
Split face:1166 verts:4(365 376 377 366) into quad:4(366 919 979 922)
Split face:1167 verts:4(376 387 388 377) into quad:4(376 929 980 928)
Split face:1167 verts:4(376 387 388 377) into quad:4(387 936 980 929)
Split face:1167 verts:4(376 387 388 377) into quad:4(388 931 980 936)
Split face:1167 verts:4(376 387 388 377) into quad:4(377 928 980 931)
Split face:1168 verts:4(387 398 399 388) into quad:4(387 937 981 936)
Split face:1168 verts:4(387 398 399 388) into quad:4(398 942 981 937)
Split face:1168 verts:4(387 398 399 388) into quad:4(399 939 981 942)
Split face:1168 verts:4(387 398 399 388) into quad:4(388 936 981 939)
Split face:1180 verts:4(355 366 367 356) into quad:4(355 915 982 914)
Split face:1180 verts:4(355 366 367 356) into quad:4(366 921 982 915)
Split face:1180 verts:4(355 366 367 356) into quad:4(367 916 982 921)
Split face:1180 verts:4(355 366 367 356) into quad:4(356 914 982 916)
Split face:1181 verts:4(366 377 378 367) into quad:4(366 922 983 921)
Split face:1181 verts:4(366 377 378 367) into quad:4(377 930 983 922)
Split face:1181 verts:4(366 377 378 367) into quad:4(378 924 983 930)
Split face:1181 verts:4(366 377 378 367) into quad:4(367 921 983 924)
Split face:1182 verts:4(377 388 389 378) into quad:4(377 931 984 930)
Split face:1182 verts:4(377 388 389 378) into quad:4(388 938 984 931)
Split face:1182 verts:4(377 388 389 378) into quad:4(389 933 984 938)
Split face:1182 verts:4(377 388 389 378) into quad:4(378 930 984 933)
Split face:1183 verts:4(388 399 400 389) into quad:4(388 939 985 938)
Split face:1183 verts:4(388 399 400 389) into quad:4(399 943 985 939)
Split face:1183 verts:4(388 399 400 389) into quad:4(400 941 985 943)
Split face:1183 verts:4(388 399 400 389) into quad:4(389 938 985 941)
Split face:1196 verts:4(367 378 379 368) into quad:4(367 924 986 923)
Split face:1196 verts:4(367 378 379 368) into quad:4(378 932 986 924)
Split face:1196 verts:4(367 378 379 368) into quad:4(379 925 986 932)
Split face:1196 verts:4(367 378 379 368) into quad:4(368 923 986 925)
Split face:1197 verts:4(378 389 390 379) into quad:4(378 933 987 932)
Split face:1197 verts:4(378 389 390 379) into quad:4(389 940 987 933)
Split face:1197 verts:4(378 389 390 379) into quad:4(390 934 987 940)
Split face:1197 verts:4(378 389 390 379) into quad:4(379 932 987 934)
Split face:1301 verts:4(529 530 541 540) into quad:4(529 949 988 950)
Split face:1301 verts:4(529 530 541 540) into quad:4(530 952 988 949)
Split face:1301 verts:4(529 530 541 540) into quad:4(541 958 988 952)
Split face:1301 verts:4(529 530 541 540) into quad:4(540 950 988 958)
Split face:1302 verts:4(540 541 552 551) into quad:4(540 958 989 959)
Split face:1302 verts:4(540 541 552 551) into quad:4(541 961 989 958)
Split face:1302 verts:4(540 541 552 551) into quad:4(552 967 989 961)
Split face:1302 verts:4(540 541 552 551) into quad:4(551 959 989 967)
Split face:1315 verts:4(519 520 531 530) into quad:4(519 944 990 945)
Split face:1315 verts:4(519 520 531 530) into quad:4(520 947 990 944)
Split face:1315 verts:4(519 520 531 530) into quad:4(531 951 990 947)
Split face:1315 verts:4(519 520 531 530) into quad:4(530 945 990 951)
Split face:1316 verts:4(530 531 542 541) into quad:4(530 951 991 952)
Split face:1316 verts:4(530 531 542 541) into quad:4(531 954 991 951)
Split face:1316 verts:4(530 531 542 541) into quad:4(542 960 991 954)
Split face:1316 verts:4(530 531 542 541) into quad:4(541 952 991 960)
Split face:1317 verts:4(541 542 553 552) into quad:4(541 960 992 961)
Split face:1317 verts:4(541 542 553 552) into quad:4(542 963 992 960)
Split face:1317 verts:4(541 542 553 552) into quad:4(553 968 992 963)
Split face:1317 verts:4(541 542 553 552) into quad:4(552 961 992 968)
Split face:1318 verts:4(552 553 564 563) into quad:4(552 968 993 969)
Split face:1318 verts:4(552 553 564 563) into quad:4(553 971 993 968)
Split face:1318 verts:4(552 553 564 563) into quad:4(564 974 993 971)
Split face:1318 verts:4(552 553 564 563) into quad:4(563 969 993 974)
Split face:1330 verts:4(520 521 532 531) into quad:4(520 946 994 947)
Split face:1330 verts:4(520 521 532 531) into quad:4(521 948 994 946)
Split face:1330 verts:4(520 521 532 531) into quad:4(532 953 994 948)
Split face:1330 verts:4(520 521 532 531) into quad:4(531 947 994 953)
Split face:1331 verts:4(531 532 543 542) into quad:4(531 953 995 954)
Split face:1331 verts:4(531 532 543 542) into quad:4(532 956 995 953)
Split face:1331 verts:4(531 532 543 542) into quad:4(543 962 995 956)
Split face:1331 verts:4(531 532 543 542) into quad:4(542 954 995 962)
Split face:1332 verts:4(542 543 554 553) into quad:4(542 962 996 963)
Split face:1332 verts:4(542 543 554 553) into quad:4(543 965 996 962)
Split face:1332 verts:4(542 543 554 553) into quad:4(554 970 996 965)
Split face:1332 verts:4(542 543 554 553) into quad:4(553 963 996 970)
Split face:1333 verts:4(553 554 565 564) into quad:4(553 970 997 971)
Split face:1333 verts:4(553 554 565 564) into quad:4(554 973 997 970)
Split face:1333 verts:4(553 554 565 564) into quad:4(565 975 997 973)
Split face:1333 verts:4(553 554 565 564) into quad:4(564 971 997 975)
Split face:1346 verts:4(532 533 544 543) into quad:4(532 955 998 956)
Split face:1346 verts:4(532 533 544 543) into quad:4(533 957 998 955)
Split face:1346 verts:4(532 533 544 543) into quad:4(544 964 998 957)
Split face:1346 verts:4(532 533 544 543) into quad:4(543 956 998 964)
Split face:1347 verts:4(543 544 555 554) into quad:4(543 964 999 965)
Split face:1347 verts:4(543 544 555 554) into quad:4(544 966 999 964)
Split face:1347 verts:4(543 544 555 554) into quad:4(555 972 999 966)
Split face:1347 verts:4(543 544 555 554) into quad:4(554 965 999 972)
hexRef82D::setRefinement : Adding edge splits to unsplit faces
hexRef82D::setRefinement : Changing owner/neighbour for otherwise unaffected faces
hexRef82D::setRefinement : Create new internal faces for split cells


dynamicRefineFvMesh2D.C

dynamicRefineFvMesh2D.H

damBreak.zip

hexRef82D.H

hexRef82D.C
I hope that somebody could share his successful implementation of the 2D AMR.

Mahdi

Last edited by mm.abdollahzadeh; December 15, 2016 at 07:54.
mm.abdollahzadeh is offline   Reply With Quote

Old   December 15, 2016, 09:44
Default
  #18
New Member
 
Luca Cornolti
Join Date: Jun 2016
Location: Switzerland
Posts: 6
Rep Power: 3
Luca Cornolti is on a distinguished road
Attached, you can find the code I developed.

From my tests, It seems to work well with 2D meshes.
Anyway, the refining part of the code can be improved.

(the code is developed for foam-extend 3.2, most of it is anyway the same of the standard OpenFOAM version).
Attached Files
File Type: zip 2D_dynamic_mesh_refinement.zip (41.0 KB, 39 views)
OlegSutyrin likes this.

Last edited by Luca Cornolti; December 22, 2016 at 05:04. Reason: Updatings
Luca Cornolti is offline   Reply With Quote

Old   January 30, 2017, 16:50
Default
  #19
Member
 
Oleg Sutyrin
Join Date: Feb 2016
Location: Russia
Posts: 37
Rep Power: 3
OlegSutyrin is on a distinguished road
Here is Luca Cornolti's code adapted for OpenFOAM 4.0. I've made it by line-by-line comparisons:
(original dynamicRefineFvMesh+hexRef8 for foam-extend 3.2) <-> (dynamicRefineFvMesh2D+hexRef2D for foam-extend 3.2) and

(original dynamicRefineFvMesh+hexRef8 for foam-extend 3.2) <-> (original dynamicRefineFvMesh+hexRef8 for OpenFOAM 4.0).

I understood only about 30% of the code, and ran only very basic tests, so cannot guarantee that everything is correct. But it seems to work OK at least in single-process mode. I also added basic support of axisymmetric 2D ("wedge" boundary condition), but cells that are directly adjacent to the symmetry axis would not refine since they are not parallelepipedal.

In OpenFOAM 4.0 code structure is slightly different. Complete installation is as follows (assuming you installed OF4 into '/opt/openfoam4/'):
1. put 'dynamicRefineFvMesh2D' folder into '/opt/openfoam4/src/dynamicFvMesh/' folder;
add 'dynamicRefineFvMesh2D/dynamicRefineFvMesh2D.C' line into '/opt/openfoam4/src/dynamicFvMesh/Make/files';
run 'wmake' command from 'opt/openfoam4/src/dynamicFvMesh/';

2. put 'hexRef2D' folder into 'opt/openfoam4/src/dynamicMesh/polyTopoChange/polyTopoChange/' folder;
add 'polyTopoChange/polyTopoChange/hexRef2D/hexRef2D.C' line into '/opt/openfoam4/src/dynamicMesh/Make/files';
run 'wmake' command from 'opt/openfoam4/src/dynamicMesh/';

Enjoy!
Attached Files
File Type: zip dynamicRefineFvMesh2D_OpenFOAM4.zip (44.0 KB, 47 views)
francescomarra likes this.

Last edited by OlegSutyrin; January 31, 2017 at 04:29.
OlegSutyrin is offline   Reply With Quote

Old   February 28, 2017, 18:26
Default 2D+axisy. codes
  #20
New Member
 
Ahmad
Join Date: Dec 2016
Posts: 1
Rep Power: 0
ahmad12982 is on a distinguished road
2D+axisy. dynamic mesh refinement can be found in the link below.
http://faculty.yu.edu.jo/ahmad_a/Lis.../AllItems.aspx
ahmad12982 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SnappyHexMesh for internal Flow vishwa OpenFOAM Native Meshers: snappyHexMesh and Others 24 June 27, 2016 08:54
[Workbench] mesh refinement of vortex tube using workbench aqsa1590 ANSYS Meshing & Geometry 3 December 25, 2014 09:57
snapEdge - failure Tobi OpenFOAM Native Meshers: snappyHexMesh and Others 33 March 18, 2014 04:58
Mesh motion with Translation & Rotation Doginal CFX 2 January 12, 2014 07:21
Icemcfd 11: Loss of mesh from surface mesh option? Joe CFX 2 March 26, 2007 18:10


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