|
[Sponsors] |
[Technical] Dynamic mesh RefinementCoarsening at runtime |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 19, 2007, 05:21 |
Dynamic mesh RefinementCoarsening at runtime
|
#1 |
New Member
Sergio Ferraris
Join Date: Mar 2009
Posts: 17
Rep Power: 17 |
Hi everybody,
After a while I am trying to get back to the refinement/coarsening of dynamical mesh and resumed my crusade for refinement/coarsen. So far, I have the refinement bit working well by an scalar. Now, the coarsening is not working. I am using all the proper classes (Modifiers, etc). At the end I could isolate the problem to this for coarsening: undoableMeshCutter::removeSplitFaces, which uses the class removeFaces. This is done inside the errorDrivenRefinement class and evaluateError class. I can not find any example for removeSplitFaces or removeFaces in the tutorials and/or applications I use the cavity example and the error appears when coarsening happens: --> FOAM FATAL ERROR : Face 589contains vertex labels out of range: 4(-1 105 1 1143 -1) Max point index = 1250 From function polyMesh::polyMesh::resetPrimitives ( const label nUsedFaces, const pointField& points, const faceList& faces, const labelList& owner, const labelList& neighbour, const labelList& patchSizes, const labelList& patchStarts ) in file meshes/polyMesh/polyMesh.C at line 464. It looks as -1 is not proper vertex numbering. I am pretty sure it has to do with removeSplitFaces. Do you have any example for coarsening mesh?. I will open a threat on the forum for more help. Other tip, In ErrorDrivenRefinement I found this and commented for not repacking. ( as a test) It turns out to work OK for refinement/coarsening till a given point where the problem of vertex labelling appears as before (This code was sent by you months ago) // Repack list of cells to refine. List<refinecell> refCells = refPattern.refCells(); label newRefCellI = 0; forAll(refCells, refCellI) { label cellI = refCells[refCellI].cellNo(); //Sergio commented // if (!markedCell[cellI] && (newRefCellI != refCellI)) // { refCells[newRefCellI++] = refCells[refCellI]; // } } Anyway, I have the problem of vertex labels equal -1 after nine iterations with refinement/coarsening. Here it is removing faces but then stops with the same error. Then, I saw this in: void Foam::undoableMeshCutter::updateMesh(const mapPolyMesh& morphMap) { // Update mesh cutter for new labels. meshCutter::updateMesh(morphMap); // No need to update cell walker for new labels since does not store any. // Update faceRemover for new labels faceRemover_.updateMesh(morphMap); if (undoable_) { // Update all live split cells for mesh mapper. updateLabels(morphMap.reverseCellMap(), liveSplitCells_); } } faceRemover_.updateMesh(morphMap) is not implemented and the error I sent you before is related to labelling. Do you think this might be the cause. Honestly, I think this is out of my reach to solve as the internal structure of the mesh and its refinement is a kind of misttery for the end-user even when I tried for a long time. :-) I know it is topic of interest for many users I am willing to produce a tutorial and the code so far implemented by me. Thanks. Regards Sergio |
|
November 6, 2012, 11:09 |
|
#2 |
Senior Member
mahdi abdollahzadeh
Join Date: Mar 2011
Location: Covilha,Portugal
Posts: 153
Rep Power: 15 |
Hi Sergio
I want to implement of a Automatic refinement in my code. I want to have also a 2D AMR. So far I have tried the multidirrefinment and then mapping the data by meshtomeshinterpolation. but there is problem that meshtomeshinterpolation is not working for surface fields . I have tried the updateMesh(Map) instead of meshtomeshinterpolation. but it does not work also . now i am checking the errordrivenrefinment. But as I a beginner in openfoam I dont understand how to use it. could you share asimple case runned with errordrivenrefinment? or the steps to use it? I will be grateful to have your help. Best Mahdi |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Local mesh refinement definition in a DEFORMING dynamic mesh zone using Dynamic Mesh | Emanuele88 | FLUENT | 0 | February 9, 2016 11:39 |
Creating a new field from terms of the turbulence model | HaZe | OpenFOAM Programming & Development | 15 | November 24, 2014 13:51 |
Dynamic Mesh "Shadow Wall" | thezack | FLUENT | 0 | June 4, 2013 22:09 |
dynamic mesh for drop interface | IndrajitW | FLUENT | 0 | March 30, 2013 08:03 |
dynamic mesh refinement and rhoCentralFoam | ChrisA | OpenFOAM Running, Solving & CFD | 1 | March 21, 2013 08:00 |