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

topoSet with surfaceToCell

Register Blogs Community New Posts Updated Threads Search

Like Tree5Likes
  • 1 Post By Yann
  • 2 Post By olesen
  • 2 Post By olesen

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 26, 2020, 00:56
Default topoSet with surfaceToCell
  #1
Member
 
Sunag R A
Join Date: Jul 2019
Location: Bangalore, India
Posts: 82
Rep Power: 7
sunagra27 is on a distinguished road
Dear all,


I have created a mesh using snappyHexmesh with two different regions specified. Now, I have one stl file which needs to be inside my existing geometry for which I have imported to triSurface folder and meshed using snappyHexMesh.


For me, this new stl file should be another region for me for which I am trying to use surfaceToCell in topoSetDict. But when I run topoSet, it shows that it is unable to read the stl file.



Below is the topoSet assignment. I want to create cellSet, later from cellSet I want to create cellZone using cellSet.





actions
(


{
name duct;
type cellSet;
action new;
source surfaceToCell;
sourceInfo
{

file "duct_cadquery_heat.stl";
outsidePoints ((0 0.01 0));
includeCut true;
includeInside true;
includeOutside false;
nearDistance -1;
curvature -100;
useSurfaceOrientation false;

}
}

);





Error:


--> FOAM FATAL ERROR:
Cannnot read "duct_cadquery_heat.stl"




The stl file is present in constant/triSurface folder. The mesh works fine in snappyHexmesh but problem is with the topoSet.


Let me know any leads related to this.


Regards,


Sunag R A.
sunagra27 is offline   Reply With Quote

Old   November 26, 2020, 04:35
Default
  #2
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,236
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
Hello Sunag,


I think you have to give the path to file :

Code:
file            "constant/triSurface/duct_cadquery_heat.stl";

Cheers,
Yann
Marpole likes this.
Yann is offline   Reply With Quote

Old   November 29, 2020, 04:28
Default
  #3
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by Yann View Post
Hello Sunag,
I think you have to give the path to file :
Code:
file            "constant/triSurface/duct_cadquery_heat.stl";
Yes exactly. It's also good practice to fully resolve the path. The following are equivalent:
Code:
file  "<constant>/triSurface/file.stl";
file  "<case>/constant/triSurface/file.stl";
file  "$FOAM_CASE/constant/triSurface/file.stl";
I definitely prefer the first form as being the most concise and clear. Similarly for things a system directory
Code:
file  "<system>/file";
file  "<case>/file";
file  "$FOAM_CASE/system/file";

// other examples 
#includeEtc  "someFile"
#include "<etc>/someFile"
#sinclude "<etc>/optionalFile"
Yann and cfdInCivil like this.
olesen is offline   Reply With Quote

Old   November 29, 2020, 06:48
Default
  #4
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,236
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
Thanks Mark for the tips.

If you don't mind, can you elaborate on the "<directory>" syntax?
What is the difference between these two lines?

Code:
file  "constant/triSurface/file.stl";
file  "<constant>/triSurface/file.stl";
Yann is offline   Reply With Quote

Old   November 29, 2020, 07:15
Default
  #5
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by Yann View Post
Thanks Mark for the tips.

If you don't mind, can you elaborate on the "<directory>" syntax?
What is the difference between these two lines?

Code:
file  "constant/triSurface/file.stl";
file  "<constant>/triSurface/file.stl";
In almost all places where OpenFOAM gets a file name from a dictionary it is followed internally by an 'expand()' which replaces environment variables in the string (you can also embed basic maths in OpenFOAM-v1912 and later). There are a few special pointy tags recognized at the begin of strings to reduce the amount of typing (and mistakes).
https://www.openfoam.com/documentati...41778898bea3ba

If you use the first version, it resolves to a relative path with "constant/..." in the second version it resolves to an absolute path "/path/mycase/constant/..."
This difference can be essential if you run with the -case option. Most utilities in OpenFOAM will do the right thing and know to treat the relative path as relative to the case, but there are some that handle it as relative to your CWD. So better safe than sorry.
Yann and Tobermory like this.
olesen is offline   Reply With Quote

Old   November 29, 2020, 09:19
Default
  #6
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,236
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
Thanks for the clarification, I did not know about this.

Despite I usually don't use the -case option, it might come handy in some cases, especially when working on automatized workflow.

As you said, better safe than sorry!
Yann is offline   Reply With Quote

Old   November 30, 2020, 01:22
Default
  #7
Member
 
Sunag R A
Join Date: Jul 2019
Location: Bangalore, India
Posts: 82
Rep Power: 7
sunagra27 is on a distinguished road
Thank you for the reply Mark and Yann.


The solution worked and helped me.
sunagra27 is offline   Reply With Quote

Reply

Tags
snappy hex mesh, stl file, surfacetocell, toposet, trisurface


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
[Other] Error: topoSet – create patch from .stl – searchableSurfaceToFaceZone carl_r OpenFOAM Meshing & Mesh Conversion 1 November 18, 2022 18:06
fail to run series of runApplication topoSet -dict jiahui_93 OpenFOAM Programming & Development 1 May 25, 2022 13:56
[snappyHexMesh] TopoSet does not select all faces Mondal131211 OpenFOAM Meshing & Mesh Conversion 3 July 24, 2019 10:39
[snappyHexMesh] Porous Media using TopoSet RobertoCirolini OpenFOAM Meshing & Mesh Conversion 3 August 30, 2016 09:34
[Other] cellLevel field not readable by topoSet blaise OpenFOAM Meshing & Mesh Conversion 0 June 30, 2015 05:35


All times are GMT -4. The time now is 10:39.