Skip to content

A python script to generate the ROBIN fuselage geometry

License

Notifications You must be signed in to change notification settings

cibinjoseph/genROBIN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

screenshot

genROBIN.py

A python script to create mesh geometry for the ROBIN (ROtor Body INteraction) generic helicopter fuselage.

Usage

The program takes 4 integers as input. These represent the number of sections in the lengthwise and circumferential directions for the fuselage and pylon surface geometry. The required output mesh filetype can also be specified with the -f flag.

Quick example

./genRobin.py -f vtk 48 32 24 24

The command writes out two triangle mesh files robinFuselage and robinPylon which contain the fuselage and the pylon geometry. If the -f flag is skipped, the .obj file format is used by default. Other mesh formats are handled using the meshio module.

Detailed usage

genROBIN.py [-h] [-f {csv,dat,obj,ply,stl,vtu,vtk}]
               nxFuselage ntFuselage nxPylon ntPylon

positional arguments:
  nxFuselage            No. of lengthwise elements for fuselage
  ntFuselage            No. of circumferential elements for fuselage
  nxPylon               No. of lengthwise elements for pylons
  ntPylon               No. of circumferential elements for pylons

optional arguments:
  -h, --help            show this help message and exit
  -f {csv,dat,obj,ply,stl,vtu,vtk}
                        Geometry file type

Script usage

genROBIN may also be used by importing as a module as shown below.

import genROBIN as gr

# Create and write out fuselage geometry
x, y, z = gr.getVertices(nx=48, nt=32)
gr.writeOBJ(x, y, z, "robinFuselage.obj")

# Create and write out pylon geometry
x, y, z = gr.getVertices(nx=24, nt=24, isPylon=True)
gr.writeOBJ(x, y, z, "robinPylon.obj")

x, y, z are 2D arrays with the first index along the axis of the geometry, representing each lateral cross-section. The second index represents the coordinates on the geometry at that cross-sectional slice.

Output formats

genROBIN can output mesh geometry in the following file types.

  1. CSV .csv
  2. Tecplot .dat
  3. OBJ .obj
  4. PLY .ply
  5. STL .stl
  6. VTU .vtu
  7. VTK .vtk

Notes

This script generates triangular surface elements. The mesh can be converted to quad elements easily using the Recombine 2D operation in GMSH. GMSH can also be used to generate higher-order elements from the mesh output from this script. STL mesh files reported the least amount of failures when importing into GMSH. The following example python script converts tri elements to quad using the gmsh python API.

import gmsh

gmsh.initialize()
gmsh.open("robinFuselage.stl")
gmsh.model.mesh.recombine()       # Convert tri to quad elements
gmsh.model.mesh.setOrder(2)       # Convert to 2nd order elements
gmsh.write("robinFuselage.msh")
gmsh.finalize()

ROBINToGMSH

Acknowledgements

This script was created by referencing robin-surface-mesh. The authors are duly acknowledged. They report that several corrections were necessary to coefficient data from the originally published reports (Refs. 1, 2) to generate the right shape and avoid obtaining NaNs.

About

A python script to generate the ROBIN fuselage geometry

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages