How to delete cells in OF based on CheckMesh?
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! |
Try subsetMesh
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 |
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 |
Right. You can run cellSet on a faceSet of nasty faces to get your nasty cells.
Mike |
Have you got an example of how to use this faceSet and cellSet command?
|
One nice example is in a tutorial:
Code:
OpenFOAM/OpenFOAM-1.5.x/tutorials/interDyMFoam/damBreakWithObstacle 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 Mike |
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 |
Hi,
It turned out that I was wrong about subsetMesh. It does keep the original boundary patches in tact. pei |
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. |
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 |
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 |
Quote:
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 =( |
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:
Best regards and good luck! Bruno |
Quote:
do you remember if you passed the checkMesh with your changed boundary types? How did you solve this problem? Best regards, Kate |
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.. |
I also used subsetMesh after invertion ;)
|
All times are GMT -4. The time now is 13:08. |