
[Sponsors] 
June 15, 2012, 12:10 
Simple manual cell deleting question

#1 
New Member
James Simpson
Join Date: Jun 2012
Posts: 10
Rep Power: 5 
Hi, I am very new to CFD and the use of open foam.
I would like to be able to create a hex mesh over the whole bounding box of a geometry using blockMesh and then to go and remove all cells the lie outside the geometry.* The reason being is that I have a complex geometry that is difficult to block and can live with the CFD geometry being a stairstepped approximation of the real geometry.* I want to automate the process so don't want to rely on a 3rd party mesher or snappyHexMesh * Has anyone done something similar?* Currently I am using a very simple geometry of one block and a 3x1x1 cell configuration just to see a method of how I could automate this. So I have 3 cells adjacent to each other (012). What I am trying to do is delete cell 1 the middle cell of this system. The procedure I am following is: 1. Editing the boundary file, subtracting off 2 faces because I have removed four faces but two of the internal faces have no become boundary faces. And setting the start to 0 (no more internal faces) 2. Editing the faces file to reflect the changed I have made of deleting the faces 3. Setting the neighbour file 0( ) as we have no neighbours now? 4. Deleting the in the owners file the owner associated with the faces I have deleted. After all this is done when I open this in paraFoam, the internal mesh I am given is just weird it doesn't seem to reflect the changes I have made, Sometimes faces are missing and point join up in weird ways making weird and wonderful shapes. Two things to note are: 1. All these changes are made after the command blockMesh is ran 2. I ran checkMesh on my edited geometry and obviously it crashed. However I did notice that it was expecting there to be 9 cells present, but I want 8 because I am trying to delete one. One would assume that paraFoam would be expecting 9 and not 8 so hence my weird shapes. But I don't know what file to edit to change the number of cells in my geometry. Does anyone know? or does checkMesh work it out from your blockMeshDict? Apologies if anything I have mentioned is confusing I would be more than happy to clarify any of the points I have made. Thanks in advance James 

June 16, 2012, 07:26 

#2 
Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 9,523
Blog Entries: 36
Rep Power: 97 
Greetings James and welcome to the forum!
I started to read you post and didn't finish reading it, sorry ... so basically I'll answer only the first couples of questions:
Bruno
__________________
I'll be at OFW11 in Portugal 

June 18, 2012, 06:36 

#3 
New Member
James Simpson
Join Date: Jun 2012
Posts: 10
Rep Power: 5 
thanks very much Bruno, I'll give that a go! see what I can do.
Thanks again James 

June 18, 2012, 13:14 

#4 
New Member
James Simpson
Join Date: Jun 2012
Posts: 10
Rep Power: 5 
Thanks for linking me to those posts Bruno but, some of them talk about inverting selection, what does this mean? and how do I do it?
thanks in advance James 

June 18, 2012, 15:54 

#5 
Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 9,523
Blog Entries: 36
Rep Power: 97 
Hi James,
I forgot about another link that might help explain this a bit better: MRFSimpleFoam: what's the point of running setSets…? post #5 Keep reading the thread from that point onward and hopefully your questions will be answered Best regards, Bruno
__________________
I'll be at OFW11 in Portugal 

June 19, 2012, 08:52 

#6 
New Member
James Simpson
Join Date: Jun 2012
Posts: 10
Rep Power: 5 
Hi Burno,
I have read through the links I am still at a little loss at what to do. Here is what I think I should do. I am working in a simple geometry of one block divided into 2 cells (adjacent to each other). I think I should do the following to the remove a cell: 1. create a set which includes one of the cells (I am not entirely sure how to do this) 2. Invert the new cell set 3 subSet the new set 4. subsetMesh the new set to remove the cell I am thinking of the correct method to do this? Or can you only use setSet after checkMesh has flagged up any errors in the mesh? Many thanks James 

June 19, 2012, 14:34 

#7 
New Member
James Simpson
Join Date: Jun 2012
Posts: 10
Rep Power: 5 
I am basically having an issue with having trying to setup a set which include my current cells and faces


June 19, 2012, 17:02 

#8 
Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 9,523
Blog Entries: 36
Rep Power: 97 
Hi James,
The idea is simple:
If you're not understanding how to use setSet, you can also try topoSet, which is in essence the same thing, but using a dictionary! Check the links I posted before, where I explained how to find out more about each application... or more specifically, how to search for "*Dict" files, which in topoSet's case is "topoSetDict". Best regards, Bruno
__________________
I'll be at OFW11 in Portugal 

June 20, 2012, 09:15 

#9 
New Member
James Simpson
Join Date: Jun 2012
Posts: 10
Rep Power: 5 
Hi Burno,
Thanks for all your help so far. I was being a spanner and not being able to figure out step 2. However this is what I have tried and setSet seems to work ok but it doesn't remove a cell for me: Code:
faceSet f0 new patchToFace faces // (this made me and empty faceSet object I think) faceSet f0 add labelToFace (0 2 4 6 8 10) // (add the faces which define the cell to be removed) cellSet c0 new faceToCell f0 any cellSet c0 invert cellSet c0 subset then quit and run subsetMesh c0 This doesn't actually seem to do anything and I am not sure where entirely I am going wrong. One thing I am worried about is that my bounding box min or max coordinates seem to be the same, but I don't know why. Also if I know the index of the cell I want to remove could I not just do the following: Code:
cellSet c0 new labelToCell (1) cellSet c0 invert cellSet c0 subset quit subsetMesh c0 Apologies for all the questions, but I can't exactly seem what I am doing wrong Many thanks James 

June 20, 2012, 11:20 

#10 
New Member
James Simpson
Join Date: Jun 2012
Posts: 10
Rep Power: 5 
Hi Bruno managed to figure it out.
Thanks again for all your time, it has been most helpful 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Simple Question Regarding Symmetry Planes  Atella  CFX  3  April 11, 2010 06:44 
Simple Question Regarding Symmetry Planes  Atella  Main CFD Forum  0  April 9, 2010 10:58 
Question of Anil Date's SIMPLE method  universez  Main CFD Forum  0  November 18, 2009 21:12 
question on UDF manual example  ak6g08  FLUENT  0  June 25, 2009 11:58 
A Simple Question  Thomas P. Abraham  Main CFD Forum  3  September 6, 1999 18:19 