AifoilGmsh.jl
Documentation of AifoilGmsh.jl for speeding up the creation of airfoil in GMSH
AirfoilGmsh.create_geofile
— Functioncreate_geofile(filename::String; Reynolds = -1, h0 = -1, leading_edge_points = Int64[], trailing_edge_points = Int64[], chord=1.0, dimension=2, elements = :QUAD, open_geo = true)
It is the main function of the package. From a csv file containing the airfoil points it creates a .geo file. The .geo file can be created using the function from_url_to_csv
. The user can specify just the file name.
create_geofile("naca0012.csv")
It is also possibile to provide extra arguments such as the Reynolds number and/or the first layer height for a better extimation of the boundary-cell properties. It is possible to overwrite the extimation of the trailing edge and leading edge made by the code providing the relative points numbers. The mesh can be created in 2D or 3D. In 3D case by default are created periodic boundary conditions in the z
direction. It is possible to create a mesh with the following options:
Type of element | Dimension | Symbol |
---|---|---|
Quadrilateral | 2D | :QUAD |
Hexaedral | 3D | :HEX |
Triangular | 2D | :TRI |
Thetraedreal | 3D | :TETRA |
AirfoilGmsh.from_url_to_csv
— Functionfrom_url_to_csv(url::String)
Provide an url from arifoiltools.com and it writes a formatted .csv which can be used to create the mesh.
url ="http://airfoiltools.com/airfoil/seligdatfile?airfoil=sd7003-il"
filename = from_url_to_csv(url)
AirfoilGmsh.increase_resolution_airfoil
— Functionincrease_resolution_airfoil(filename::String, N::Int64; dz = 0.0, w0 = [-0.1294, -0.0036, -0.0666, -0.01, 0.206, 0.2728, 0.2292, 0.1, 0.1,0.1], maxiters = 100.0, maxtime=100.0)
From a .csv file specified in ´filename´ it increase the points which define the airfoil surface, creating a total of ´N´ points. ´dz´ is the half height of the trailing edge. Internally solve a minimization problem to find the best set of ´w0´ that allows the CST to describe the input profile. Finally it writes .csv file where are stored the coordinates obtained with the cst method.
using Plots
x,y,wl,wu = increase_resolution_airfoil("e1098.csv",500)
x0,y0 = get_airfoil_coordinates_("e1098.csv")
scatter(x,y, markersize=2.5, label = "CST")
scatter!(x0,y0,markersize=2.5, markercolor= :red, label = "Original")
plot!(xlims =(0.0,1.0), ylims =(-0.2,0.65))
plot!(xlabel = "x", ylabel = "y")
AirfoilGmsh.cst2csv
— Functioncst2csv(wl,wu,dz,N; aifoil_name="Airfoil")
Write .csv file where are stored the coordinates obtained with the cst method