A Python module with random tools that are useful for Hexed simulations. More...
Classes | |
| class | History_plot |
| creates a real-time, interactive plot of the convergence history More... | |
Functions | |
| naca (desig, n_points=1000, closure="warp") | |
| Constructs a NACA 4-digit airfoil geometry. | |
| joukowsky (thickness, camber=0., n_points=1000, scale=True) | |
| constructs a Joukowsky airfoil | |
| sort_curve (data, coords, start_at=0, closed=True) | |
| Returns data sorted into a continuous curve. | |
| read_history (output_directory) | |
Reads the convergence history from output.txt and returns it as a pandas.DataFrame. | |
Variables | |
| zhukovsky = joukowsky | |
| alternative transliteration | |
A Python module with random tools that are useful for Hexed simulations.
| hexedpy.utils.joukowsky | ( | thickness, | |
| camber = 0., | |||
| n_points = 1000, | |||
| scale = True ) |
constructs a Joukowsky airfoil
This is a family of airfoils with a cusped trailing edge which have analytic solutions for the incompressible flow around them.
| thickness | approximate thickness-to-chord ratio |
| camber | (radian) angle between the trailing edge and the chord line |
| n_points | Number of points on the airfoil surface |
| scale | If True, scale the airfoil so that the leading edge is at (0, 0) and the trailing edge is at (0, 1). Otherwise, the airfoil is left at the size and position dictated by the Joukowsky transform. |
| hexedpy.utils.naca | ( | desig, | |
| n_points = 1000, | |||
| closure = "warp" ) |
Constructs a NACA 4-digit airfoil geometry.
Returns an n by 2 numpy array representing the coordinates of the airfoil at discrete points. This array can then be passed to Solver.generate_mesh as a geometry. Points are clustered near the leading edge but not the trailing (see implementation for details). This function is the recommended way to generate NACA airfoil geometry for Hexed simulations, as importing airfoils from coordinate files requires some special care.
| desig | String representing the airfoil designation (e.g., "0012" for the NACA0012). In general, we cannot accept this parameter as an int because of possible leading zeros. |
| n_points | Number of points on the airfoil surface. Don't be stingy, since DG is finnicky with discrete geometry representations—1000 is actually on the lower end of what I normally use. |
| closure | If and how to close the trailing edge. There are 3 options:
|
| hexedpy.utils.read_history | ( | output_directory | ) |
Reads the convergence history from output.txt and returns it as a pandas.DataFrame.
| output_directory | The working_dir of the simulation you want to read the history of (e.g. hexed_out if you used the default working_dir). Can be an absolute or relative path. |
| hexedpy.utils.sort_curve | ( | data, | |
| coords, | |||
| start_at = 0, | |||
| closed = True ) |
Returns data sorted into a continuous curve.
| data | A pandas.DataFrame containing the data (coordinates and flow variables) to be sorted |
| coords | Labels of columns to treat as coordinates |
| start_at | Index of point to start at |
| closed | If true, will append an additional copy of the start point to the end to ensure that the final curve is closed. |