CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[surface handling] Visualizing badFaces via surfaceSubsetDict

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 12, 2017, 12:27
Default Visualizing badFaces via surfaceSubsetDict
  #1
New Member
 
Moe Alams
Join Date: May 2017
Posts: 13
Rep Power: 9
MoeCFD is on a distinguished road
Hi All,

I am working with an STL file. I used surfaceCheck to evaluate the quality of the surface. The surfaceCheck utility produced badFaces file. The file has 7 bad faces. The goal is that I want to visualize those bad faces so I can fix them therefore I used surfaceSubset to generate a new STL of those faces as shown in the code below. However, I am getting the following error after executing:

Code:
surfaceSubset badFaces edited_pore_scaled_Zflow.stl badface.stl



Code:
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1706                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : v1706
Arch   :  
Date   : 
Time   : 
Host   :
PID    : 
Case   :
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Reading dictionary "badFaces" ...


--> FOAM FATAL IO ERROR:
Expected a '(' or a '{' while reading List, found on line 5 the label 75112

file: badFaces at line 5.

    From function char Foam::Istream::readBeginList(const char*)
    in file db/IOstreams/IOstreams/Istream.C at line 134.

FOAM exiting






Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.1.x                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      surfaceSubsetDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

// Select triangles by label
faces #include "badFaces";

// Select triangles using given points (local point numbering)
localPoints ( );

// Select triangles using given edges
edges ();

// Select triangles (with face centre) inside box
zone
(
/*    (0      -10000  -10000)
    (0   10000  10000)*/
);

// Select triangles (with face centre) inside or outside of another surface.
// (always selects triangles that are 'on' other surface)
surface
{
    name "edited_pore_scaled_Zflow.stl";
    outside     yes;
}

// Extend selection with edge neighbours
addFaceNeighbours no;

// Invert selection
invertSelection false; // when true-it will remove badfaces and write the good part only

// ************************************************************************* //
MoeCFD is offline   Reply With Quote

Old   November 14, 2017, 05:52
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

Command should be

Code:
surfaceSubset surfaceSubsetDict edited_pore_scaled_Zflow.stl bad_faces.stl
Where surfaceSubsetDict could be either as you have posted, or just

Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      surfaceSubsetDict;
}

faces #include "badFaces";

localPoints ();

edges ();

zone ();

addFaceNeighbours no;

invertSelection false;
alexeym is offline   Reply With Quote

Old   June 24, 2019, 05:43
Default
  #3
Member
 
Owais Shabbir
Join Date: May 2019
Posts: 48
Rep Power: 7
Owais Shabbir is on a distinguished road
Hi,


I want to know after finding and visualizing these badFaces, how could I get rid of them?



Thanks.
Owais Shabbir is offline   Reply With Quote

Old   June 24, 2019, 08:33
Default
  #4
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

It depends on available tools. For example, MeshLab is quite good at removing bad faces. If you need to just remove these badFaces, you can edit STL with Gmsh (this way it is just select and press delete). Or you can use less picky mesher to create tetrahedral mesh from the surface with badFaces and then save outer surface of generated mesh.
alexeym is offline   Reply With Quote

Old   June 24, 2019, 09:24
Default
  #5
Member
 
Owais Shabbir
Join Date: May 2019
Posts: 48
Rep Power: 7
Owais Shabbir is on a distinguished road
Hi Alexey,



I have tried LabMesh. When I try the 'repair/clean' filter; there is no option for precisely badFaces. Could you guide me which faces in Labmesh represent badFaces?


I also have GMSH but again I lack the knowledge of how to select the badFaces.
Owais Shabbir is offline   Reply With Quote

Old   June 26, 2019, 09:46
Default
  #6
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
You visualize your badFaces with let's say ParaView and then select them in Gmsh with a mouse? Or there are thousands of such faces? IIRC there is a possibility to select faces using IDs, so you can select them using values from badFaces file.

In MeshLab you can not supply your badFaces, yet there are software's own criteria for selection of low quality faces.

Also it is not quite clear what do you mean by "get rid of them"?
alexeym is offline   Reply With Quote

Old   June 27, 2019, 03:07
Default
  #7
Member
 
Owais Shabbir
Join Date: May 2019
Posts: 48
Rep Power: 7
Owais Shabbir is on a distinguished road
Hi Alexey,

To my understanding (which is basic) badFaces, illegalFaces and problemFaces lead to bad results of simulations. Or I understood it wrong?

That's why I thought of deleting or getting rid of them.

Thanks
Owais Shabbir is offline   Reply With Quote

Old   June 27, 2019, 05:48
Default
  #8
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Well...

Initial question was about STL surface, which was used to generate mesh. Those badFaces lead to difficulties during mesh generation. And has (almost) nothing to do with simulation per se.

Now to the question of "getting rid". Face is just a connectivity. OK, you have deleted a face, now you have got a hole in your surface (maybe not if the face was, for example, internal extra-face, or erroneously generated face with zero area).

There are many different types of bad faces. Certain you can simply delete. For certain you need to modify points of you surface. It would be easier if you create new post with illustrations (your surface with coloured badFaces).
alexeym is offline   Reply With Quote

Reply


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
[OpenFOAM] How to display badFaces from surfaceCheck in paraview pizzaspinate ParaView 7 February 26, 2015 10:02
Visualizing mesh regions with high courant number? Endel OpenFOAM 2 August 20, 2013 03:57
Rothalpy good for visualizing losses? eRzBeNgEl Lounge 0 August 12, 2011 04:40
[OpenFOAM] Visualizing in Paraview Kvadar ParaView 5 July 25, 2011 03:36
visualizing control volumes (not elements) dvolkind ANSYS Meshing & Geometry 0 March 24, 2010 10:40


All times are GMT -4. The time now is 11:32.