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/)
-   -   [blockMesh] spline not working, straight line assumed correct (https://www.cfd-online.com/Forums/openfoam-meshing/167628-spline-not-working-straight-line-assumed-correct.html)

PanPeter March 5, 2016 15:36

spline not working, straight line assumed correct
 
1 Attachment(s)
Hello together,

I am having trouble using the spline command:
If you look at my blockMeshDict file, you find 4 splines. Now, running blockMesh I have the same result as without these 4 splines defined, i.e. no curved edges but straight lines. No error messages appear in either case...

I reduced my geometry to this one block but can't spot the error. The blockMeshDict file is generated through an algorithm, but that shouldn't make a difference. Finally, I have a simple example, in which splines work fine.

Help is greatly appreciated!!

Kina March 5, 2016 17:39

well, actually i'd say your blockMeshDict looks perfectly fine. There is only one thing that could lead to your problem.
You have only defined one cell in each direction for the block. As this is a hexahedral mesher you won't get any curved edges with just one cell. Try:

Code:

blocks
(
    hex (0 1 5 4 2 3 7 6) (20 20 20) simpleGrading (1 1 1)
);

And you will see your spline I suppose.

Cheers
Alex

PanPeter March 6, 2016 02:55

Hi Alex,

Thanks for your answer!
That works well but i find it a bit unsatisfactory:
The higher resolution grid approximates the spline well, but still, respective vertices are connected by straight lines. So is it in general possible to generate curved edges or are curves approximated with a number of straight lines, depending on the resolution given? If so, what then is the difference between a spline edge and a ployLine edge?

This edge should be spiral shaped. For that it'd be good to define a spline edge over several blocks, because i could use block vertices on the edge for the support of the spline. The inner blocks are already pretty small, so I don't really want to increase their resolution much. Any idea how to achieve that?

cheers,
Fynn

Kina March 6, 2016 04:09

Quote:

Originally Posted by PanPeter (Post 588249)
Hi Alex,

Thanks for your answer!
That works well but i find it a bit unsatisfactory:
The higher resolution grid approximates the spline well, but still, respective vertices are connected by straight lines. So is it in general possible to generate curved edges or are curves approximated with a number of straight lines, depending on the resolution given? If so, what then is the difference between a spline edge and a ployLine edge?

This edge should be spiral shaped. For that it'd be good to define a spline edge over several blocks, because i could use block vertices on the edge for the support of the spline. The inner blocks are already pretty small, so I don't really want to increase their resolution much. Any idea how to achieve that?

cheers,
Fynn

Hi Fynn,

The difference between a spline edge and a polyLine - as I see it - is the interpretation of the given interpolation points. A polyLine will mathematically connect the given interpolation points with straight edges and mesh along those edges. A spline will try to create a smooth curve following all given interpolation points. That means, given an infinite number of interpolation points, your polyLine will become a spline.
That being said, you still won't get a curved edge with just one cell. However, your curve of the spline is just as good as the given cell resolution as well as the number of interpolation points put in the blockMeshDict. For example, I sometimes create airfoil meshes with blockMesh. For this purpose, I define the upper and lower edge of the foil as splines with 1000+ interpolation points for 1m of chord length. It really makes a difference in the end.

What you could try is using matlab for this. You put in your initial spline coordinates, let matlab put a spline through it and then sample this created spline as often as you want. Then, you take the resulting output spline coordinate matrix and put it into blockMesh.

Cheers
Alex


All times are GMT -4. The time now is 14:40.