|
[Sponsors] |
icoDyMFoam - sclar transport with adaptive mesh refinement |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 28, 2011, 19:41 |
icoDyMFoam - sclar transport with adaptive mesh refinement
|
#1 |
Senior Member
|
Please check http://openfoamwiki.net/index.php/Contrib_icoDyMFoam,
here I submitted a small example (todays between-coffees-made solver) how to use dynamicRefineFvMesh class in generic applications. Thanks to developers for such hard work) Your years of designing - our "one click" lines in solver))) Thanks once more!
__________________
Best regards, Dr. Alexander VAKHRUSHEV Christian Doppler Laboratory for "Metallurgical Applications of Magnetohydrodynamics" Simulation and Modelling of Metallurgical Processes Department of Metallurgy University of Leoben http://smmp.unileoben.ac.at |
|
July 3, 2011, 16:21 |
|
#2 |
New Member
Join Date: May 2011
Posts: 2
Rep Power: 0 |
Hi makaveli_lcf,
hi foamers, based on your example and Anne Kösters example I try to build a solver using the residuum to refine the mesh... but I can't get it running Thanks, FlinkFingerFlo. |
|
July 17, 2013, 16:05 |
|
#3 |
Member
Haomin Yuan
Join Date: Jan 2012
Location: Madison, Wisconsin, USA
Posts: 59
Rep Power: 14 |
Hi,
I read your solver code, it seems that after mesh.update, you directly goes into U equation and p equation. I also tried this on my solver for steady state. There is error information like this : --> FOAM FATAL ERROR: field does not correspond to level 0 sizes: field = 115185 level = 112000 I looked into the mesh, it seems mesh.update refined the mesh, but when it goes to solve equations, there is an inconsistent. Do you think if there is any additional setting I should do?~ thank you. |
|
July 17, 2013, 19:25 |
|
#4 |
Senior Member
|
there already some standard solvers in OF 2.2.1, please check them, they are more consistent than mine)))
__________________
Best regards, Dr. Alexander VAKHRUSHEV Christian Doppler Laboratory for "Metallurgical Applications of Magnetohydrodynamics" Simulation and Modelling of Metallurgical Processes Department of Metallurgy University of Leoben http://smmp.unileoben.ac.at |
|
July 17, 2013, 22:28 |
|
#5 |
Member
Haomin Yuan
Join Date: Jan 2012
Location: Madison, Wisconsin, USA
Posts: 59
Rep Power: 14 |
Hi, Alex
I think I found out the problem, I should "cacheAgglomeration off;" in fvSolutions file. But I met a another problem, when it dynamic refine the mesh, it always produce some triangle cells. This also happens in your example case. I have seen some papers talking about adaptive mesh refinement in OpenFOAM, they can make every cell hexagon. Do you know how to do that in settings? thank you in advance~ |
|
July 18, 2013, 03:25 |
|
#6 |
Senior Member
|
Hi,
first you are totally right about aglomeration caching: 1. it should be switched off when doing dynamic refinement 2. no triangles are produced! it is just a postprocessing issue in paraview. Switch on "Use VTKPolyhedron" in Object Inspector. It is because your refined hex becomes a polyhedron, despite it looks still like a hex)))) In paraview it is splitted into pyramids giving you triangles. Please check here https://sites.google.com/site/smmp01...r-a-vakhrushev in Galery my first animation, it is done "properly"))) 3. There was some issues (I think I was using OF 1.7) with tet cells: poly cells were excluded from refinement, but tet cells were not! I just patch dynamicRefine lib a little bit to avoid that, bevcause by engeneering geometries has sometimes tet cells... But all in all dynamic refinement is doing actually pure hex refinement Cheers, Alex
__________________
Best regards, Dr. Alexander VAKHRUSHEV Christian Doppler Laboratory for "Metallurgical Applications of Magnetohydrodynamics" Simulation and Modelling of Metallurgical Processes Department of Metallurgy University of Leoben http://smmp.unileoben.ac.at Last edited by makaveli_lcf; July 18, 2013 at 03:28. Reason: typo |
|
July 18, 2013, 11:24 |
|
#7 |
Member
Haomin Yuan
Join Date: Jan 2012
Location: Madison, Wisconsin, USA
Posts: 59
Rep Power: 14 |
Hi, Alex,
thank you for your reply. I think you are right, OpenFOAM did not split those cells. It is just problem of paraview. But I have another question, in my research there is some pentahedral cells. Because I am simulating a axisymmetric geometry. Is there a way to tell OpenFOAM to just refine those hexagon cells, and ignore those pentahedral cells? thank you. |
|
July 18, 2013, 11:34 |
|
#8 |
Senior Member
|
I think it is already there... It is refining hex only... Look at the dynamicRefineFvMesh.C:
Code:
00951 // Set cells that should not be refined. 00952 // This is currently any cell which does not have 8 anchor points or 00953 // uses any face which does not have 4 anchor points. 00954 // Note: do not use cellPoint addressing 00955 00956 // Count number of points <= cellLevel 00957 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 00958 00959 labelList nAnchors(nCells(), 0); 00960 00961 label nProtected = 0; 00962 00963 forAll(pointCells(), pointI) 00964 { 00965 const labelList& pCells = pointCells()[pointI]; 00966 00967 forAll(pCells, i) 00968 { 00969 label cellI = pCells[i]; 00970 00971 if (!protectedCell_.get(cellI)) 00972 { 00973 if (pointLevel[pointI] <= cellLevel[cellI]) 00974 { 00975 nAnchors[cellI]++; 00976 00977 if (nAnchors[cellI] > 8) 00978 { 00979 protectedCell_.set(cellI, 1); 00980 nProtected++; 00981 } 00982 } 00983 } 00984 } 00985 } 00986
__________________
Best regards, Dr. Alexander VAKHRUSHEV Christian Doppler Laboratory for "Metallurgical Applications of Magnetohydrodynamics" Simulation and Modelling of Metallurgical Processes Department of Metallurgy University of Leoben http://smmp.unileoben.ac.at |
|
July 18, 2013, 11:49 |
|
#9 | |
Member
Haomin Yuan
Join Date: Jan 2012
Location: Madison, Wisconsin, USA
Posts: 59
Rep Power: 14 |
Yes, you are right, it checked whether the anchor points of this cell. But it only protected the cell whose anchor point number is larger than 8. It will not protect those cells with less than 8 anchor points.
For my case, there are pentahedral cells. The error message is this: Quote:
if (nAnchors[cellI] > 8) to if( (nAnchors[cellI] > 8)||(nAnchors[cellI] < 8)) to make sure it only refine those hexagon cells. |
||
July 18, 2013, 11:50 |
|
#10 |
Senior Member
|
Yep! Right direction! Just build a new library for dynamicMeshRefine
__________________
Best regards, Dr. Alexander VAKHRUSHEV Christian Doppler Laboratory for "Metallurgical Applications of Magnetohydrodynamics" Simulation and Modelling of Metallurgical Processes Department of Metallurgy University of Leoben http://smmp.unileoben.ac.at |
|
July 18, 2013, 11:51 |
|
#11 |
Senior Member
|
For tet it didn't work as well, so I modified that condition
__________________
Best regards, Dr. Alexander VAKHRUSHEV Christian Doppler Laboratory for "Metallurgical Applications of Magnetohydrodynamics" Simulation and Modelling of Metallurgical Processes Department of Metallurgy University of Leoben http://smmp.unileoben.ac.at |
|
July 18, 2013, 11:53 |
|
#12 |
Member
Haomin Yuan
Join Date: Jan 2012
Location: Madison, Wisconsin, USA
Posts: 59
Rep Power: 14 |
I will try this.
Thank you very much~ |
|
July 18, 2013, 16:21 |
|
#13 | |
Member
Haomin Yuan
Join Date: Jan 2012
Location: Madison, Wisconsin, USA
Posts: 59
Rep Power: 14 |
Hey,
I think I have figured out how to do that, I will post my code here if other people are interested. We have to judge whether this cell is hex or not. But we cannot just change "if (nAnchors[cellI] > 8)" to "if( (nAnchors[cellI] > 8)||(nAnchors[cellI] < 8))" because the anchor number of this cell (nAnchors) is not completely calculated after this whole loop. So we have make a judgement after this loop. Quote:
I hope this will be useful to somebody. |
||
July 19, 2013, 12:38 |
|
#14 |
Senior Member
|
Great job, this issue was also there, I can remember!
__________________
Best regards, Dr. Alexander VAKHRUSHEV Christian Doppler Laboratory for "Metallurgical Applications of Magnetohydrodynamics" Simulation and Modelling of Metallurgical Processes Department of Metallurgy University of Leoben http://smmp.unileoben.ac.at |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
adaptive meshing | clifford bradford | Main CFD Forum | 14 | September 3, 2022 20:13 |
Moving mesh | Niklas Wikstrom (Wikstrom) | OpenFOAM Running, Solving & CFD | 122 | June 15, 2014 07:20 |
Problems scaling down the mesh of a stirred tank (GGI, icoDyMFoam) | Tobb | OpenFOAM | 2 | February 7, 2013 14:06 |
Searching criteria for adaptive mesh refinement | Flowee | ANSYS Meshing & Geometry | 1 | August 6, 2010 13:43 |