CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM Meshing Format & General Technical

Dynamic mesh RefinementCoarsening at runtime

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

Like Tree1Likes
  • 1 Post By sergio

LinkBack Thread Tools Display Modes
Old   November 19, 2007, 06:21
Default Hi everybody, After a whil
New Member
Sergio Ferraris
Join Date: Mar 2009
Posts: 17
Rep Power: 10
sergio is on a distinguished road
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
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.


I saw this in:
void Foam::undoableMeshCutter::updateMesh(const mapPolyMesh& morphMap)
// Update mesh cutter for new labels.

// No need to update cell walker for new labels since does not store any.

// Update faceRemover for new labels

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.



hua1015 likes this.
sergio is offline   Reply With Quote

Old   November 6, 2012, 12:09
Senior Member
mahdi abdollahzadeh
Join Date: Mar 2011
Location: Covilha,Portugal
Posts: 151
Rep Power: 8
mm.abdollahzadeh is on a distinguished road
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.

mm.abdollahzadeh is offline   Reply With Quote


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
CFX Runtime Priority Karsten CFX 0 April 26, 2006 04:33
dynamic mesh - structured or cooper mesh Manoj Kumar FLUENT 2 November 11, 2005 02:18
dynamic mesh and sliding mesh nasser FLUENT 0 November 1, 2005 03:37
Typical runtime for simulation with mesh movement? quarkz Main CFD Forum 1 August 22, 2005 07:13
Fortran Runtime Dadou Siemens 0 April 1, 2004 07:02

All times are GMT -4. The time now is 03:40.