Utility Functions
I/O
Geometry Helpers
- prefoil.utils.geom_ops.checkCellRatio(X, ratio_tol=1.2)[source]
Checks a set of coordinates for consecutive cell ratios that exceed a given tolerance
- Parameters:
- XNdarray [N,2]
The set of coordinates being checked
- ratio_tolfloat
The maximum cell ratio that is allowed
- Returns:
- cell_ratioNdarray [N]
the cell ratios for each cell
- max_cell_ratiofloat
the maximum cell ratio
- avg_cell_ratiofloat
the average cell ratio
- excNdarray
the cell indicies that exceed the ratio tolerance
- prefoil.utils.geom_ops.generateNACA(code, nPts, spacingFunc=<function cosine>, func_args=None)[source]
This function generates airfoil coordinates from the analytical definition of the NACA airfoils. It currently only supports 4 digit series airfoils.
- Parameters:
- codestr
The 4 digit code, this is expected to be a length four string
- nPtsint
The number of points to sample from the defintion of the NACA airfoil, half will be sampled on the top and half on the bottom. This must be an even number.
- spacingFunccallable
The spacing function to use for determining the sampling point locations of the x coordinates of the camber line
- func_argsdict
Arguments to pass to the sampling function when it is called
- Returns:
- afNdarray [N,2]
Coordinates that were sampled from the NACA 4-digit code