|
[Sponsors] |
November 7, 2020, 14:20 |
topoSetDict using stl file
|
#1 |
Senior Member
Farzad Faraji
Join Date: Nov 2019
Posts: 206
Rep Power: 8 |
Dear friends
I am using the example given by openFoam for topoSetDict by stl file, but nothing happend in my geometry. Is it important that generated stl file is from which source? I use below lines for importing stl file, but it did not work; Code:
// // Select based on surface // source surfaceToCell; // sourceInfo // { // file "www.avl.com-geometry.stl"; // useSurfaceOrientation false; // use closed surface inside/outside // // test (ignores includeCut, // // outsidePoints) // outsidePoints ((-99 -99 -59)); // definition of outside // includeCut false; // cells cut by surface // includeInside false; // cells not on outside of surf // includeOutside false; // cells on outside of surf // nearDistance -1; // cells with centre near surf // // (set to -1 if not used) // curvature 0.9; // cells within nearDistance // // and near surf curvature // // (set to -100 if not used) // } Thanks, Farzad |
|
November 7, 2020, 15:21 |
|
#2 |
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13 |
It is C++-style commented out. You need to remove the leading "//"s.
Also, you need to feed the STL file location to the "file" entry.
__________________
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 |
|
November 7, 2020, 18:06 |
reply
|
#3 |
Senior Member
Farzad Faraji
Join Date: Nov 2019
Posts: 206
Rep Power: 8 |
Dear Herpes Free Engineer
Thanks for your reply. It was just a template which I copied from the OF tutorial, and absolutely I have omitted "//" but It is not working. Also, I have fed model.stl(before posting this thread) to the code instead of "www.avl.com-geometry.stl", but it not working. Do you have any suggestion? Thanks, Farzad |
|
November 8, 2020, 03:59 |
|
#4 |
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13 |
Mind to share the topoSetDict that causes the trouble, please?
__________________
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 |
|
November 8, 2020, 17:27 |
|
#5 |
Senior Member
Farzad Faraji
Join Date: Nov 2019
Posts: 206
Rep Power: 8 |
Dear Herpes Free Engineer
This is my topoSetDict; Code:
actions ( { name doggg; //farzaaadSulzerCellSet; type cellSet; action new; //remove; // new; source surfaceToCell; //surfaceToCell; //cylinderToCell; // boxToCellfffff; sourceInfo { // box (0.096 0.10 0.0357) (0.404 0.20 0.0643); // p1 (0.0 0.30 0.0); // p2 (0.0 0.80 0.0); // radius 0.2 ; file totall.stl; // salascii.stl; // "TESTm.stl"; //"TestCube.stl"; //"PastorAleman.stl"; outsidePoints ((-30 -30 -20)); // definition of outside includeCut false; // cells cut by surface includeInside false; // cells not on outside of surf includeOutside false; // cells on outside of surf nearDistance -1; // cells with centre near surf //(set to -1 if not used) curvature -100; //0.9; // cells within nearDistance and near surf curvature//(set to -100 if not used) } } ); Thanks, Farzad |
|
November 9, 2020, 04:15 |
|
#6 |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,236
Rep Power: 29 |
Hello Farzad,
You have to decide which part of the mesh you want to select with these lines: Code:
includeCut false; // cells cut by surface includeInside false; // cells not on outside of surf includeOutside false; // cells on outside of surf With your current setting, everything is set to "false" so you don't include any inside/outside or cut cells and nothing should happen. Try to modify these lines according to what you want to achieve and see if it solved your issue. Cheers, Yann |
|
November 9, 2020, 05:35 |
|
#7 |
Senior Member
Farzad Faraji
Join Date: Nov 2019
Posts: 206
Rep Power: 8 |
Dear Yann
Thanks for your answer. I will try it as soon as possible and I let you know. Just a few questions; 1- for outsidePoints can I use any point outside of the stl domain? Even far away from the geometry? 2- stl file must be binary or ascii? Thanks, Farzad |
|
November 9, 2020, 05:51 |
|
#8 |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,236
Rep Power: 29 |
Dear Farzad,
Yann |
|
November 9, 2020, 12:02 |
|
#9 |
Senior Member
Farzad Faraji
Join Date: Nov 2019
Posts: 206
Rep Power: 8 |
Dear Yann
I did what you wrote here; Code:
actions ( { name doggg; //farzaaadSulzerCellSet; type cellSet; action new; //remove; // new; source surfaceToCell; //surfaceToCell; //searchableSurfaceToFaceZone; //surfaceToCell; //surfaceToCell; //cylinderToCell; // boxToCellfffff; sourceInfo { // box (0.096 0.10 0.0357) (0.404 0.20 0.0643); // p1 (0.0 0.30 0.0); // p2 (0.0 0.80 0.0); // radius 0.2 ; file Salascii.stl; //Box2.stl; // salascii.stl; // "TESTm.stl"; //"TestCube.stl"; //"PastorAleman.stl"; // surface triSurfaceMesh; outsidePoints ((1 2 3)); // definition of outside includeCut true; //false; // cells cut by surface includeInside true; //false; // cells not on outside of surf includeOutside false; // cells on outside of surf nearDistance -1; // cells with centre near surf //(set to -1 if not used) curvature -100; //0.9; // cells within nearDistance and near surf curvature//(set to -100 if not used) } } ); Code:
Create time Create polyMesh for time = 0 Reading topoSetDict Time = 0 mesh not changed. Created cellSet doggg Applying source surfaceToCell --> FOAM FATAL IO ERROR: wrong token type - expected string, found on line 35 the word 'Salascii.stl' From function Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::fileName&) in file primitives/strings/fileName/fileNameIO.C at line 56. FOAM exiting Thanks, Farzad |
|
November 9, 2020, 12:18 |
|
#10 |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,236
Rep Power: 29 |
Hello Farzad,
Look at the error message, it speaks for itself: you have a an error line 35 on the file definition. You forgot the quotation marks: Code:
file "Salascii.stl;" Hope this helps, Yann |
|
November 9, 2020, 14:12 |
|
#11 |
Senior Member
Farzad Faraji
Join Date: Nov 2019
Posts: 206
Rep Power: 8 |
Dear Yann
Thank you very much. Since It was my first experience with stl file, I forgot to put "" for my file. Now this problem is solved, and yet another problem raised with outsidePoint as below; Code:
--> FOAM FATAL ERROR: outsidePoint (100 200 300) is not inside any cell From function void Foam::surfaceToCell::combine(Foam::topoSet&, bool) const in file sets/cellSources/surfaceToCell/surfaceToCell.C at line 197. FOAM exiting Thanks, Farzad |
|
November 9, 2020, 15:49 |
|
#12 | |
Senior Member
Farzad Faraji
Join Date: Nov 2019
Posts: 206
Rep Power: 8 |
Dear Yan
Your comments are really helpful. Is there any way to find out outsidePoints? right now, my stl file is a cube, but I do not know how to define outsidePoints. I think there must be simple way rather than overthinking. Thanks, Farzad Quote:
|
||
November 9, 2020, 15:58 |
|
#13 | |
New Member
Hesam Tofighian
Join Date: Mar 2019
Posts: 11
Rep Power: 7 |
Quote:
I have the same problem with outsidePoints. How should I define them for my geometry? is there any tool for that? best regards, Hesam |
||
November 9, 2020, 19:40 |
It is solved!!!
|
#14 |
Senior Member
Farzad Faraji
Join Date: Nov 2019
Posts: 206
Rep Power: 8 |
Dear Yann and friends
My problem is solved. For outsidePoint (X Y Z), just go to constant/polyMesh and open the points file, and choose a point which is outside of the stl file. The second figure shows the imported stl file to my meshed geometry. Thanks, Farzad |
|
November 10, 2020, 04:23 |
|
#15 |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,236
Rep Power: 29 |
Hello all,
Glad to see you both solved your problems. AFAIK there is no specific tool for that in OpenFOAM but you can open your domain and STL in ParaView to check the bounding boxes in the "Information" tab, and/or tick the "Axes grid" option in the "Properties" tab of your object. If you create your own case with your own stl and blockMeshDict, you usually already know the bounding boxes of your geometry and domain. You can also use your usual CAD tool to check the size and position of your geometry. Cheers, Yann |
|
May 17, 2022, 11:10 |
|
#16 |
New Member
Megan
Join Date: May 2022
Posts: 11
Rep Power: 4 |
Hello All,
I have a similar issue. I'm trying to simulate flow in a pipe when a porous media is kept in the flow. (I'm able to define a circular porous media in topoSetDict and it works). However, I'm facing issues when I try to define a porous media in the shape of a quarter circle in the topoSetDict file. I made the quarter circle geometry separately and imported it as a .stl file. I have attached blockMesh, stl and topoSet files here. (Was not sure how exactly to define outside points in toposetDict). Could anyone please have a look at it? Thank you! |
|
May 19, 2022, 04:57 |
|
#17 |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,236
Rep Power: 29 |
Hi Megan,
What issue are you facing? Can you describe the problem or show us logs of the errors your get? Yann |
|
May 19, 2022, 06:40 |
|
#18 | |
New Member
Megan
Join Date: May 2022
Posts: 11
Rep Power: 4 |
Quote:
Dear Yann, Thank you for responding. I'm simulating a flow through a cylinder in which a porous media of the shape of quarter-circle is placed. I imported the geometry of porous media as a .stl file. /*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 8 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object topoSetDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // actions ( // porousBlockage { name porousBlockageCellSet; type cellSet; action new; source surfaceToCell; sourceInfo { file "constant/triSurface/geom90degarc.stl"; outsidePoints ( (0 0 5) (0.5 0 5) (0 0.5 5) (0 0 5.1) (0.5 0 5.1) (0 0.5 5.1) ); includeCut true; includeInside true; includeOutside true; nearDistance 0.5; curvature 2; // Optional entries useSurfaceOrientation false; fileType stl; scale 1.0; } } { name porousBlockage; type cellZoneSet; action new; source setToCellZone; sourceInfo { set porousBlockageCellSet; } } ); // ************************************************** *********************** // If I run the above TopoSet i get this error: --> FOAM FATAL ERROR: outsidePoint (0 0.5 5.1) is not inside any cell Then, I edited the Outside Points as below by Checking in the Points file in Constant/PolyMesh folder: outsidePoints ( (0 0 5) (0.007479829509 0.4999440398 5) (0 0 5) (0 0 5.1) (0.5 0 5.1) (0.007479829509 0.4999440398 5.1) When I run topoSet again, it gives this: "cellSet porousBlockageCellSet now size 2152500 Created cellZoneSet porousBlockage Applying source setToCellZone Adding all cells from cellSet porousBlockageCellSet ... cellZoneSet porousBlockage now size 2152500" In Paraview, when I check in Mesh Parts/PorousBlockage, it shows me the original cylinder instead of porous media. Also, I checked all combinations of includeCut, includeInside and includeOutside. Sometimes it gives: "cellSet porousBlockageCellSet now size 0" and porous media can't be seen in paraView as size is 0. I don't know the right way to define OutsidePoints, issue could be due to that? Sorry for the long question. Thanks again. Regards, Megan |
||
May 19, 2022, 06:43 |
|
#19 |
New Member
Megan
Join Date: May 2022
Posts: 11
Rep Power: 4 |
Attached is the problem figure.
|
|
May 19, 2022, 06:58 |
|
#20 |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,236
Rep Power: 29 |
Thanks Megan for the additional information.
This might be related to your STL file. Can you run surfaceCheck to test your STL file and post the log here ? Code:
surfaceCheck constant/triSurface/geom90degarc.stl Regards, Yann |
|
Tags |
openfoam, stl file, toposetdict |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Using PengRobinsonGas EoS with sprayFoam | Jabo | OpenFOAM Running, Solving & CFD | 36 | July 16, 2024 04:52 |
how to calculate mass flow rate on patches and summation of that during the run? | immortality | OpenFOAM Post-Processing | 104 | February 16, 2021 09:46 |
what is swap4foam ?? | AB08 | OpenFOAM | 28 | February 2, 2016 02:22 |
[Other] Adding solvers from DensityBasedTurbo to foam-extend 3.0 | Seroga | OpenFOAM Community Contributions | 9 | June 12, 2015 18:18 |
OpenFOAM on MinGW crosscompiler hosted on Linux | allenzhao | OpenFOAM Installation | 127 | January 30, 2009 20:08 |