gdtk-uq / gdtk

The Gas Dynamics Toolkit (GDTk) is a set of software tools for simulating high speed fluid flow, maintained at The University of Queensland and the University of Southern Queensland, Australia.
https://gdtk.uqcloud.net/
Other
59 stars 15 forks source link

Gridding and Spline Issue #23

Closed zlpurdue closed 1 year ago

zlpurdue commented 1 year ago

Hello all,

I was trying to set up a grid and ran into this gridding issue when using the spline2 function.

Grid_Structure

It looks like the generated spline loops back on itself causing the gridding to mess up. When using the same spline control points in MATLAB, which if I understand correctly uses same spline generation algorithm, the generated spline did not have this issue.

I got around the issue by generating the spline in MATLAB and grabbing more points to force the correct spline using the spline2 function. This might have been just an issue with my control points but if it is a bug just wanted you to be aware. I've attached the original control points.

Nozzle_Contour_Points.txt

uqngibbo commented 1 year ago

Hi zl,

It looks like this is an issue with Spline2, which doesn't like having large changes in the gaps between control points. However, it's not exactly a bug, and seems to be the intended behaviour.

One workaround is what you've already done to smooth them out, but using Xspline2 (which is the classic spline algorithm found in Matlab) with the old control points also seems to fix it.

Thanks for the feedback. I will ask about Spline2 at our next devs meeting.