Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

Aerofoil Profile Scripts

darren_13darren_13 Member, Developers Posts: 119 PRO
edited October 2016 in FeatureScript
Hi everyone,

I have created two scripts for the rapid generation of aerofoil profiles in OnShape, I have been using my first script for quite a while and seems to work well for me and thought it was about time I shared it with others.

There are two scripts available In the public document 'Aerofoil Script':
  1. NACA XXXX
  2. Profile Generator
Both of these work in a very simple way:
  1. Select/Define Profile
  2. Select plane for normal
  3. Select Leading and Trailing points (Preferably on selected plane)
  4. Ok, your done


Selecting the leading and trailing points does two things, its defines aerofoil orientation and also cord length.

NACA XXXX allows the user to define a four digit aerofoil, I could have imported CSV's and generated from these however thats a lot of files. Therefore this script calculates the profile based upon parameters, however unconventionally allows non integer numbers thus expanding use of the 4 digit system.

Profile Generator requires each profile required to be uploaded in the script, obviously I haven't the time to upload every single script. I have uploaded 3, 1 customs 2 from an aerofoil data base to test robustness. I propose that any profiles you require list them in the comments bellow and I will add them ASAP, this means the database will expand where required. It would also be handy to link the profile .dat file in 'selig' style unless it is easy to find, here is a link to the best resource in my opinion:

http://airfoiltools.com

Below are a few picture that show the scripts in use, I look forward to aerofoil profile requests and allow I am open to Ideas on how to expand existing capability. 

Kind regards,
Darren Lynch


An early wind turbine blade, using NACA XXXX and the public 3D spline script.

A wing with winglet, also using NACA XXXX and the 3D spline script.

«13

Comments

  • duane_1duane_1 Member Posts: 17 ✭✭
    Hi Darren,

    Here are few foils used in wind turbines I've been working: 

    S820, S822
    SG6042, SG6041, SG6040
    SG6050, SG6051
    GOE222, GOE601
    S4310, S4320


    I'll have to play with the 3D spline script, looks like it made a nice bend around the winglet.

    BTW: When I look at your shared example, it is not functional for me.

    Regards,

    Duane

  • darren_13darren_13 Member, Developers Posts: 119 PRO
    edited November 2016
    Hi Duane, 

    Thank you for your comment! I have hopefully sorted this out now so the example should be working. 

    I have added the profiles you were after however I should have mentioned that this script doest work well with open profiles therefore two of your profiles currently plot a curve without a selectable face, I'll start thinking about a fix for this.

    Kind regards,
    Darren
  • duane_1duane_1 Member Posts: 17 ✭✭
    Hello Darren,

    Did a quick look, and was able to use the scripts.   Adding the flip option on the NACA generator will be useful as well.

    For some ideas take a look at Qblade.

     http://q-blade.org/

    Thanks,

    Duane
  • darren_13darren_13 Member, Developers Posts: 119 PRO
    Hi Duane, Yes I see what you mean about the flip. I think I used a work around by adding a negative to the camber digit. But ill look at adding flip as its more intuitive.

    Also I'm unable to use Qblade as I'm a mac user, does it model open profiles well? how does it go about it? was thinking I could do one of two things;
    1. Add a line between the two points, basic but gets the job done
    2. add the 1st point as the last point, this will be smoother however there will be a bit of length added.
    Which do you think you would prefure?

    Kind regards,
    Darren Lynch

  • duane_1duane_1 Member Posts: 17 ✭✭
    Hi Darren,

    Yes and it is free.  Qblade has a foil generator and has tools to modify them, or create a foil from scratch.  It works well to compare foils and performance using the basic CFD analysis.

    On the trailing edge, I think adding line between the points will suffice.  The two points are very close together.

    Kind regards,

    Duane



  • darren_13darren_13 Member, Developers Posts: 119 PRO
    Hi guys just so you know I have now added a multi spline tool which essentially splines and lofts between aerofoils. You can define the accuracy to have up to 1000 splines per edge then loft using these as guides.

    Ill shorty update the documentation and add an application example.

    Kind regards
    Darren Lynch
  • fastwayjimfastwayjim Member, OS Professional, Mentor Posts: 220 PRO
    This. Is. Awesome.
  • michael_stallsmichael_stalls Member Posts: 59 PRO
    This looks Great!
  • darren_13darren_13 Member, Developers Posts: 119 PRO
    Thank you for your support guys :) 
  • darren_13darren_13 Member, Developers Posts: 119 PRO
    edited November 2016
    Hi guys, Just so you know I have now documented the Multi Spline feature. I have also updated NACA XXXX to have a default profile of NACA 0012 so that a user can define a plane and LE/TE edges and see what it looks like without needing to input all digits, this is implemented but not documented. I have also add flip into the NACA script as per @duane_1 request. Im looking at closing TE's in the profile generator script next.

    Please use and abuse my scripts and let me know what you think :) 

    Kind regards,
    Darren Lynch

    ps. you will need to update the linked document to see changes, I recommend you do this but leave the already used script's un-updated as the changes may have minor impact.
  • david_fisher031david_fisher031 Member Posts: 24 ✭✭
    edited January 2017
    Darren could you please add aerofoil HS522 to your profile generator. I have had a go at modifying my own copy https://cad.onshape.com/documents/58617bcbcec3fd1081e6dda0/w/14c073fff5640d9c20af40b5/e/b5fd615c46ab7c3bd8b3caf9 .


  • darren_13darren_13 Member, Developers Posts: 119 PRO
    Morning @david_fisher031, thanks for providing me a link :smile:  ill get this done asap.
  • darren_13darren_13 Member, Developers Posts: 119 PRO
    edited January 2017
    Hi @david_fisher031 HS522 now added. Hope this works ok for you, there is two warnings but you shouldn't receive any errors. any issues please let me know :smiley: Darren
  • _5419_5419 Member Posts: 9 ✭✭
    Hello David, thank you for your excellent work on this custom feature! 
    Could you add the following eppler foil profiles to the profile generator feature?
    Eppler E836
    http://airfoiltools.com/airfoil/seligdatfile?airfoil=e836-il

    Eppler E837
    http://airfoiltools.com/airfoil/seligdatfile?airfoil=e837-il

    Eppler E838
    http://airfoiltools.com/airfoil/seligdatfile?airfoil=e838-il

    The links are the selig format dat files you've requested. 

    Cheers, Anthony
  • darren_13darren_13 Member, Developers Posts: 119 PRO
    Hi @_5419, Glad you like my feature! I have recently done a lot of improvements to this script. The main improvement, however, is adding 1600 aerofoils to the list, this includes the Eppler 836-8 (and much more Eppler foils) does your script look like this:


    If so you should be able to find it in the list, I realise at the moment it is a mission to find your desired aerofoil but I'm having a think about how to improve this! If you are not seeing the above script (has both generator and NACA in the same script) then you might need to remove the script and re-add it.

    Let me know if this works for you (or even doesn't!)

    Kind regards,
    Darren
  • _5419_5419 Member Posts: 9 ✭✭
    Thanks Darren, I will take a peek and see if I can find it. Right now I'm struggling to determine how to turn my surface loft into a solid feature...

    After I figure that out, I'll play around with changing from NACA to Eppler, it's great that's in the same feature so I don't need to rebuild the whole thing. 

    Anthony
  • _5419_5419 Member Posts: 9 ✭✭
    Hello again, mine doesn't look like your menu item. I'm not sure how to remove and add it, I'll play around to see if I can figure it out.

    I was using a copy of your file, and adding tabs to the application examples to use the features you've created. 

    Here's link to my doc:
    https://cad.onshape.com/documents/58ca8ea34dd37e0f6849aa06/w/7cb6299da6520f5fa9e33cbb/e/b5d1f68ad2537ec5986c7acd

    Thanks
  • darren_13darren_13 Member, Developers Posts: 119 PRO
    Hi @_5419, if you follow this link:

    https://cad.onshape.com/documents/4bf18c75321ea2c8c2ea770d/w/978aece63f59e09169309756/e/de5fbb69d8eecfb3610e4e03

    Once there you should see a 'use this feature' option, it will then get added to the toolbar. If you use this method you can just update the feature every time I update it :)

    also here:
    https://www.onshape.com/featurescript

    down the page is a 'START USING CUSTOM FEATURES' video.

    Hope this helps,
    Darren
  • darren_13darren_13 Member, Developers Posts: 119 PRO
    @_5419, I took a look at your document and interesting use for it. I'm currently doing an update for this script which will allow the user to define a rounded trailing edge. So whilst I'm editing would be good to hear your feedback.

    I also saw you were using many 3D splines as guides for lofting, did you know that I have a multispline lofting feature for aerofoils exactly for this job? if so was it not good in your application? and how could I modify it for your needs?

    Sorry for the number of questions :smiley:

    Kind regards,
    Darren
  • darren_13darren_13 Member, Developers Posts: 119 PRO
    Hi guys, 

    Firstly I just wanted to say I have been busy updating the profile generator script and I haven't had the opportunity to announce it yet... So this is me announcing "Check out my latest update!!" :)



    *Note there is a current issue with the manipulator.

    So this got me thinking, I keep updating this script with lots of options that I need, however, in general use are these options needed? I could hide some options and show then in some sort of 'advance mode' or if people use these options as much as I do then I would obviously just leave them in. As a reminder here is what the current GUI looks like:



    This is just a screen grab from the documentation, much of these options are hidden under the enums such as TE type etc, however, the types could be hidden and only produce a single spline aerofoil unless in advance mode. Or as I said leave as is. 

    So right now If you have a preference let me know otherwise I'll leave current options in and decide wich future options are relevant.

    Also, I don't think I have had a chance to properly announce my 'Wing structure script':


    Full documentation for this is now provided, but better still see 'application example 4 - FEA' as this shows the steps taken to create the above structure. This script is new so please report any issues you find with me. There is currently only one know 'bug' where the thickness is incorrect for one of the options. 

    Finally, I just wanted to share an insight into the direction of these scripts.
    • Complete parametric aerofoils starting with a twin circle and twin spline type aerofoil and progressing over time.
    • Integrated testing and debugging into the code to allow me and any user to see what is happening internally simply with an input of a string.
    • Making 'Aerofoil functions' module public and documented for using within custom scripts.
    • Wing structure updates to include aerodynamic features and call it 'Wing Features' or something similar (this is to adapt the script for some of my CFD work).
    So that's all I want to say, any feedback is always welcome.

    Cheers,
    Darren
  • michael_stallsmichael_stalls Member Posts: 59 PRO
    edited July 2017
    Hi 
    Im interested in finding out how to use the wing structure tool. i've made few wing structures  like the one below myself and it's a bit tedious.....Looks like This could be huge help to me! is there a guide to how to use the multi spline and wing structure Featurescript? (where do i find Application example 4 FEA?? ) i cant seem to get it to work properly. Cheers
    Michael
  • darren_13darren_13 Member, Developers Posts: 119 PRO
    Hi @michael_stalls, these are very nice designs.

    I have the documentation which gives an overview of steps and the above-mentioned application example:

    https://cad.onshape.com/documents/4bf18c75321ea2c8c2ea770d/w/978aece63f59e09169309756/e/10159a5a243e6d7e2b619a5e
    (Application examples>Application example 4 (FEA)).

    I just loaded it and seems to work on mine, however, if you made a copy and you have linked my latest scripts I can see you would have issues. The reason being I have retired the NACA script (which the application example uses) in favour of its parent 'Profile Generator' I will update this tonight as it is very important to have this example working. for now, just explore it in the read-only document, sorry.

    As for multi-spline, I no longer see this as the way to go as the recently beefed loft function does very well. I use a line through the centre of the aerofoils and loft using the additional profiles thing. I get really good results here, that said if your lazy like me multispline is quick.

    If your still having troubles you can add me to your practice project or something and we can get it going with a basic setup.

    The code is quite expandable so if you have any suggestions then please let me know :)

    As an afterthought, looking at the wing tips of your design you might want to try surfacing instead of multi-spline anyway. Multi-spline only supports profiles (not mixed like edges to aerofoils etc.)

    Anything else just give me a shout!
    Darren
  • darren_13darren_13 Member, Developers Posts: 119 PRO
    Hi @michael_stalls I have updated App Ex 4 FEA with all the latest scripts, a bit of modification had to be done due to the recent changes to loft.

    Kind regards,
    Darren
  • michael_stallsmichael_stalls Member Posts: 59 PRO
    Hi @darren_13  Thanks alot for this ! this script is great ! 
  • david_fisher031david_fisher031 Member Posts: 24 ✭✭
    Hi @darren_13 I am trying to use the wing generator to make an rc 3d printed  wing. The problem is in getting multi-rib to work when I turn the ribs in one direction. Add on plane works in both directions. The screenshot below where the ribs with four in one orientation works for both methods the other orientation works for only add on plane. https://cad.onshape.com/documents/a5fe39b188f380c9b90f1913/w/8eabf5348365d6b57ec18942/e/15a1ed2cc889dd779a13cebf

    Some of the rc 3D printed wings have curved ribs https://3dlabprint.com/shop/spitfire-mk-xvi-s3d-cura-ready/  would this be possible to achieve with the script ?

    Thanks for the script it's going to save a lot of work.
  • darren_13darren_13 Member, Developers Posts: 119 PRO
    Hi @david_fisher031, sorry for the late response. I copied over your project and it seems I had problems when going the opposite direction i.e. on the first project I couldn't multi rib the other wing. This is a silly error and I hope to get time to fix this shortly, in the meantime, however, I found if you assign the points to be opposite it works, so by that I mean to assign the base to tip and vice versa.

    In response to arc like ribs, unfortunately not at the moment although it would interest me to expand the script to cater for more general use, I imagine I could do this by allowing you to sketch an arc to follow, however, I don't see me having time to do this in the near future, really sorry. I would suggest just create an arc shape solid and boolean it with the wing to get the desired shape, patterning the arc shape would allow a more automated approach to this.

    Thank you very much for posting, I very much like to receive feedback and see how the scripts are used, I will post again once the issue has been fixed.

    Kind regards,
    Darren
  • bill_danielsbill_daniels Member Posts: 278 ✭✭✭
    Hi @darren_13 I am trying to use the wing generator to make an rc 3d printed  wing. The problem is in getting multi-rib to work when I turn the ribs in one direction. Add on plane works in both directions. The screenshot below where the ribs with four in one orientation works for both methods the other orientation works for only add on plane. https://cad.onshape.com/documents/a5fe39b188f380c9b90f1913/w/8eabf5348365d6b57ec18942/e/15a1ed2cc889dd779a13cebf

    Some of the rc 3D printed wings have curved ribs https://3dlabprint.com/shop/spitfire-mk-xvi-s3d-cura-ready/  would this be possible to achieve with the script ?

    Thanks for the script it's going to save a lot of work.
    As an old "Slide-Rule" aerospace engineer. I'm wondering why you chose diagonal ribs in the first place.  Structurally, in a full-size aircraft, the ribs carry very little of the loads.  It's the span-wise spars which carry the bending loads and a leading edge "D" tube which carries the torsional loads.  Those ribs just add weight.

    I'm seriously considering taking up the RC model airplane hobby again given the advent of 3D printing and electric propulsion so I'm paying close attention.
  • justin_carrolljustin_carroll Member Posts: 4
    I have been experimenting with different ways to 3d print RC wings.  The best way I have found so far is to use methods similar to the methods the guy here uses ( https://3dprintedrcplanes.com/ )  I tried several methods but most were quite heavy, especially when the skin is printed.  

    I was curious about the angled ribs until I started printing them.  The wings that I have printed are printed vertically. (wingspan is vertical)  When 3d printing it is nearly impossible to print horizontal surfaces (except the on the bed) without a printing a great deal of support for the surface.  This support adds a great deal of time to a print that already is taking a very long time.  When printed the angle of the ribs allows the printing of the structure without any support.  

    Here: https://cad.onshape.com/documents/036c42b11608e644f19f3541/w/194e03a1b72bfb9967a180ba/e/deef0361d1ef6e5782d028d7 is a test wing section that I have been experimenting with.  It was time-consuming and is in need of a script to automate.  Carbon fiber tube would be used as a spar.
  • justin_carrolljustin_carroll Member Posts: 4
    I am using Airfoil Profile Scripts to generate a rib shape that I then turn into templates for foam cutting.  I need to offset the profile to allow for the thickness of the cutting wire.  I am unable to offset the all or part of the profile.  

    The Airfoil Profile Scripts don't seem to "return" an offsettable drawing.

    I consider myself a newbie to 3d modeling and may just be ignorant of an obvious solution.  Would someone point me to a solution?

    My templated drawing is HERE
  • darren_13darren_13 Member, Developers Posts: 119 PRO
    Hi @justin_carroll, I think offsetting a sketch has troubles as you mentioned, however, if you have a solid I believe thicken works well.

    As for automating, where do you think automation is needed in your workflow?

    Many thanks,
    Darren
Sign In or Register to comment.