NACA Airfoils Code - Verify C++ Conversion (Depends on #4)BRL-CAD
Status: ClosedTime to complete: 100 hrs Mentors: Gauravjeet Singh, Ch3ckTags: c, code, c++, airfoils, transcoding, translation, fortran

The NACA airfoils are airplane wing shapes developed by the National Advisory Committee for Aeronautics (NACA). These shapes are described by a series of digits, which are translated into actual shapes by a series of computer programs. These programs date back several decades, and were written in Fortran.

BRL-CAD's interest in this code is as a possible means of procedurally generating wing geometry in BRL-CAD models, but we would prefer to have the shape generating logic in one of BRL-CAD's standard languages - C or C++. The target code for this effort is a modernization of older NACA codes by Ralph Carmichael called naca456.

The initial conversion will attempt to precisely reproduce the functionality as currently expressed in the Fortran code - any more elaborate reworking of the logic will be evaluated after we have a C/C++ version that reproduces the Fortran outputs correctly.

This task depends on the successful completion of tasks #1 - #4 - this file makes use of the files from those tasks. Students shouldn't claim (and mentors shouldn't assign) this task until the others are complete.

Your task involves the following steps:

  1. Download and build the original naca456 from http://www.pdas.com/naca456download.html
  2. Verify that the samples at http://www.pdas.com/naca456samples.html work correctly with the original naca456
  3. Check out the git repository: git clone https://github.com/starseeker/naca
  4. Build the C++ naca456 (cd naca; mkdir build; cd build; cmake ..; make)
  5. Repeat the tests performed with the original naca456 using the new C++ version.
  6. Compare the outputs and make note of any differences.
  7. Correct the C++ code to make the new outputs, if any differences are observed.
  8. Submit any necessary patches, either to the task or via a github pull request if you prefer to work in a git fork.

References:
  • http://www.pdas.com/naca456.html
  • https://github.com/starseeker/naca
Uploaded Work
File name/URLFile sizeDate submitted
task-36-verify-fix-naca-airfoils.diff50.2 KBDecember 21 2014 00:58 UTC
Comments
Andromeda Galaxyon December 20 2014 03:17 UTCTask Claimed

I would like to work on this task.

Sean on December 20 2014 03:43 UTCTask Assigned

This task has been assigned to Andromeda Galaxy. You have 100 hours to complete this task, good luck!

Andromeda Galaxyon December 21 2014 00:58 UTCDiff file status

This diff file includes the changes from the previous two tasks (convert #4 and #3.5), because it makes several modifications to those files, and I'm diffing from master; I didn't want to commit those files because I thought it likely that they would still need some work.


This patch should make the first 3 test cases on the linked site work; the output differs only in a small amount of whitespace and in that some of the numbers have small differences from the originals, which I believe are due to rounding error from the fact that C sometimes requires several operations to achieve what Fortran does in one, sometimes with a difference in ordering between them.  I decided to submit this one with only the first 3 working because getting this far has already required 6hrs, and the previous two tasks both took ~5hrs each.

Andromeda Galaxyon December 21 2014 00:58 UTCReady for review

The work on this task is ready to be reviewed.

Sean on December 21 2014 03:00 UTCTask Closed

Congratulations, this task has been completed successfully.