Skip to content

feat: export for CAD, ParaView and OpenFOAM - #16

Open
PSamuele wants to merge 1 commit into
chore/remove-example-resultsfrom
feat/cad-cfd-export
Open

PSamuele wants to merge 1 commit into
chore/remove-example-resultsfrom
feat/cad-cfd-export

Conversation

@PSamuele

Copy link
Copy Markdown
Contributor

What

New module naca_core/export.py. At the end of a run both optimizers write an export/ subfolder with the optimized airfoil in four formats, scaled with the chord entered in the setup:

File For
<name>.dxf CAD: closed 2D profile in mm (spline through the points + trailing-edge line), ready to extrude
<name>_mm.csv CAD: x,y,z points in mm, no header, trailing edge left open
<name>_surface.vtk ParaView: airfoil contour in m with Cp and V/Vinf from the in-house panel method
<name>_wing.stl OpenFOAM (snappyHexMesh), CAD, 3D printing: airfoil extruded along z, watertight, in m

Other changes:

  • New prompt Enter span for the 3D export (m), default = chord. It only sets the length of the extrusion in the STL.
  • ezdxf added to requirements.txt and to the start-up library check.
  • README: new section "Using the exported files" (CAD, ParaView, OpenFOAM), export files in the Output table, and the export values in the Reference table.

The .dat file is unchanged: it is the format XFOIL needs.

Verified

  • Five airfoils, including the extremes of the search range: DXF in mm and closed (the spline stays within 7 micrometres of the exact NACA curve for a 250 mm chord); STL watertight with consistent normals and volume equal to area x span; VTK read back with the VTK library (the ParaView engine), Cp identical to the panel method; CSV points and scale correct.
  • OpenFOAM v1912: surfaceCheck reports a closed surface, one zone, consistent normals, no illegal triangles; snappyHexMesh removes the cells inside the airfoil and ends with "Finished meshing without any errors".
  • Windows: full in-house run with chord 0.25 m. The CSV spans 0 to 250 mm in x and 28 mm in height (t = 0.1118 x 250 = 27.95 mm), 399 points. The DXF opens in CAD as a closed profile at the right size.

Depends on

#14 (base branch: chore/remove-example-results).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant