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

topoSetDict using stl file

Register Blogs Community New Posts Updated Threads Search

Like Tree16Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 19, 2022, 09:12
Default
  #21
New Member
 
Megan
Join Date: May 2022
Posts: 11
Rep Power: 4
mega1 is on a distinguished road
Dear Yann,

After running surfaceCheck this is what it gives;

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Reading surface from "constant/triSurface/geom90degarc.stl" ...

Statistics:
Triangles : 0
Vertices : 0
Bounding Box : (1.79769e+307 1.79769e+307 1.79769e+307) (-1.79769e+307 -1.79769e+307 -1.79769e+307)

Region Size
------ ----


Surface has no illegal triangles.

Triangle quality (equilateral=1, collapsed=0):
0 .. 0.05 : #0 Foam::error:rintStack(Foam::Ostream&) at ??:?
#1 Foam::sigFpe::sigHandler(int) at ??:?
#2 ? in "/lib/x86_64-linux-gnu/libc.so.6"
#3 ? in "/opt/openfoam9/platforms/linux64GccDPInt32Opt/bin/surfaceCheck"
#4 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#5 ? in "/opt/openfoam9/platforms/linux64GccDPInt32Opt/bin/surfaceCheck"
Floating point exception (core dumped)

-----------------------------------------------------------------------
I don't understand what it is.
mega1 is offline   Reply With Quote

Old   May 19, 2022, 10:22
Default
  #22
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
It seems there is something going on with your STL.
What software did you use to create it?
Is it binary or ASCII? If it's binary, maybe try to export it in ASCII format and try again.

Yann
Yann is offline   Reply With Quote

Old   May 19, 2022, 10:29
Default
  #23
New Member
 
Megan
Join Date: May 2022
Posts: 11
Rep Power: 4
mega1 is on a distinguished road
Quote:
Originally Posted by Yann View Post
It seems there is something going on with your STL.
What software did you use to create it?
Is it binary or ASCII? If it's binary, maybe try to export it in ASCII format and try again.

Yann
Dear Yann,
Yes I think so. I made the geometry with the blockMesh file, then imported it through Paraview in .pvd format and then changed the extension to .stl. I think it's not the right way. Is there any other way to do the .stl file? Are we supposed to use solid edge only to do the .stl?

Thanks a lot!
mega1 is offline   Reply With Quote

Old   May 19, 2022, 11:12
Default
  #24
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
You can create the geometry in any CAD software and then export the geometry as STL. You should be able to do this with Solid Edge indeed.

If you want to create a STL from blockMesh, you should load it into paraView, then use the "extract surface" filter to extract only the mesh boundaries and then file/save data/ and choose stl format. But this is quite an unusual and tedious process.

Yann
Yann is offline   Reply With Quote

Old   May 19, 2022, 14:20
Default
  #25
New Member
 
Megan
Join Date: May 2022
Posts: 11
Rep Power: 4
mega1 is on a distinguished road
Okay, I will try this way. Thank you very much Yann for your help!
Yann likes this.
mega1 is offline   Reply With Quote

Old   May 24, 2022, 05:09
Default
  #26
New Member
 
Megan
Join Date: May 2022
Posts: 11
Rep Power: 4
mega1 is on a distinguished road
Dear Yann,

I made the geometry with AutoCAD and imported it into OpenFoam as .stl file. Finally it gives me the shape of the porous zone which I needed but the geometry isn't perfect when opened in paraview. Any suggestions how I could improve the geometry? Thank you.
Attached Images
File Type: jpg paraview.jpg (30.6 KB, 19 views)
Attached Files
File Type: txt surface Check.txt (1.3 KB, 1 views)
mega1 is offline   Reply With Quote

Old   May 24, 2022, 06:08
Default
  #27
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
Hi Megan,

Could you also display your STL file on the screenshot so we can see what is wrong?

Also please note topoSet does not modify the mesh, it only assigns some cells or faces to different zones/patches, etc... The expected result is to get a porousBlockage cellZone made out of all the cells contained inside the volume of the STL file.

Yann
Yann is offline   Reply With Quote

Old   May 24, 2022, 06:28
Default
  #28
New Member
 
Megan
Join Date: May 2022
Posts: 11
Rep Power: 4
mega1 is on a distinguished road
Hello Yann,
Attached is the screenshot of stl file.
Attached Images
File Type: png stl screenshot.PNG (48.1 KB, 12 views)
mega1 is offline   Reply With Quote

Old   May 24, 2022, 10:18
Default
  #29
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
OK then since your STL file seems to be fine, something must be going on with topoSetDict.

Could you post your whole case here? It would be easier to debug if I can have a look at the file and run few tests.

Yann
Yann is offline   Reply With Quote

Old   May 24, 2022, 10:45
Default
  #30
New Member
 
Megan
Join Date: May 2022
Posts: 11
Rep Power: 4
mega1 is on a distinguished road
Hello Yann,

I have attached the blockMeshDict and topoSetDict files here. Thanks again!
Attached Files
File Type: txt blockMeshDict.txt (5.0 KB, 0 views)
File Type: txt topoSetDict.txt (1.5 KB, 4 views)
mega1 is offline   Reply With Quote

Old   May 24, 2022, 10:56
Default
  #31
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, but can you send your whole case in a zip file? I cannot test anything without the STL file and I have to rebuild a case around your files if I want to be able to test it.
Yann is offline   Reply With Quote

Old   May 24, 2022, 11:14
Default
  #32
New Member
 
Megan
Join Date: May 2022
Posts: 11
Rep Power: 4
mega1 is on a distinguished road
Hello Yann, sorry about that. I have attached the zip file here.
Attached Files
File Type: zip try.zip (8.2 KB, 3 views)
mega1 is offline   Reply With Quote

Old   May 24, 2022, 11:45
Default
  #33
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
Thank you!

I changed 2 parameters in the topoSetDict:
  • outsidePoints: it's not a good idea to use the origin as an outside point. Better using any coordinate located inside the domain but outside the STL volume and not on any patch.
  • nearDistance: I deactivated this parameter by setting it to "-1" since it does not seem appropriate for your case. It allows topoSet to select cells located at a certain distance of the surface and it is used in combination with the curvature parameter (some additional information in this thread: how surfaceToCell works?). I think this was the the main reason for your issue.

Code:
    // porousBlockage
    {
        name    porousBlockageCellSet;
        type    cellSet;
        action  new;
        source  surfaceToCell;
        sourceInfo
        {
			file	"constant/triSurface/Drawing4.stl";
			
			outsidePoints
			(
				(0.011 0.011 17.551) 
			);
        
			includeCut  true;
			includeInside  false;
			includeOutside  false;
			nearDistance	-1;
			curvature	1;
			
			// Optional entries
    			useSurfaceOrientation false;
    			fileType        stl;
    			scale           1.0;
		}
    }
This seems to have solved the issue and to give a proper cellZone.
Let me know if this is the result your were expecting!

Cheers,
Yann
Yann is offline   Reply With Quote

Old   May 24, 2022, 12:00
Default
  #34
New Member
 
Megan
Join Date: May 2022
Posts: 11
Rep Power: 4
mega1 is on a distinguished road
Hello Yann,
This is exactly what I needed. I can't thank you enough for your timely help!! God bless you!
Yann likes this.
mega1 is offline   Reply With Quote

Old   February 23, 2023, 20:25
Default
  #35
Senior Member
 
Farzad Faraji
Join Date: Nov 2019
Posts: 206
Rep Power: 8
farzadmech is on a distinguished road
After two years, I came up with the same problem and I encounter something which I forgot to mention. You should put your stl file in the main directory alongside 0, constant and system.


Thanks,
Farzad

Quote:
Originally Posted by farzadmech View Post
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
farzadmech is offline   Reply With Quote

Old   March 23, 2023, 00:55
Default
  #36
Senior Member
 
Farzad Faraji
Join Date: Nov 2019
Posts: 206
Rep Power: 8
farzadmech is on a distinguished road
Just one thing to remember, we need to name the generated cellSet using below red command;


Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  6
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      topoSetDict;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

actions
(

{
        name    seeedCellSet;   // 
        type    cellSet;
        action  new;               
        source  surfaceToCell; 

        sourceInfo
        {     
	      file  "seed3Space.stl"; 
        outsidePoints   ((-0.05 -0.05 -0.0494));    // definition of outside
        includeCut      true; //false;              // cells cut by surface
        includeInside   false; //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 nearDi
   	                  
        }
	}
	
    {
        name    seeed;
        type    cellZoneSet;
        action  new;
        source  setToCellZone;
        sourceInfo
        {
            set seeedCellSet;
        }
    }
////////////

 
 );
// ************************************************************************* //
// ************************************************************************* //
// ************************************************************************* //
Which gives below attached result and works for porous media without aby problem.

Thanks,
Farzad

Quote:
Originally Posted by farzadmech View Post
After two years, I came up with the same problem and I encounter something which I forgot to mention. You should put your stl file in the main directory alongside 0, constant and system.


Thanks,
Farzad
Attached Images
File Type: jpg toposSetSeed.jpg (13.5 KB, 8 views)

Last edited by farzadmech; March 23, 2023 at 02:18.
farzadmech is offline   Reply With Quote

Reply

Tags
openfoam, stl file, toposetdict


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
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


All times are GMT -4. The time now is 12:18.