CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Pre-Processing

Simple manual cell deleting question

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

Reply
 
LinkBack Thread Tools Display Modes
Old   June 15, 2012, 12:10
Default Simple manual cell deleting question
  #1
New Member
 
James Simpson
Join Date: Jun 2012
Posts: 10
Rep Power: 5
jasimpson89 is on a distinguished road
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 stair-stepped 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
jasimpson89 is offline   Reply With Quote

Old   June 16, 2012, 07:26
Default
  #2
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,312
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
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:
Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   June 18, 2012, 06:36
Default
  #3
New Member
 
James Simpson
Join Date: Jun 2012
Posts: 10
Rep Power: 5
jasimpson89 is on a distinguished road
thanks very much Bruno, I'll give that a go! see what I can do.

Thanks again

James
jasimpson89 is offline   Reply With Quote

Old   June 18, 2012, 13:14
Default
  #4
New Member
 
James Simpson
Join Date: Jun 2012
Posts: 10
Rep Power: 5
jasimpson89 is on a distinguished road
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
jasimpson89 is offline   Reply With Quote

Old   June 18, 2012, 15:54
Default
  #5
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,312
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
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
wyldckat is offline   Reply With Quote

Old   June 19, 2012, 08:52
Default
  #6
New Member
 
James Simpson
Join Date: Jun 2012
Posts: 10
Rep Power: 5
jasimpson89 is on a distinguished road
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
jasimpson89 is offline   Reply With Quote

Old   June 19, 2012, 14:34
Default
  #7
New Member
 
James Simpson
Join Date: Jun 2012
Posts: 10
Rep Power: 5
jasimpson89 is on a distinguished road
I am basically having an issue with having trying to setup a set which include my current cells and faces
jasimpson89 is offline   Reply With Quote

Old   June 19, 2012, 17:02
Default
  #8
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,312
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi James,

The idea is simple:
  1. Generate a mesh. Make sure you have all of the cells you need, including those you want to remove.
  2. Use setSet to create a cell set with the selection of the cells to be removed.
  3. Then invert the selection on that set, to select all of the other cells.
  4. Quit setSet.
  5. Run subsetMesh to extract the selected cell set.
The wiki page is using checkMesh as an example for using already existing cell and face sets. For other possibilities of selection, use the command help in setSet's command line.


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
wyldckat is offline   Reply With Quote

Old   June 20, 2012, 09:15
Default
  #9
New Member
 
James Simpson
Join Date: Jun 2012
Posts: 10
Rep Power: 5
jasimpson89 is on a distinguished road
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
This doesn't seem to work either but the logic should be the same should it not? It's just this way would be much easier for me to implement as a the method of extraction.

Apologies for all the questions, but I can't exactly seem what I am doing wrong

Many thanks


James
jasimpson89 is offline   Reply With Quote

Old   June 20, 2012, 11:20
Default
  #10
New Member
 
James Simpson
Join Date: Jun 2012
Posts: 10
Rep Power: 5
jasimpson89 is on a distinguished road
Hi Bruno managed to figure it out.

Thanks again for all your time, it has been most helpful
jasimpson89 is offline   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
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


All times are GMT -4. The time now is 11:37.