|
[Sponsors] |
[snappyHexMesh] Implementing searchableCone primitive in snappyHexMesh |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 6, 2020, 04:45 |
Implementing searchableCone primitive in snappyHexMesh
|
#1 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 746
Rep Power: 14 |
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. |
|
May 6, 2020, 08:28 |
|
#2 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 746
Rep Power: 14 |
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.
|
|
May 6, 2020, 08:30 |
|
#3 |
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13 |
may help a bit (though OFv1912): https://www.openfoam.com/documentati...chable-objects
__________________
The OpenFOAM community is the biggest contributor to OpenFOAM: User guide/Wiki-1/Wiki-2/Code guide/Code Wiki/Journal Nilsson/Guerrero/Holzinger/Holzmann/Nagy/Santos/Nozaki/Jasak/Primer Governance Bugs/Features: OpenFOAM (ESI-OpenCFD-Trademark) Bugs/Features: FOAM-Extend (Wikki-FSB) Bugs: OpenFOAM.org How to create a MWE New: Forkable OpenFOAM mirror |
|
May 6, 2020, 18:52 |
|
#4 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 746
Rep Power: 14 |
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.
Last edited by Tobermory; May 6, 2020 at 18:58. Reason: added a missing figure |
|
September 8, 2020, 10:17 |
|
#5 |
New Member
S A
Join Date: Oct 2019
Posts: 8
Rep Power: 7 |
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++
|
|
September 12, 2020, 07:52 |
|
#6 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 746
Rep Power: 14 |
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 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 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! |
|
|
|
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 |