CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [snappyHexMesh] jagged, ragged edges... (https://www.cfd-online.com/Forums/openfoam-meshing/72595-jagged-ragged-edges.html)

openfoam_user June 24, 2010 09:35

Niklas,

it works with tolerance 0.85 !

Now I will try it with layers around the cube.

And with a more complex geometry.

Great tool !

Stephane.

openfoam_user June 30, 2010 04:29

1 Attachment(s)
Hi Niklas,

I am trying to use our tool for the ahmed body.

Attached is a picture of the rear part of the body.

Is it possible to improve the surface mesh ?

Regards,

Stephane.

niklas June 30, 2010 04:51

1 Attachment(s)
does this work better?

openfoam_user June 30, 2010 05:49

1 Attachment(s)
Hi Niklas,

I have done a smaller case with just the rear part.

2 kind of problems remain:

1. at the corners of the oblique edges
2. on the oblique edges

Have a look at the attached picture.

Regards,

Stephane.

niklas June 30, 2010 06:33

To me it just looks like its a tolerance issue.
can you mail me the case so I can play with it.

N

openfoam_user June 30, 2010 07:16

what's your mail address ?

niklas June 30, 2010 07:32

Quote:

Originally Posted by openfoam_user (Post 265123)
what's your mail address ?

niklas dot nordin at nequam dot se

openfoam_user June 30, 2010 09:48

Niklas,

yes it works.

No I will try it for the complete ahmed body.

Thanks,

Stephane.

openfoam_user June 30, 2010 10:27

2 Attachment(s)
for the ahmed body some minor problems remain:

- the corner is not correct (first picture)
- near the head of the ahmed body (second picture) there is one cell with 3 edges instead of 4
- the form of the cells at the oblique edge (first picture) could be improved to obtain cells like square

stephane

johannes July 5, 2010 14:03

Hi Niklas,

from what I saw in this thread you did a nice job with your snapEdge tool!

I would also like to give it a try but there's a small problem which has something to do with my stl creation workflow:

Currently, the only way for me to create stls for snappy out of CAD geometry is to use multiple stl files so that every bc surface is represented by a seperate stl file. Unfortunately, snapEdge seems to be only working with one single stl which includes named sections.

Would it be possible to extend snapEdge to be able to use multiple stl files? That would be really great! But if it's just too much work to do, I'll be satisfied with the current snapEdge features and will try to change my stl creation process.

Many thanks in advance!

Best regards,
Johannes

niklas July 6, 2010 02:19

That should be pretty easy.
In the meantime, if you want to try it you can process 1 stl at a time.
It writes the points to a new time directory, so if you have
startFrom latestTime;
It should be fine.

N

niklas July 7, 2010 02:42

Can you try this. I dont have a case to try it on so if it doesnt work it would be great
if you could provide me with one.

http://openfoam.nequam.se/cases/snapEdge.tgz

openfoam_user July 7, 2010 07:54

Hi Niklas,

is this new version of snapEdge only for multiple stl files or also for single stl file ?

Stephane.

niklas July 7, 2010 07:58

Quote:

Originally Posted by openfoam_user (Post 266140)
is this new version of snapEdge only for multiple stl files or also for single stl file ?

It handles mutliple stl files as well as a single stl....like this:

stlFileNames
(
wedge.stl
);

johannes July 9, 2010 07:10

Hi Niklas,

thank you very much for the new snapEdge version. I haven't had time to test it yet, but I think I'll have within the next few days.

Of course I can put together a small test case if it doesn't work out of the box.

Best regards,
Johannes

juho July 11, 2010 11:30

Hi,

First I would like to thank Niklas for his work on snapEdge and sharing the tool!

I've been testing snappyHexMesh on a geometry where I think it would be a good tool and it proved a very useful, except for the lack of feature edge snapping. Therefore I was delighted to find the snapEdge-tool here and I've been testing it on my case. The tool is easy to use and seem to mostly takes care of the feature edge preservation. However, a couple of notes:

- My geometry consists of several stl-files. The snapping results seemed better if I only included the stl-file on one side of the edge to be snapped, instead of including them all.

- A more troublesome note. after running snapEdge my mesh fails checkMesh on face orientation:

Checking geometry...
Overall domain bounding box (-0.0256 -0.009 -0.0256) (0.0256 0.035 0.0256)
Mesh (non-empty, non-wedge) directions (1 1 1)
Mesh (non-empty) directions (1 1 1)
Boundary openness (-7.67448e-17 -1.92442e-17 -2.87288e-16) OK.
Max cell openness = 3.26249e-16 OK.
Max aspect ratio = 3.5401 OK.
Minumum face area = 5.79544e-10. Maximum face area = 1.54916e-06. Face area magnitudes OK.
Min volume = 2.88102e-12. Max volume = 1.38403e-09. Total volume = 8.936e-05. Cell volumes OK.
Mesh non-orthogonality Max: 49.7654 average: 9.28351
Non-orthogonality check OK.
***Error in face pyramids: 68 faces are incorrectly oriented.
<<Writing 68 faces with incorrect orientation to set wrongOrientedFaces
Max skewness = 1.64219 OK.

Failed 1 mesh checks.

Is this a bug or am I doing something wrong?



A picture of the geometry:
http://i26.tinypic.com/2vbqyd4.png

Here's a picture of the snappyHexMesh result:
http://tinypic.com/r/303l8xd/3

and the snapEdge result:
http://tinypic.com/r/24xjl38/3

-Juho

johannes July 11, 2010 17:41

Hi Niklas,

I tried snapEdge with multiple stl files and it's working as expected! :)

Now I just have to play around with the settings in the snapEdgeDict since most of the meshes I used for testing failed several checkMesh tests after edge-snapping.

I like the 'includeInterior' feature of edge-snapping inside a patch (e.g. for a large wall patch) but noticed that it sometimes reduces mesh quality at fillets - although there should be no need for snapping at these locations. But this might be fixed with adjusting of some settings.

One additional remark on the includeInterior switch: I had to use 'true' and 'false' instead of 'yes' and 'no' to make snapEdge work. No real problem, though.

There might be an issue with relatively large patches and/or stl files. I tried a patch with about 80k cells and a corresponding stl file of 135 MB and got a floating point exception during the 'Smoothing patch faces...' phase. I'm currently testing different settings since it works once in while but creates a low quality mesh. I'll keep you updated on this.

Thanks and best regards,
Johannes

openfoam_user July 12, 2010 02:23

Hi Johannes,

just set nSmootherIterations 0

and the 'Smoothing patch faces' will disappears.

Stephane.

niklas July 12, 2010 02:45

Juho:

Sometimes I get those bad faces as well. Snapping the edges all the way to feature-lines sometimes cause this and what I do then is to set the relaxation to something lower than 1. This will not yield an exact feature representation, but visibly you can hardly see any difference and
thats 'good enough' for me. It all depends on how the mesh produced by snappyHexMesh looks. Sometimes an inlet patch can be more or less on the adjacent wall and the neighbouring face can be more or less on the inlet and that creates some problem. Ideally I'd like to have the program move the faces to/from patches if the are too far
outside, but that's something for the future :)


Johannes:
If you are using includeInterior its important that you dont set tolerance to something larger than 1 as this will 'attract' edges that are really too far away. I've tried to improve this by checking the angle between the face-edge and feature line so that it doesnt snap
edges that are perpendicular to the feature-line, but its more
or less a question of tolerance.

I recommend you dont do any smoothing, its something I'm working on and its not very good atm. Just set the smoother iterations to 0.
I should have commented out that section.

Finally...As I say on the wiki, sometimes it works and sometimes not, but I've always been able to improve the feature representation and
its just a little tool I wrote for me without the intention of releasing it, but as I discovered that I wasnt alone with this problem I thought
I'd share it with the rest of you hoping that you'd find some use for it.
So bare that in mind that its very much a work-in-progress.

N

Edit:
Oh and if you have any problems with a case I'd really like to have it so I can improve snapEdge,
as almost all of my stl's are quite simple
pipes.

openfoam_user July 13, 2010 08:58

Hi Niklas,

it would be nice to have the -overwrite option as for snappyHexMesh.

After having used your snapEdge tool I have the following files:

/3/meshPhi.gz
/3/polyMesh/points.gz

Do I have to put both file into the directory :

/constant/polyMesh/

Regards,

Stephane.


All times are GMT -4. The time now is 03:48.