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

[Other] How to delete cells in OF based on CheckMesh?

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By wyldckat
  • 1 Post By wyldckat

Reply
 
LinkBack Thread Tools Search this Thread 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: 16
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: 50
Rep Power: 17
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: 16
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: 50
Rep Power: 17
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: 16
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: 50
Rep Power: 17
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: 334
Rep Power: 18
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: 334
Rep Power: 18
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: 16
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, 08:41
Default
  #10
New Member
 
Join Date: Mar 2011
Posts: 6
Rep Power: 15
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, 17:34
Default
  #11
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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
Gerhard likes this.
__________________
wyldckat is offline   Reply With Quote

Old   March 23, 2011, 08:56
Default
  #12
New Member
 
Join Date: Mar 2011
Posts: 6
Rep Power: 15
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, 17:21
Default
  #13
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
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
mactone likes this.
__________________
wyldckat is offline   Reply With Quote

Old   June 24, 2015, 04:09
Default
  #14
Senior Member
 
Join Date: Mar 2015
Posts: 250
Rep Power: 12
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 offline   Reply With Quote

Old   July 27, 2018, 06:05
Default
  #15
New Member
 
Join Date: Jan 2018
Posts: 12
Rep Power: 8
Anouk is on a distinguished road
Dear FOAMers,

I was wondering whether it is possible to remove volume cells from a mesh without removing the attached faces? I am generating a mesh in gmsh and in order to have faces for all patches I need to define a physical volume for some parts of the mesh where I actually don't need a volume... So I was trying to find a way to remove the unwanted volume cells. Tried using setSet invert, but then the faces attached to the volume will also be removed..
Anouk is offline   Reply With Quote

Old   July 27, 2018, 06:13
Default
  #16
New Member
 
Join Date: Jan 2018
Posts: 12
Rep Power: 8
Anouk is on a distinguished road
I also used subsetMesh after invertion
Anouk 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
[snappyHexMesh] SnappyHexMesh for internal Flow vishwa OpenFOAM Meshing & Mesh Conversion 24 June 27, 2016 08:54
[snappyHexMesh] No layers in a small gap bobburnquist OpenFOAM Meshing & Mesh Conversion 6 August 26, 2015 09:38
checkMesh Ok but bad cells still present Hiroshiman OpenFOAM 4 August 14, 2013 11:40
[Commercial meshers] failed checkMesh after converting from .msh: non closed cells phsieh2005 OpenFOAM Meshing & Mesh Conversion 11 September 20, 2012 08:51
[mesh manipulation] How to delete selected cells from mesh and update boundary patches kaka OpenFOAM Meshing & Mesh Conversion 2 November 26, 2009 04:17


All times are GMT -4. The time now is 12:14.