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

[blockMesh] How to use the spline commands

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 20, 2007, 07:53
Default How to use the spline commands
  #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, 15: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: 17
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, 18: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: 740
Rep Power: 28
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: 113
Rep Power: 17
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: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
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:
http://www.cfd-online.com/Forums/ope...-property.html

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: 113
Rep Power: 17
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: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by olesen View Post
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.
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: 113
Rep Power: 17
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: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
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: 113
Rep Power: 17
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, 425 views)
ericnutsch is offline   Reply With Quote

Old   December 13, 2009, 04:16
Default
  #11
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
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:
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!
olesen 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
airfoil edge via spline in OpenFOAM v6 jkampman Mesh Generation & Pre-Processing 0 November 26, 2018 06:19
[DesignModeler] spline or bezier or B spline panasonic ANSYS Meshing & Geometry 0 February 4, 2017 01:19
Save picture from Execute commands and journal files FJSJ FLUENT 0 January 29, 2015 09:56
Please explain this commands. sri31049 FLUENT 3 March 20, 2009 05:38
Spline through multiple keypoints Liaquat CFX 0 May 17, 2007 13:11


All times are GMT -4. The time now is 04:33.