Airfoil 3D

class pyturbo.aero.airfoil3D(profileArray: List[airfoil2D], profile_loc: List[float], height: float)[source]

Properties

__check_ps_ray_intersection__(ray, ps_x, ps_y)[source]

checks to see if the ray intersects the pressure side

__check_ss_ray_intersection__(ray, ss_x, ss_y)[source]

checks to see if the ray intersects the suction side

calc_nblades(pitchChord: float, rhub: float)[source]

Calculates the number of blades

Parameters:
  • pitchChord (float) – pitch to chord ratio

  • rhub (float) – hub radius

cartesian()[source]

Converts the default cylindrical coordinates to cartesian system

center_le()[source]

centers the blade by placing leading edge at 0,0

convert_cyl_cartesian(rth: ndarray, radius: ndarray)[source]

Convert a single profile from cylindrical to cartesian coordinates.

Parameters:
  • rth (np.ndarray) – points in rtheta coordinate system

  • radius (np.ndarray) – radius values of those points

Returns:

tuple containing:

  • yss (numpy.ndarray): y direction

  • zss (numpy.ndarray): z direction

  • thss (numpy.ndarray): theta direction

Return type:

(tuple)

create_blade(nProfiles: int, num_points: int, trailing_edge_points: int)[source]

Takes the control profiles specified in the construct and creates intermediate profiles filling the blade geometry. These profiles can be shifted or modified later.

Parameters:
  • nProfiles (int) – number of intermeidate profiles to generate

  • num_points (int) – number of points per profile. Suction and Pressure side will have this number of points

  • trailing_edge_points (int) – Number of trailing edge points

export_solidworks(name: str)[source]

Export the blades in RTheta,Z,R coordinate format

Parameters:

name (string) – exported filename

export_stl(filename: str = 'blade.stl')[source]

Exports the finished blade to STL

Parameters:

filename (str, optional) – Name of the STL file . Defaults to “blade.stl”.

flip()[source]

Mirrors the blade by multiplying y direction by -1. This is assuming axial chord is in the y direction and span is in z

flip_cw()[source]

Mirrors the blade by multiplying -1*x direction. This is assuming axial chord is in the y direction and span is in z

get_chord()[source]

Returns the chord, axial chord for all the profiles

get_circumference(ss_x: ndarray, ss_y: ndarray, ps_x: ndarray, ps_y: ndarray)[source]

returns the circumferene of a 2D airfoil profile

Parameters:
  • ss_x (np.ndarray) – suction size x

  • ss_y (np.ndarray) – suction side y

  • ps_x (np.ndarray) – pressure side x

  • ps_y (np.ndarray) – pressure side y

Returns:

tuple containing:

  • ss_len (float): suction side length

  • ps_len (float): pressure side length

Return type:

(tuple)

get_cross_section(percent_span: float)[source]

Get an arbirtary cross section at percent span. Doesn’t factor into account the shift caused by the channel. Assumes the blade hasn’t been placed inside of a channel.

Parameters:

percent_span (float) – percent span to get the cross section

Returns:

tuple containing:

  • xss (numpy.ndarray): suction side x coordinate

  • yss (numpy.ndarray): suction side y coordinate

  • zss (numpy.ndarray): suction side z coordinate

  • xps (numpy.ndarray): pressure side x coordinate

  • yps (numpy.ndarray): pressure side y coordinate

  • zps (numpy.ndarray): pressure side z coordinate

Return type:

(tuple)

get_cross_section_normal(ss_x: ndarray, ss_y: ndarray, ps_x: ndarray, ps_y: ndarray)[source]

Gets the normal of a cross section for a given profile

Parameters:
  • ss_x (np.ndarray) – x - suction side points of a given profile

  • ss_y (np.ndarray) – y - suction side points of a given profile

  • ps_x (np.ndarray) – x - pressure side points of a given profile

  • ps_y (np.ndarray) – y - pressure side points

Returns:

tuple containing:

  • ss_nx (np.ndarray): normal vector on suction side

  • ss_ny (np.ndarray): normal vector on suction side

  • ps_nx (np.ndarray): normal vector on pressure side

  • ps_ny (np.ndarray): normal vector on pressure side

Return type:

(tuple)

get_pitch(nBlades: int)[source]

Get the pitch distribution for a 3D blade row

Parameters:

nBlades (int) – Number of blades

Returns:

tuple containing:

  • s (numpy.ndarray): pitch distribution

  • s_c (numpy.ndarray): pitch to chord distribution

Return type:

(tuple)

get_shell_2D(percent_span: float, shell_thickness: float, smooth: float = 0.1, shell_points: int = 80)[source]

Gets the 2D shell for a given % span

Parameters:
  • percent_span (float) – where along the span do you want the shell the blade

  • shell_thickness (float) – offset from the outer wall

  • smooth (float, optional) – what percentage of the points do you want to use to smooth the design. Defaults to 0.1.

  • shell_points (int, optional) – number of points to describe the shell. Defaults to 80.

Returns:

tuple containing:

  • ss_x (numpy.ndarray): suction side tangential (x) coordinates

  • ss_y (numpy.ndarray): suction side axial (y) coordinates

  • ss_z (numpy.ndarray): suction size radial (z) coordinates

  • ps_x (numpy.ndarray): pressure side tangential (x) coordinates

  • ps_y (numpy.ndarray): pressure side axial (y) coordinates

  • ps_z (numpy.ndarray): pressure side axial (z) coordinates

Return type:

(tuple)

static import_geometry(folder: str, npoints: int = 100, nspan: int = 2, axial_chord: float = 1, span: List[float] = [0, 1], ss_ps_split: int = 0)[source]

imports geometry from a folder. Make sure there are 2 files inside the folder example: airfoil_0.txt and airfoil_1.txt. In this example, these two files represent the hub and tip. You can have as many as you want but 2 is the minimum. Filenames are sorted before import

airfoil_0 can contain 2 columns x,y or 3 columns x,y,z. Z column isn’t used because you set the span. The span determines the spanwise location of the two airfoils

Parameters:
  • folder ([str]) – folder containing the airfoils

  • npoints (int, optional) – Number of points to scale the points to. Defaults to 100.

  • nspan (int, optional) – Number of spanwise profiles to create. Defaults to 2.

  • axial_chord (int, optional) – Defines the length of the axial chord. Axial chord within the file will be scaled. Defaults to 1.

  • span (List[float], optional) – Spanwise location of the profiles. Defaults to [0,1] for 2 profiles.

  • ss_ps_split (int, optional) – determines what index to split the suction and pressure side, default is number of points/2. Defaults to 0.

Returns:

airfoil3D object

Return type:

(airfoil3D)

lean(leanX: List[float], leanZ: List[float])[source]

Leans the blade towards the suction or pressure side. This applies points that are fitted by a bezier curve. Profiles are adjusted to follow this curve simulating lean.

Parameters:
  • leanX (List[float]) – lean points

  • leanZ (List[float]) – spanwise location of the lean points

nspan: int

these are the 2D Profiles that you passed into the constructor

Type:

Profile points

plot3D(only_blade=False)[source]

Plots a 3D representation of the blade and control points trailing edge center line is also plotted along with the blade’s stacking spine

Parameters:

only_blade (bool, optional) – Only plot the blade, no stacking spine. Defaults to False.

Returns:

figure object (fig.show())

Return type:

(matplotlib.figure)

plot3D_ly(only_blade=False)[source]

Plots a 3D representation of the blade and control points trailing edge center line is also plotted along with the blade’s stacking spine

Parameters:

only_blade (bool, optional) – Only plot the blade, no stacking spine. Defaults to False.

plot_profile(figureNum)[source]

Incomplete

Parameters:

figureNum ([type]) – [description]

plot_shell_2D(percent_span: float, shell_thickness: float)[source]

Plots the 2D shell used for placement of heat pipes

Parameters:
  • percent_span (float) – percent span where shell occurs

  • shell_thickness (float) – thickness to remove from the blade

Returns:

matplotlib figure object

Return type:

(matplotlib.figure)

profiles_shift()[source]

Shift all profiles based on bezier curve that describes the spline of the blade

rotate(cx: float, cy: float, angle: float = 0)[source]

Rotate all shifted profiles about the leading edge including control profiles

Parameters:
  • cx (float) – rotation point x coordinate

  • cy (float) – rotation point y coordinate

  • angle (float, optional) – clockwise angle to rotate. Defaults to 0.

scale_zps(zmin: List[float], zmax: List[float])[source]

scales the z axis to match the channel height. Channel height may be defined as the radius

Parameters:
  • zmin (List[float]) – Array of size n corresponding to minimum radius

  • zmax (List[float]) – Array of size n corresponding to maximum radius

scale_zss(zmin: List[float], zmax: List[float])[source]

scales the z axis to match the channel height. Channel height may be defined as the radius

Parameters:
  • zmin (List[float]) – Array of size n corresponding to minimum radius

  • zmax (List[float]) – Array of size n corresponding to maximum radius

section_z(zStartPercent: float, zEndPercent: float)[source]

Chops the blade in between 2 spanwise lines. Think of it as cutting the blade between (zStartPercent) 10% and (zEndPercent) 50%

Parameters:
  • zStartPercent (float) – bottom % of the blade to cut from

  • zEndPercent (float) – top % of blade to cut from. stuff in middle is saved

shell_zps: List[PchipInterpolator]

Defines a 3D Airfoil to be used in a channel

shft_zps: ndarray

Shell

shift(x: float, y: float)[source]
Moves the blade and recomputes the geometry

Step 1 - shifts the profiles Step 2 - add lean and sweep again Step 3 - recompute the geometry if npts != 0

Parameters:
  • x (float) – shift in x direction

  • y (float) – shift in y directrion

spanwise_spline_fit()[source]

Fits the blade with splines that run along the profiles Helps with the wavy design

spanwise_spline_fit_shell(shell_thickness: float, smooth: float = 0.1)[source]

Applies a shell in the spanwise direction. Creates a new blade inside the current blade. Helps with heat pipe design

Parameters:
  • shell_thickness (float) – how much material to remove from the blade

  • smooth (float, optional) – How much smoothing should be performed. Defaults to 0.1.

spline_ypps: ndarray

Final blade points after lean and sweep are accounted for

Type:

3D Blade points

stack(stackType=stack_type.centroid)[source]

Defines how the airfoil profiles are stacked

Parameters:

stackType (stack_type, optional) – Options are centroid, Leading Edge, Trailing Edge. Defaults to stack_type.centroid.

stackType: stack_type

Bezier X,Y,Z are for the stacking line of the blade

sweep(sweep_y=[], sweep_z=[])[source]

Sweep bends the blade towards the leading edge or trailing edge. Blades are first stacked and then sweep can be applied

Parameters:
  • sweep_y (List[float], optional) – adds bezier points to the sweep of the blade. Defaults to [].

  • sweep_z (List[float], optional) – defines where along the span the sweep points should be located. Defaults to [].