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 Members List Search Today's Posts Mark Forums Read

Like Tree2Likes
  • 1 Post By olesen
  • 1 Post By olesen

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 26, 2020, 00:56
Default topoSet with surfaceToCell
  #1
New Member
 
Sunag R A
Join Date: Jul 2019
Location: Bangalore, India
Posts: 26
Rep Power: 3
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: 188
Rep Power: 12
Yann is on a distinguished road
Hello Sunag,


I think you have to give the path to file :

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

Cheers,
Yann
Yann is offline   Reply With Quote

Old   November 29, 2020, 04:28
Default
  #3
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 1,158
Rep Power: 28
olesen will become famous soon enougholesen will become famous soon enough
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 likes 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: 188
Rep Power: 12
Yann is on a distinguished road
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: http://olesenm.github.io/
Posts: 1,158
Rep Power: 28
olesen will become famous soon enougholesen will become famous soon enough
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 likes 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: 188
Rep Power: 12
Yann is on a distinguished road
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
New Member
 
Sunag R A
Join Date: Jul 2019
Location: Bangalore, India
Posts: 26
Rep Power: 3
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

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 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 0 April 9, 2020 01:38
[snappyHexMesh] TopoSet does not select all faces Mondal131211 OpenFOAM Meshing & Mesh Conversion 3 July 24, 2019 10:39
fail to run series of runApplication topoSet -dict jiahui_93 OpenFOAM Programming & Development 0 March 8, 2018 01:03
[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 01:54.