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] How to use the spline commands (https://www.cfd-online.com/Forums/openfoam-meshing/61801-how-use-spline-commands.html)

tnm23 October 20, 2007 06:53

How to use the spline commands
 
Can anyone please tell me the details of how to define the different kinds of spline in blockMesh? The manual gives the keywords, but precious little else except that they require a list of interpolation points.

Specifically, I need to know how many points they need, the syntax for listing the points, which points do what, what order the points need to be in, and whether the order also has to be oriented a particular way between the two vertices the splined edge joins. The actual curve generating equation would also be useful.

jjhall April 7, 2008 14:46

I would also like to know how
 
I would also like to know how these commands work. I have tried to create an airfoil shape within a rectangular domain and have had some problems. I can use the simpleSpline command, but at the tail of the airfoil it doesn't line up nicely with the beginning of the next block, so I get some cells that are folded over. I have tried to use the polySpline command, but I get an error about unmatched ( .

By the way, I initially set it up in FoamX, then edited the file manually.

mturcios777 May 5, 2008 17:47

I'll add a bump to this messag
 
I'll add a bump to this message. It seems like the syntax should be the same as polyLine:

polySpline A B (i j k l m n)

and the resulting spline should pass from A to B through i j k l m n.

When I change over to simpleSpline, most things work fine except for the above-mentioned folding over of cells near sharp corners.

I get the feeling that just as polyLine joins the interpolation points with multiple straight lines, polySpline connects the points with multiple splines. Since polyLine only uses straight lines, the way you step from i to j, then j to k is fairly simple.

I think this is where the problem arises. It seems like there should be some extra parameters with the interpolation point arguments, maybe a grouping of the interpolation points, to show which points are joined by a single spline?

polySpline A B ((i j k) (l m n))

Any help would be great, as using simpleSpline alone is a real limitation.

ericnutsch December 2, 2009 17:32

simpleSpline in blockMesh?
 
I have attempted using simpleSpline in the previously mentioned format:

simpleSpline A B ((i j k) (l m n))

...with no success.

Has anyone had any success with this function?
Thanks!

olesen December 3, 2009 15:44

Quote:

Originally Posted by ericnutsch (Post 238558)
I have attempted using simpleSpline in the previously mentioned format:

simpleSpline A B ((i j k) (l m n))

...with no success.

Has anyone had any success with this function?
Thanks!

I looked into this a bit:
http://www.cfd-online.com/Forums/ope...-property.html

and concluded that the current state of splines (simpleSpline, polySpline) is probably still questionable.

ericnutsch December 4, 2009 15:02

Thanks olesen, i was afraid of that.

Have you by chance used splines in Gmsh?

olesen December 8, 2009 07:28

Quote:

Originally Posted by olesen (Post 238645)
I looked into this a bit:
http://www.cfd-online.com/Forums/ope...-property.html

and concluded that the current state of splines (simpleSpline, polySpline) is probably still questionable.

You might want to take another look at it in 1.6.x, there is now a 'spline' command (instead of simpleSpline and polySpline) that uses Catmull-Rom under the hood.

ericnutsch December 10, 2009 19:04

spline function for blockMesh
 
Thanks for the recomendation olesen. Unfortunately, I only found these functions in the Version 1.6 (24th July 2009) Userguide:

arc
simpleSpline
polyLine
polySpline
line


I also tried using "spine" in place of a functional polySpline with no luck. Thoughts? Thanks

olesen December 12, 2009 08:32

Quote:

Originally Posted by ericnutsch (Post 239557)
Thanks for the recomendation olesen. Unfortunately, I only found these functions in the Version 1.6 (24th July 2009) Userguide:

arc
simpleSpline
polyLine
polySpline
line

It's a safe guess that the Userguide hasn't yet been updated accordingly. As far as I can tell, the 'simpleSpline' and 'polySpline' were the same thing anyhow, and didn't really work particularly well. The new 'spline' replaces both of them.

Quote:

I also tried using "spine" in place of a functional polySpline with no luck. Thoughts?
1. Are you certain that polySpline was functional? I tested a few cases and it was not particularly reliable and would often show artifices (likely due to the end conditions). If your discretization was coarse enough, it could be that you simply jumped over these sharp discontinuities without noticing.

2. What do you mean that you tried "spline" without any luck? Does that mean that it wasn't recognized, it caused a segfault, it wasn't smooth, it shot all over the place, the parsing failed or what? I have no clue what exactly you mean.

3. What you mean by "a functional polySpline"?

ericnutsch December 12, 2009 15:32

1 Attachment(s)
Hi olesen,

By functional polySpline i mean that it generated a useable mesh, but a diamond as opposed to an ellipse(this is not my final geometry, just as simplification to learn the code). I am pursuing "spline" because it would be tedious to generate a very high resolution of points in a spreadsheet and transfer them to polySpline. The result of polySpline is attached in a printscreen below.

I apoligise for not being specific. The "spline" command wasn't recognized. I am in the process of compiling the newest git version(previously on OF1.6 binary), so maybe that will fix the issue.

I also may not be using the spline tool correctly. Could you post an example of your use of the spline function.

Thanks for your help!

olesen December 13, 2009 03:16

Quote:

Originally Posted by ericnutsch (Post 239816)
By functional polySpline i mean that it generated a useable mesh, but a diamond as opposed to an ellipse(this is not my final geometry, just as simplification to learn the code).

Okay, but IMO that may be a much too lax definition of usable. For my own tests, I wrote a mini bit of code to test various spline points and plot the curves in xmgrace. It unfortunately uses other convenience bits from my own libs and won't compile directly with the stock OpenFOAM.
The xmgrace plots showed a consist wrinkle in the original polySpline implementation. In the new 1.6.x implementation, the Catmull-Rom splines are consistently much better behaved. The B-Spline doesn't look so terrible any more, but exhibits minor deviations from the knot points.
In fact, with the B-Spline, it could be that this means that even the end-points don't quite land exactly where they should (since the treatment of the end-tangents and/or the use of point reflection for the ends implies that the end-points indirectly become internal points.)

Quote:

I apoligise for not being specific. The "spline" command wasn't recognized. I am in the process of compiling the newest git version(previously on OF1.6 binary), so maybe that will fix the issue.
That would certainly explain it. Of course, after you do this you won't be able to examine where the old polySpline was broken.

Quote:

I also may not be using the spline tool correctly. Could you post an example of your use of the spline function.
The simplest is to grab the blockMeshDict that Martin posted on this thread:
http://www.cfd-online.com/Forums/ope...-property.html
Then we all have about the same basis. Note that you can probably get away with substantially fewer points, but you should test it first.

For fun, I tried using these points:
Code:

// cosine function, but with extremely few points
(
    (0    1 0)
    (180 -1 0)
    (360  1 0)
)

and it worked surprisingly well and looks like a cosine at first glance. However, with an asymmetric point distribution, it shifts the spline about and destroy the resemblance to a cosine:
Code:

(
    (0    1 0)
    (90  0 0)
    (180 -1 0)
    (360  1 0)
)

You shouldn't need anything to get it working with the new implementation - it recognizes polySpline and translates it to spline for you and silently swallows the end tangents. However, for the future you should replace all occurrences of 'polySpline' in the dictionary with 'spline'. You can (should) also remove the final end tangent specifications since they are no longer used. If you really do need the end tangents, please let me know how you even calculate them properly!


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