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

[snappyHexMesh] Implementing searchableCone primitive in snappyHexMesh

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By Tobermory

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 6, 2020, 04:45
Default Implementing searchableCone primitive in snappyHexMesh
  #1
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 736
Rep Power: 14
Tobermory will become famous soon enough
I need to generate a conical shaped refinement zone, and found online the "searchableCone" primitive that looks perfect ... however, the trouble is that this seems to be implemented only in the OpenCFD port of OpenFOAM (OF+, or whatever it's called these days), and I am running the dev version from the OF Foundation.

I checked in my $FOAM_SRC/meshTools/searchableSurfaces and indeed, no searchableCone. Before I start mucking about with the code, does anyone know - is this simple to implement? I imagine that I can get the code from the OF+ port, or perhaps use the searchableCylinder as a starting point and write my own coded, but then what do I need to rebuild within OF? Can I just rebuild one of the libraries, or do I need to rebuild the whole thing?

I tried tracing back through the inheritance diagrams, but got as far as IOobject and could not see where this class sat. Any advice or pointers would be gratefully received, since it would probably save me a chunk of time. Thanks.
Tobermory is offline   Reply With Quote

Old   May 6, 2020, 08:28
Default
  #2
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 736
Rep Power: 14
Tobermory will become famous soon enough
Ok - after a little more digging I realised that the searchableSurfaces are all compiled as part of the meshTools library (obvious really, since they sit in the meshTools folder). I think I see now how I can do this.
Tobermory is offline   Reply With Quote

Old   May 6, 2020, 08:30
Default
  #3
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13
HPE is on a distinguished road
may help a bit (though OFv1912): https://www.openfoam.com/documentati...chable-objects
HPE is offline   Reply With Quote

Old   May 6, 2020, 18:52
Default
  #4
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 736
Rep Power: 14
Tobermory will become famous soon enough
Ok - that took a little longer than expected, since some of the class definitions have diverged between the OpenFOAM foundation version and the v1912 OF+ version. Still - it was fairly easy to fix with some edits in the header and .C files, and I now have a libmyMeshTools.so in my $WM_PROJECT_USER_DIR that I can link to dynamically at run time. It's working like a charm.
Attached Images
File Type: jpg conical refinement mesh.jpg (156.5 KB, 56 views)
HPE and Propanotriol like this.

Last edited by Tobermory; May 6, 2020 at 18:58. Reason: added a missing figure
Tobermory is offline   Reply With Quote

Old   September 8, 2020, 10:17
Default
  #5
New Member
 
S A
Join Date: Oct 2019
Posts: 8
Rep Power: 7
Propanotriol is on a distinguished road
Dear Tobermory, I wanted to do the same thing, refinement with a cone. Can you explain how you implemented it please? I am a newbie with OF and C++
Propanotriol is offline   Reply With Quote

Old   September 12, 2020, 07:52
Default
  #6
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 736
Rep Power: 14
Tobermory will become famous soon enough
Annoyingly, I didn't keep any notes, and it's rather long ago to remember the details. However, let me describe the process at high level:
1. Download the foam-extend source, and find the meshTools folder. The searchableCone class is in there.
2. Copy the meshTools folder into your user src folder, and in the searchableSurfaces folder delete all but the searchableCone folder
3. Edit the Make/files file:
Code:
searchableSurfaces/searchableCone/searchableCone.C
LIB = $(FOAM_USER_LIBBIN)/libmyMeshTools
4. Edit the Make/options file:
Code:
EXE_INC = \
    -I$(LIB_SRC)/triSurface/lnInclude \
    -I$(LIB_SRC)/surfMesh/lnInclude \
    -I$(LIB_SRC)/fileFormats/lnInclude \
        -I$(LIB_SRC)/meshTools/lnInclude

LIB_LIBS = \
    -ltriSurface \
    -lsurfMesh \
    -lfileFormats
5. Build the library, using wmake

If the above is successful, you should end up with libMeshTools.so in your user lib folder ($(FOAM_USER_LIBBIN)). You can then reference this in your controlDict. I THINK that was all the steps! Good luck!
Tobermory 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
[CAD formats] Creating waterproof STL using snappyHexMesh or salome Tobi OpenFOAM Meshing & Mesh Conversion 58 May 13, 2020 07:01
[snappyHexMesh] Running snappyHexMesh in parallel - optimizing peterhess OpenFOAM Meshing & Mesh Conversion 2 January 3, 2018 03:54
[snappyHexMesh] Tutorial crashes: snappyHexMesh floating point exception. jasv OpenFOAM Meshing & Mesh Conversion 4 May 10, 2016 03:55
Strange Results With snappyHexMesh calebamiles OpenFOAM Running, Solving & CFD 0 August 14, 2011 17:02
[snappyHexMesh] stitchMesh and snappyHexMesh gdbaldw OpenFOAM Meshing & Mesh Conversion 0 December 23, 2009 03:09


All times are GMT -4. The time now is 01:56.