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

[Technical] Dynamic mesh RefinementCoarsening at runtime

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By sergio

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 19, 2007, 05:21
Default Dynamic mesh RefinementCoarsening at runtime
  #1
New Member
 
Sergio Ferraris
Join Date: Mar 2009
Posts: 17
Rep Power: 17
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
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
hua1015 likes this.
sergio is offline   Reply With Quote

Old   November 6, 2012, 11:09
Default
  #2
Senior Member
 
mahdi abdollahzadeh
Join Date: Mar 2011
Location: Covilha,Portugal
Posts: 153
Rep Power: 15
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.

Best
Mahdi
mm.abdollahzadeh is offline   Reply With Quote

Reply


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


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


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