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

Possible to select Cells next to a SPHERE surface?

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

Reply
 
LinkBack Thread Tools Display Modes
Old   November 26, 2016, 13:12
Default Possible to select Cells next to a SPHERE surface?
  #1
Member
 
David Long
Join Date: May 2012
Location: Germany
Posts: 69
Rep Power: 7
keepfit is on a distinguished road
Sponsored Links
Hi Foamers,

Is it possible to use script over OpenFOAM to select specific cells to generate a new CellSet for use of mesh refinment? Since the topoSet tool does not have this type of source.

As shown below, I want to refine the mesh around a sphere surface given the center O (x, y, z) and radius R. Note that inside this "sphere", cells do exist, i.e. the entire fluid domain is filled with uniform mesh via blockMesh.

The reason why I want to do this, is because I want to test the Fictitous Domain Method (or Immersed boundary method) to calculate
the drag over a solid 3D sphere. Inside this "sphere", U is treated as the velocity of solid sphere (Zero in this case) over time via rigid constrain.



I know I can use snappyHexMesh to refine cells inside a sphere with a STL mesh file:

Code:
limitRegions 
{ 
  sphere3D.stl  // O (x, y, z), rad = R
  { 
    mode     inside; 
    levels     ((1e10 4)); 
  } 
}
However, since the cells next to the sphere surface need to be very fine, and if we refine the cells inside the sphere, the amount of cells increase significantly. How to solve this issue? If we have a script like this:

Code:
...
for (AllCells)
  {  
    // D: distance between cell center to O (x, y, z) 
    // H: thickness of refinement (e.g R/10)

    if ( | D - R | <= H) 
       do  Add Cell-ID  to CellSet
  }
then we can use this CellSet in "refineMeshDict". I never did this before, is there any way to achieve this for the mesh pre-processing?

best regards,

David

Last edited by keepfit; November 26, 2016 at 15:09.
keepfit is offline   Reply With Quote
Sponsored Links

Old   November 29, 2016, 08:56
Default
  #2
Member
 
Jan
Join Date: Jul 2009
Location: Hamburg
Posts: 66
Rep Power: 13
JNSN is on a distinguished road
Hi David,

you should have a look at topoSet. E.g. you can create to cellSets with cell centres within a sphere with different radii. Then subtract one from the other. There are also other possibilities with topoSet, e.g. selection based on cell centres nearest to a list of coordinates or selection based on stl-surface. See a full list of possibilites in
Code:
$FOAM_UTILITIES/mesh/manipulation/topoSet/topoSetDict
Hope this helps,
Jan
JNSN is offline   Reply With Quote

Old   November 30, 2016, 16:47
Default
  #3
Member
 
David Long
Join Date: May 2012
Location: Germany
Posts: 69
Rep Power: 7
keepfit is on a distinguished road
Quote:
Originally Posted by JNSN View Post
Hi David,

you should have a look at topoSet. E.g. you can create to cellSets with cell centres within a sphere with different radii. Then subtract one from the other. There are also other possibilities with topoSet, e.g. selection based on cell centres nearest to a list of coordinates or selection based on stl-surface. See a full list of possibilites in
Code:
$FOAM_UTILITIES/mesh/manipulation/topoSet/topoSetDict
Hope this helps,
Jan
Thanks Jan for the information! I noticed that the topoSet on openfoamwiki.net is out-dated which is based on OF 2.1. For OF 3.0.x and above, the "sphere" source for cells inside does exist. I think I can get this job done.

By the way, I thougght about to refine this specific region with a tedious but straight-forward method: i.e. create two closed mesh, which cover the cells between sphere-1 and sphere-2.Howvere, it seems that the "limitRegions" in sHM still does not work for both 3.0.x and 4.x. Maybe this feature is still not included?

cheers,

David
keepfit is offline   Reply With Quote

Reply

Tags
refine mesh, sphere geometry

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
Help! SnappyHexMesh running killed! Mark JIN OpenFOAM 2 October 4, 2016 00:19
snappyHexMesh can't create refimenet region clktp OpenFOAM Native Meshers: snappyHexMesh and Others 2 September 14, 2016 11:08
sHM layer process keeps getting killed MBttR OpenFOAM Native Meshers: snappyHexMesh and Others 4 August 15, 2016 03:21
In CFX workbench, which surface, i have to select senCFX CFX 19 December 19, 2011 02:31
CFX4.3 -build analysis form Chie Min CFX 5 July 12, 2001 23:19

Sponsored Links


All times are GMT -4. The time now is 07:02.