├── .gitattributes ├── .gitignore ├── AirfoilGenerator.glf ├── LICENSE ├── NACAImage.png ├── README.md └── ScriptImage.png /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | 5 | *.pydevproject 6 | .project 7 | .metadata 8 | bin/ 9 | tmp/ 10 | *.tmp 11 | *.bak 12 | *.swp 13 | *~.nib 14 | local.properties 15 | .classpath 16 | .settings/ 17 | .loadpath 18 | 19 | # External tool builders 20 | .externalToolBuilders/ 21 | 22 | # Locally stored "Eclipse launch configurations" 23 | *.launch 24 | 25 | # CDT-specific 26 | .cproject 27 | 28 | # PDT-specific 29 | .buildpath 30 | 31 | 32 | ################# 33 | ## Visual Studio 34 | ################# 35 | 36 | ## Ignore Visual Studio temporary files, build results, and 37 | ## files generated by popular Visual Studio add-ons. 38 | 39 | # User-specific files 40 | *.suo 41 | *.user 42 | *.sln.docstates 43 | 44 | # Build results 45 | [Dd]ebug/ 46 | [Rr]elease/ 47 | *_i.c 48 | *_p.c 49 | *.ilk 50 | *.meta 51 | *.obj 52 | *.pch 53 | *.pdb 54 | *.pgc 55 | *.pgd 56 | *.rsp 57 | *.sbr 58 | *.tlb 59 | *.tli 60 | *.tlh 61 | *.tmp 62 | *.vspscc 63 | .builds 64 | *.dotCover 65 | 66 | ## TODO: If you have NuGet Package Restore enabled, uncomment this 67 | #packages/ 68 | 69 | # Visual C++ cache files 70 | ipch/ 71 | *.aps 72 | *.ncb 73 | *.opensdf 74 | *.sdf 75 | 76 | # Visual Studio profiler 77 | *.psess 78 | *.vsp 79 | 80 | # ReSharper is a .NET coding add-in 81 | _ReSharper* 82 | 83 | # Installshield output folder 84 | [Ee]xpress 85 | 86 | # DocProject is a documentation generator add-in 87 | DocProject/buildhelp/ 88 | DocProject/Help/*.HxT 89 | DocProject/Help/*.HxC 90 | DocProject/Help/*.hhc 91 | DocProject/Help/*.hhk 92 | DocProject/Help/*.hhp 93 | DocProject/Help/Html2 94 | DocProject/Help/html 95 | 96 | # Click-Once directory 97 | publish 98 | 99 | # Others 100 | [Bb]in 101 | [Oo]bj 102 | sql 103 | TestResults 104 | *.Cache 105 | ClientBin 106 | stylecop.* 107 | ~$* 108 | *.dbmdl 109 | Generated_Code #added for RIA/Silverlight projects 110 | 111 | # Backup & report files from converting an old project file to a newer 112 | # Visual Studio version. Backup files are not needed, because we have git ;-) 113 | _UpgradeReport_Files/ 114 | Backup*/ 115 | UpgradeLog*.XML 116 | 117 | 118 | 119 | ############ 120 | ## Windows 121 | ############ 122 | 123 | # Windows image file caches 124 | Thumbs.db 125 | 126 | # Folder config file 127 | Desktop.ini 128 | 129 | 130 | ############# 131 | ## Python 132 | ############# 133 | 134 | *.py[co] 135 | 136 | # Packages 137 | *.egg 138 | *.egg-info 139 | dist 140 | build 141 | eggs 142 | parts 143 | bin 144 | var 145 | sdist 146 | develop-eggs 147 | .installed.cfg 148 | 149 | # Installer logs 150 | pip-log.txt 151 | 152 | # Unit test / coverage reports 153 | .coverage 154 | .tox 155 | 156 | #Translations 157 | *.mo 158 | 159 | #Mr Developer 160 | .mr.developer.cfg 161 | 162 | # Mac crap 163 | .DS_Store 164 | -------------------------------------------------------------------------------- /AirfoilGenerator.glf: -------------------------------------------------------------------------------- 1 | ############################################################################# 2 | # 3 | # (C) 2021 Cadence Design Systems, Inc. All rights reserved worldwide. 4 | # 5 | # This sample script is not supported by Cadence Design Systems, Inc. 6 | # It is provided freely for demonstration purposes only. 7 | # SEE THE WARRANTY DISCLAIMER AT THE BOTTOM OF THIS FILE. 8 | # 9 | ############################################################################# 10 | 11 | # =============================================== 12 | # NACA 4-SERIES AIRFOIL GENERATOR 13 | # =============================================== 14 | # Written by Travis Carrigan 15 | # 16 | # v1: Dec 15, 2010 17 | # v2: May 30, 2013 18 | # 19 | 20 | # Load Pointwise Glyph package and Tk 21 | package require PWI_Glyph 22 | pw::Script loadTk 23 | 24 | # AIRFOIL GUI INFORMATION 25 | # ----------------------------------------------- 26 | set naca 0012 27 | set sharp 1 28 | wm title . "Airfoil Generator" 29 | grid [ttk::frame .c -padding "5 5 5 5"] -column 0 -row 0 -sticky nwes 30 | grid columnconfigure . 0 -weight 1; grid rowconfigure . 0 -weight 1 31 | grid [ttk::labelframe .c.lf -padding "5 5 5 5" -text "NACA 4-Series Airfoil Generator"] 32 | grid [ttk::label .c.lf.nacal -text "NACA"] -column 1 -row 1 -sticky e 33 | grid [ttk::entry .c.lf.nacae -width 5 -textvariable naca] -column 2 -row 1 -sticky e 34 | grid [ttk::frame .c.lf.te] -column 3 -row 1 -sticky e 35 | grid [ttk::radiobutton .c.lf.te.sharprb -text "Sharp" -value 1 -variable sharp] -column 1 -row 1 -sticky w 36 | grid [ttk::radiobutton .c.lf.te.bluntrb -text "Blunt" -value 0 -variable sharp] -column 1 -row 2 -sticky w 37 | grid [ttk::button .c.lf.gob -text "CREATE" -command airfoilGen] -column 4 -row 1 -sticky e 38 | foreach w [winfo children .c.lf] {grid configure $w -padx 10 -pady 10} 39 | focus .c.lf.nacae 40 | ::tk::PlaceWindow . widget 41 | bind . {airfoilGen} 42 | 43 | proc airfoilGen {} { 44 | 45 | # AIRFOIL INPUTS 46 | # ----------------------------------------------- 47 | # m = maximum camber 48 | # p = maximum camber location 49 | # t = maximum thickness 50 | set m [expr {[string index $::naca 0]/100.0}] 51 | set p [expr {[string index $::naca 1]/10.0}] 52 | set a [string index $::naca 2] 53 | set b [string index $::naca 3] 54 | set c "$a$b" 55 | scan $c %d c 56 | set t [expr {$c/100.0}] 57 | set s $::sharp 58 | 59 | # GENERATE AIRFOIL COORDINATES 60 | # ----------------------------------------------- 61 | # Initialize Arrays 62 | set x {} 63 | set xu {} 64 | set xl {} 65 | set yu {} 66 | set yl {} 67 | set yc {0} 68 | set yt {} 69 | 70 | # Airfoil step size 71 | set ds 0.001 72 | 73 | # Check if airfoil is symmetric or cambered 74 | if {$m == 0 && $p == 0 || $m == 0 || $p == 0} {set symm 1} else {set symm 0} 75 | 76 | # Get x coordinates 77 | for {set i 0} {$i < [expr {1+$ds}]} {set i [expr {$i+$ds}]} {lappend x $i} 78 | 79 | # Calculate mean camber line and thickness distribution 80 | foreach xx $x { 81 | 82 | # Mean camber line definition for symmetric geometry 83 | if {$symm == 1} {lappend yc 0} 84 | 85 | # Mean camber line definition for cambered geometry 86 | if {$symm == 0 && $xx <= $p} { 87 | lappend yc [expr {($m/($p**2))*(2*$p*$xx-$xx**2)}] 88 | } elseif {$symm == 0 && $xx > $p} { 89 | lappend yc [expr {($m/((1-$p)**2)*(1-2*$p+2*$p*$xx-$xx**2))}] 90 | } 91 | 92 | # Thickness distribution 93 | if {$s} { 94 | lappend yt [expr {($t/0.20)*(0.29690*sqrt($xx)-0.12600*$xx- \ 95 | 0.35160*$xx**2+0.28430*$xx**3-0.1036*$xx**4)}] 96 | } else { 97 | lappend yt [expr {($t/0.20)*(0.29690*sqrt($xx)-0.12600*$xx- \ 98 | 0.35160*$xx**2+0.28430*$xx**3-0.1015*$xx**4)}] 99 | } 100 | 101 | # Theta 102 | set dy [expr {[lindex $yc end] - [lindex $yc end-1]}] 103 | set th [expr {atan($dy/$ds)}] 104 | 105 | # Upper x and y coordinates 106 | lappend xu [expr {$xx-[lindex $yt end]*sin($th)}] 107 | lappend yu [expr {[lindex $yc end]+[lindex $yt end]*cos($th)}] 108 | 109 | # Lower x and y coordinates 110 | lappend xl [expr {$xx+[lindex $yt end]*sin($th)}] 111 | lappend yl [expr {[lindex $yc end]-[lindex $yt end]*cos($th)}] 112 | 113 | } 114 | 115 | # GENERATE AIRFOIL GEOMETRY 116 | # ----------------------------------------------- 117 | # Create upper airfoil surface 118 | set airUpper [pw::Application begin Create] 119 | set airUpperPts [pw::SegmentSpline create] 120 | 121 | for {set i 0} {$i < [llength $x]} {incr i} { 122 | $airUpperPts addPoint [list [lindex $xu $i] [lindex $yu $i] 0] 123 | } 124 | 125 | set airUpperCurve [pw::Curve create] 126 | $airUpperCurve addSegment $airUpperPts 127 | $airUpper end 128 | 129 | # Create lower airfoil surface 130 | set airLower [pw::Application begin Create] 131 | set airLowerPts [pw::SegmentSpline create] 132 | 133 | for {set i 0} {$i < [llength $x]} {incr i} { 134 | $airLowerPts addPoint [list [lindex $xl $i] [lindex $yl $i] 0] 135 | } 136 | 137 | set airLowerCurve [pw::Curve create] 138 | $airLowerCurve addSegment $airLowerPts 139 | $airLower end 140 | 141 | if {!$s} { 142 | # Create flat trailing edge 143 | set airTrail [pw::Application begin Create] 144 | set airTrailPts [pw::SegmentSpline create] 145 | $airTrailPts addPoint [list [lindex $xu end] [lindex $yu end] 0] 146 | $airTrailPts addPoint [list [lindex $xl end] [lindex $yl end] 0] 147 | set airTrailCurve [pw::Curve create] 148 | $airTrailCurve addSegment $airTrailPts 149 | $airTrail end 150 | } 151 | 152 | # Zoom to airfoil geometry 153 | pw::Display resetView 154 | 155 | exit 156 | 157 | } 158 | 159 | # END SCRIPT 160 | 161 | ############################################################################# 162 | # 163 | # This file is licensed under the Cadence Public License Version 1.0 (the 164 | # "License"), a copy of which is found in the included file named "LICENSE", 165 | # and is distributed "AS IS." TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE 166 | # LAW, CADENCE DISCLAIMS ALL WARRANTIES AND IN NO EVENT SHALL BE LIABLE TO 167 | # ANY PARTY FOR ANY DAMAGES ARISING OUT OF OR RELATING TO USE OF THIS FILE. 168 | # Please see the License for the full text of applicable terms. 169 | # 170 | ############################################################################# 171 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Cadence Public License Version 1.0 2 | 3 | May 2021 4 | 5 | BY USING, REPRODUCING, DISTRIBUTING, AND/OR OTHERWISE ACCESSING THIS 6 | TECHNOLOGY, YOU AGREE TO THE TERMS OF THIS CADENCE PUBLIC LICENSE 7 | VERSION 1.0 (THE "AGREEMENT"). 8 | 9 | 1. License Grant. Subject to the terms and conditions specified herein, You 10 | are hereby granted a perpetual, non-exclusive, no-charge license to Use the 11 | Technology for any purpose, which includes without limitation, the right to 12 | access, copy, modify, merge, publish, redistribute, sublicense, and/or sell 13 | (collectively, to "Use") copies of the Technology. 14 | 15 | 2. Distributions. 16 | 17 | i. Copyright Notice and Agreement Text. The Copyright Notice and the full 18 | text of this Cadence Public License Version 1.0 shall be included in all 19 | copies of the Technology, or substantial portions thereof. (For clarity, if 20 | You are redistributing the Technology in source code form, then you 21 | must ensure that the Copyright Notice and Agreement are left intact; if 22 | You are redistributing the Technology in binary or non-source code 23 | form, then you must ensure that the Copyright Notice and Agreement are 24 | reproduced and included in an attribution file, such as a "NOTICES", 25 | "COPYRIGHT", or other equivalent file.) 26 | 27 | ii. Modifications. Any distribution of modified Technology must include a 28 | prominent notice in the corresponding file(s) indicating that the file(s) 29 | was modified by You. You may license Your modifications under different 30 | or additional license terms. 31 | 32 | 3. Endorsement. Neither the name of the copyright holder nor the names of its 33 | contributors may be used to endorse or promote products derived from the 34 | Technology without specific prior written permission. 35 | 36 | 4. Trademarks. Except for attribution purposes (as described in Sec. 2(i), 37 | above) and as may otherwise be agreed in writing, You do not have 38 | permission to use the trade names, trademarks, service marks, or product 39 | names of the copyright holder or contributor(s). 40 | 41 | 5. Termination. 42 | 43 | i. Patent Litigation. If You institute patent litigation against any entity 44 | (including a cross-claim or counterclaim in a lawsuit) alleging that the 45 | Technology constitutes direct or contributory patent infringement, then any 46 | patent licenses granted to You under this Agreement shall terminate as of 47 | the date such litigation is filed. 48 | 49 | ii. Breach. This Agreement, and the license granted hereunder, shall 50 | immediately terminate if You (a) fail to comply with any material terms or 51 | conditions and (b) fail to cure your lack of compliance within a reasonable 52 | time of becoming aware. 53 | 54 | 6. Disclaimer or Warranty. UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN 55 | WRITING, THE TECHNOLOGY IS PROVIDED BY THE COPYRIGHT HOLDERS AND 56 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 57 | NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 58 | PARTICULAR PURPOSE ARE DISCLAIMED. 59 | 60 | 7. Limitation of Liability. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 61 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 62 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 63 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 64 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 65 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 66 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 67 | TECHNOLOGY, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 68 | 69 | 8. Stewardship. While everyone is permitted to copy and distribute copies of 70 | this Agreement, it may only be modified by the Steward. The Steward may 71 | publish new versions (including revisions) of the Agreement. For clarity, 72 | the Technology may always be distributed subject to the version of the 73 | Agreement under which it was received. In addition, after a new version of 74 | the Agreement is published, Licensor may elect to distribute the Technology 75 | under the new version. 76 | 77 | 9. Definitions. 78 | 79 | i. "Copyright Notice" means a notice that includes the name of the 80 | copyright holder, a copyright symbol (or equivalent), a date, and, at the 81 | owner's election, a statement of rights. 82 | 83 | ii. "Licensee" means any person or entity that receives the Technology 84 | under this Agreement. 85 | 86 | iii. "Licensor" means any person or entity that distributes the Technology. 87 | 88 | iv. "Steward" means Cadence Design Systems, Inc., which may assign the 89 | responsibility to serve as Steward to a suitable separate entity. 90 | 91 | v. "Technology" means the work of authorship, whether in source code, 92 | binary, or other form, made available under this Agreement, as indicated by 93 | a Copyright Notice that is included in or attached to the Technology. 94 | 95 | vi. "You" (or "Your") means a person or entity exercising permissions 96 | granted by this Agreement. 97 | -------------------------------------------------------------------------------- /NACAImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pointwise/AirfoilGenerator/5b4336bbff8b5e0144e63d14303bfa5b660f29e2/NACAImage.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AirfoilGenerator 2 | Copyright 2021 Cadence Design Systems, Inc. All rights reserved worldwide. 3 | 4 | A Glyph script for generating NACA 4-series airfoil geometries. 5 | 6 | ![AirfoilGenGUI](https://raw.github.com/pointwise/AirfoilGenerator/master/ScriptImage.png) 7 | 8 | ## Generating Geometry 9 | This script provides a way to generate NACA 4-Series airfoil geometries within Pointwise without relying on external coordinate files. Simply input the 4 digits defining a NACA 4-Series airfoil and click CREATE. Airfoils can be generated with either sharp or blunt trailing edges. 10 | 11 | ### NACA 4-Series Geometry Description 12 | * The 1st digit is the maximum camber 13 | * The 2nd digit is the maximum camber location 14 | * The 3rd and 4th digits represent the maximum thickness 15 | 16 | ### Notes 17 | * All digits are a percentage of the chord length 18 | * Maximum thickness occurs at 30% of the chord 19 | * Chord length fixed to a unit length 20 | 21 | ### Example, NACA 2412 22 | * Maximum camber is 2% of the chord 23 | * Maximum camber located at 40% of the chord 24 | * Maximum thickness is 12% of the chord (located at 30% of the chord) 25 | 26 | ![NACA2412](https://raw.github.com/pointwise/AirfoilGenerator/master/NACAImage.png) 27 | 28 | ## Disclaimer 29 | This file is licensed under the Cadence Public License Version 1.0 (the "License"), a copy of which is found in the LICENSE file, and is distributed "AS IS." 30 | TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, CADENCE DISCLAIMS ALL WARRANTIES AND IN NO EVENT SHALL BE LIABLE TO ANY PARTY FOR ANY DAMAGES ARISING OUT OF OR RELATING TO USE OF THIS FILE. 31 | Please see the License for the full text of applicable terms. 32 | 33 | -------------------------------------------------------------------------------- /ScriptImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pointwise/AirfoilGenerator/5b4336bbff8b5e0144e63d14303bfa5b660f29e2/ScriptImage.png --------------------------------------------------------------------------------