CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Native Meshers: blockMesh

How to use the spline commands

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   October 20, 2007, 06:53
Default Can anyone please tell me the
  #1
New Member
 
Tom McEwan
Join Date: Mar 2009
Location: England
Posts: 1
Rep Power: 0
tnm23 is on a distinguished road
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.
tnm23 is offline   Reply With Quote

Old   April 7, 2008, 14:46
Default I would also like to know how
  #2
New Member
 
Jeremiah Hall
Join Date: Mar 2009
Location: Denver, Co, USA
Posts: 10
Rep Power: 9
jjhall is on a distinguished road
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.
jjhall is offline   Reply With Quote

Old   May 5, 2008, 17:47
Default I'll add a bump to this messag
  #3
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 727
Rep Power: 20
mturcios777 will become famous soon enough
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.
mturcios777 is offline   Reply With Quote

Old   December 2, 2009, 18:32
Default simpleSpline in blockMesh?
  #4
Senior Member
 
Eric Nutsch
Join Date: Sep 2009
Location: Eugene, Oregon USA
Posts: 112
Rep Power: 8
ericnutsch is on a distinguished road
Send a message via Skype™ to ericnutsch
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!
ericnutsch is offline   Reply With Quote

Old   December 3, 2009, 16:44
Default
  #5
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 779
Rep Power: 19
olesen will become famous soon enough
Quote:
Originally Posted by ericnutsch View Post
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:
polySpline violates convex hull property

and concluded that the current state of splines (simpleSpline, polySpline) is probably still questionable.
olesen is offline   Reply With Quote

Old   December 4, 2009, 16:02
Default
  #6
Senior Member
 
Eric Nutsch
Join Date: Sep 2009
Location: Eugene, Oregon USA
Posts: 112
Rep Power: 8
ericnutsch is on a distinguished road
Send a message via Skype™ to ericnutsch
Thanks olesen, i was afraid of that.

Have you by chance used splines in Gmsh?
ericnutsch is offline   Reply With Quote

Old   December 8, 2009, 08:28
Default
  #7
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 779
Rep Power: 19
olesen will become famous soon enough
Quote:
Originally Posted by olesen View Post
I looked into this a bit:
polySpline violates convex hull property

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.
olesen is offline   Reply With Quote

Old   December 10, 2009, 20:04
Default spline function for blockMesh
  #8
Senior Member
 
Eric Nutsch
Join Date: Sep 2009
Location: Eugene, Oregon USA
Posts: 112
Rep Power: 8
ericnutsch is on a distinguished road
Send a message via Skype™ to ericnutsch
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
ericnutsch is offline   Reply With Quote

Old   December 12, 2009, 09:32
Default
  #9
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 779
Rep Power: 19
olesen will become famous soon enough
Quote:
Originally Posted by ericnutsch View Post
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"?
olesen is offline   Reply With Quote

Old   December 12, 2009, 16:32
Default
  #10
Senior Member
 
Eric Nutsch
Join Date: Sep 2009
Location: Eugene, Oregon USA
Posts: 112
Rep Power: 8
ericnutsch is on a distinguished road
Send a message via Skype™ to ericnutsch
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!
Attached Images
File Type: jpg ellipse.jpg (92.1 KB, 218 views)
ericnutsch is offline   Reply With Quote

Old   December 13, 2009, 04:16
Default
  #11
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 779
Rep Power: 19
olesen will become famous soon enough
Quote:
Originally Posted by ericnutsch View Post
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:
polySpline violates convex hull property
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!
olesen is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
spline interpolation bajjal Main CFD Forum 0 May 29, 2006 08:27
B Spline codes rahul garg Main CFD Forum 0 May 26, 2006 21:36
spline creation siva CD-adapco 0 March 2, 2006 16:51
Import a Spline MG. CD-adapco 0 November 3, 2004 17:37
Extrusion along a spline tom CD-adapco 3 February 1, 2002 09:08


All times are GMT -4. The time now is 02:23.