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

How to delete cells in OF based on CheckMesh?

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

Reply
 
LinkBack Thread Tools Display Modes
Old   September 10, 2009, 03:38
Default How to delete cells in OF based on CheckMesh?
  #1
New Member
 
Anders
Join Date: Sep 2009
Location: Göteborg
Posts: 4
Rep Power: 7
AndTen is on a distinguished road
I have a problem when trying to convert a mesh from starccm to OpenFOAM. The conversion script ccm26ToFoam seems to work fine, but the checkMesh utility is really hard on the mesh that starccm has created. Starccm has probably built-in stuff that deals with this, and the solution is probably good enough since bad cells typically appear in tight corners that will not greatly influence the engineering problem I am looking upon.

Now, the general recommendation is obviously to go back to the mesher and do a better job, but this is a bit tricky to do for each and every case when wrapped surfaces are used for the meshing. I have so far not found any general setting in starccm to remove cells so that the checkMesh error reports disappear (except removing VERY many cells...)

The half-dirty, but in my opinion, good enough solution, would be to let checkMesh identify the problems, and then just delete the cells that are nasty. I have understood that the removeCells utility is primarily working on internal faces (and my problems almost always appear on the surface), so this does not work.

So, has anyone here on the forum figured out how to use the checkMesh utility to remove the entire cells that are connected to the erroneous faces? I would appreciate any help on this!
AndTen is offline   Reply With Quote

Old   September 12, 2009, 10:07
Default Try subsetMesh
  #2
Member
 
Michael Roth
Join Date: Mar 2009
Location: Guelph, Ontario, Canada
Posts: 46
Rep Power: 8
roth is on a distinguished road
Take a look at subsetMesh. If you've got a cellSet called something like badCells, do a cellSet "invert" to point to all the cells not in badCells i.e.goodCells. Then run subSetMesh on goodCells.

Mike
roth is offline   Reply With Quote

Old   September 14, 2009, 01:49
Default
  #3
New Member
 
Anders
Join Date: Sep 2009
Location: Göteborg
Posts: 4
Rep Power: 7
AndTen is on a distinguished road
Thanks Mike,
I suppose you mean that this command should operate on cells, i.e. not faces? What I've got after the checkMesh command in a bunch of face lists. In some way these will need to be converted to cell lists then, and after this use the cellSet command to select these, and after this the subsetMesh?

Anders
AndTen is offline   Reply With Quote

Old   September 14, 2009, 07:18
Default
  #4
Member
 
Michael Roth
Join Date: Mar 2009
Location: Guelph, Ontario, Canada
Posts: 46
Rep Power: 8
roth is on a distinguished road
Right. You can run cellSet on a faceSet of nasty faces to get your nasty cells.

Mike
roth is offline   Reply With Quote

Old   September 14, 2009, 07:22
Default
  #5
New Member
 
Anders
Join Date: Sep 2009
Location: Göteborg
Posts: 4
Rep Power: 7
AndTen is on a distinguished road
Have you got an example of how to use this faceSet and cellSet command?
AndTen is offline   Reply With Quote

Old   September 14, 2009, 07:47
Default
  #6
Member
 
Michael Roth
Join Date: Mar 2009
Location: Guelph, Ontario, Canada
Posts: 46
Rep Power: 8
roth is on a distinguished road
One nice example is in a tutorial:
Code:
OpenFOAM/OpenFOAM-1.5.x/tutorials/interDyMFoam/damBreakWithObstacle
Check the Allrun script which uses setSet which calls a batch file with set commands. This one creates a cellSet of zero cells, inverts it to points to all the cells, and then deletes cells from the cellSet that are in a given box region. It then runs subsetMesh.

Very close to what you want.

Another source is to look at the source codes for faceSet & cellSet which have dictionary files. Take a look at cellSetDict.

Code:
OpenFOAM/OpenFOAM-1.5.x/applications/utilities/mesh/manipulation/cellSet
And in particular, look at the operator "faceToCell".

Mike
roth is offline   Reply With Quote

Old   September 14, 2009, 15:36
Default
  #7
Senior Member
 
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 271
Rep Power: 9
phsieh2005 is on a distinguished road
Hi, Mike,

I have a similar question and will highly appreciated if you can shed some light on this.

I created a cellSet using setSet based on boxToCells. There are some external face cells (BC in boundary) that are parts of these cellSet. I would like to detelet this cells from the domain. OK, I can invert this cellSet to a get a new cellSet that contains all the cells I want. But, I read the description of subsetMesh, it does not preserve attached boundary types. Does it mean that I will no longer have the boundary faces in the constant/polyMesh/boundary?

Is there a simple to simply delelte cells (and the assoicated points and faces) from the domain?

Pei
phsieh2005 is offline   Reply With Quote

Old   September 15, 2009, 12:02
Default
  #8
Senior Member
 
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 271
Rep Power: 9
phsieh2005 is on a distinguished road
Hi,

It turned out that I was wrong about subsetMesh. It does keep the original boundary patches in tact.

pei
phsieh2005 is offline   Reply With Quote

Old   September 23, 2009, 03:11
Default
  #9
New Member
 
bigred's Avatar
 
Matthew Philpott
Join Date: Aug 2009
Location: Belgium
Posts: 24
Rep Power: 7
bigred is on a distinguished road
I'm having a similar problem. I get a few sets of bad faces (zeroFaces, non-orthofaces, etc). To get rid of them can I just use:
setSet
faceSet zeroFaces delete

or must I use:

setSet
faceSet zeroFaces invert
subsetMesh

or do I have to turn the face set into a cell set (faceToCell?) and then use one of the steps above, but with cellSet? Does cellSet and FaceSet have to work in conjunction with their dictionaries?

None of these utilities have very useful help files, except perhaps setSet. Am I correct to get the help file of a utility to type the util followed by -help, e.g.
cellSet -help
when i do this all i get is a one line usage guide with the parameter possiblities ie. [-batch] [-help] etc.

So many questions! I'm confused. It seems simple enough, but I'm not getting any results.
__________________
CAELinux 2009 + OF1.5
Ubuntu 9.04 x64 (jaunty jackalope) + OF1.6
bigred is offline   Reply With Quote

Old   March 22, 2011, 09:41
Default
  #10
New Member
 
Join Date: Mar 2011
Posts: 6
Rep Power: 6
sakro is on a distinguished road
Hi,

I have the same problem and the same question as bigred in a previous post. right now about the removing bad cells from the mesh, and I'm stacked how to do that. Would be very thankful for your help
sakro is offline   Reply With Quote

Old   March 22, 2011, 18:34
Default
  #11
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,258
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings sakro and welcome to the forum!

Here is the best example I know for removing the faces/cells reported by checkMesh: http://openfoamwiki.net/index.php/SetSet

Best regards and good luck!
Bruno
wyldckat is offline   Reply With Quote

Old   March 23, 2011, 09:56
Default
  #12
New Member
 
Join Date: Mar 2011
Posts: 6
Rep Power: 6
sakro is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Greetings sakro and welcome to the forum!

Here is the best example I know for removing the faces/cells reported by checkMesh: http://openfoamwiki.net/index.php/SetSet

Best regards and good luck!
Bruno
Hello Bruno and thank you very much!
this link is very helpful. I did it yesterday and it worked, at least I could get rid of bad cells.
But then came another problem: subsetMesh created a new boundary (from the deleted cells) with the type 'empty', that is obviously inappropriate. I changed it to symmetryPlane (I also tried wall)
but anyway I've lost the convergence with simpleFoam =(
sakro is offline   Reply With Quote

Old   March 23, 2011, 18:21
Default
  #13
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,258
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi sakro,

Sadly my experience in this subject is very limited, but here are a few threads that might guide you in the right direction:
The last few links are related to autoRefineMesh, because I have a personal untested theory that refining the mesh in damaged areas could fix things... but the general principle seems to be to "simply re-generate the mesh properly, after checking the original geometry at the damaged areas" instead of simply removing damaged cells... Or perhaps, generate a more coarse mesh in the problem areas, then refine the mesh using the methods described with autoRefineMesh...

Best regards and good luck!
Bruno
wyldckat is offline   Reply With Quote

Old   June 24, 2015, 04:09
Default
  #14
Member
 
Join Date: Mar 2015
Posts: 86
Rep Power: 2
KateEisenhower is on a distinguished road
Quote:
Originally Posted by sakro View Post
Hello Bruno and thank you very much!
this link is very helpful. I did it yesterday and it worked, at least I could get rid of bad cells.
But then came another problem: subsetMesh created a new boundary (from the deleted cells) with the type 'empty', that is obviously inappropriate. I changed it to symmetryPlane (I also tried wall)
but anyway I've lost the convergence with simpleFoam =(
Hello sakro,

do you remember if you passed the checkMesh with your changed boundary types? How did you solve this problem?

Best regards,

Kate
KateEisenhower is online now   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
Import netgen mesh to OpenFOAM hsieh Open Source Meshers: Gmsh, Netgen, CGNS, ... 32 September 13, 2011 05:50
How to delete selected cells from mesh and update boundary patches kaka OpenFOAM Mesh Utilities 2 November 26, 2009 05:17
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 12:55
physical boundary error!! kris CD-adapco 2 August 3, 2005 00:32
Delete cells in fluent Christian FLUENT 1 December 5, 2003 13:04


All times are GMT -4. The time now is 09:45.