reparametrization module

reparametrization.calc_cst_param(x, y, n1, n2, y_tailedge=0.0, order=8)

Solve the least squares problem for a given shape.

Parameters:
  • x – (np.ndarray): (x/c) coordinates locations

  • y – (np.ndarray): (y/c) coordinate locations

  • n1 – normal coord

  • n2 – normal coord

  • order – order of the polynomial used

Returns:

CST parameters

reparametrization.cst_matrix(x, n1, n2, order)

Construct CST matrix A used in CST representation y_{low/upp} = A coef_CST + b

Parameters:
  • x – x/c coordinates locations

  • n1 – normal coord

  • n2 – normal coord

  • order – order of the polynomial used

Returns:

nparray of a CST matrix used in least square solve

reparametrization.cst_reparametrization(xy, n_landmarks=401, original_landmarks=False, name='', cst_order=8, **kwargs)

Provides landmarks after CST reparametrization.

Parameters:
  • xy – (n, 2) given coordinated defining the shape

  • n_landmarks – scalar number of landmarks in returned shape, defaults to 401

  • original_landmarks – (bool) use landmarks from given shape coordinate xy, defaults to False

  • name – (str) name of airfoil used to define normals in CST representation (using n1, n2 = 0.5, 0.5 for circles), defaults to ‘’

  • cst_order – order of the polynomial used, defaults to 8

Returns:

(n_landmarks, 2) array of landmarks after reparametrization

reparametrization.curvature_planar(t_phys, s1, s2)

Calculate curvature based on planar respresentation.

Parameters:
  • t_phys – coordinate along the arclength of physical airfoil (t in [0, 1])

  • s1 – CubicSpline of x(t)

  • s2 – CubicSpline of y(t)

Returns:

curvature values

reparametrization.curvature_polar(t, alpha, theta, M)

Calculate curvature based on polar respresentation.

Parameters:
  • t – coordinate along the arclength (t in [0, 1])

  • alpha – cubic spline of polar coordinate

  • theta – cubic spline of polar coordinate

  • M – 2x2 array of LA-transformation matrix

Returns:

curvature values

reparametrization.from_cst_parameters(x, cst_lower, cst_upper, n1=0.5, n2=1.0, te_lower=0, te_upper=0)

Compute landmark coordinates for the airfoil given x-coordinate locations

Parameters:
  • x – (np.ndarray): Non-dimensional x-coordinate locations

  • cst_lower – (np.ndarray): cst parameters for lower part

  • cst_upper – (np.ndarray): cst parameters for upper part

  • n1 – (double): normal coord

  • n2 – (double): normal coord

  • te_lower – (double): tail edge size for lower part

  • te_upper – (double): tail edge size for upper part

Returns:

Numpy arrays for landmark coordinates

reparametrization.get_landmarks(xy, n_landmarks=401, method='planar', add_gap=False, **kwargs)

Provides landmarks after reparametrization.

Parameters:
  • xy – (n, 2) given coordinated defining the shape

  • n_landmarks – scalar number of landmarks in returned shape

  • method – method of reparametrization: ‘cst’, ‘polar’ or ‘planar’

  • add_gap – size of the tail gap added to the shape

  • kwargs – additional parameters for reparametrization (e.g. sampling strategy for ‘polar’ and ‘planar’ method)

Returns:

(n_landmarks, 2) array of landmarks after reparametrization

reparametrization.halfsurface_from_cst_parameters(x, cst, n1=0.5, n2=1.0, te=0)

Compute landmark coordinates for the upper or lower surface of airfoil

Parameters:
  • x – (np.ndarray): Non-dimensional x-coordinate locations

  • cst – (np.ndarray): cst parameters for upper or lower part

  • n1 – (double): normal coord

  • n2 – (double): normal coord

  • te – (double): tail edge size for uppper or lower part

Returns:

Numpy arrays for landmark coordinates

reparametrization.planar_reparametrization(xy, n_landmarks, sampling='uniform', **kwargs)

Builds cubic splines of x(t) and y(t) where t in [0, 1] is coordinate along the arclength. Resamples landmark.

Parameters:
  • xy – (n, 2) given coordinated defining the shape

  • n_landmarks – scalar number of landmarks in returned shape

  • sampling – distribution of landmarks along the arclength possible options: ‘cosine’, ‘chebyshev’, ‘uniform’, ‘uniform_gr’ and ‘curvature’, defaults to ‘uniform’

Returns:

(n_landmarks, 2) array of landmarks after reparametrization

reparametrization.polar_reparametrization(xy, n_landmarks=401, sampling='uniform_gr', **kwargs)

Builds cubic splines of polar coordinates theta(t) and alpha(t), where t in [0, 1] is coordinate along the arclength. Resamples landmark.

Parameters:
  • xy – (n, 2) given coordinated defining the shape

  • n_landmarks – scalar number of landmarks in returned shape, defaults to 401

  • sampling – distribution of landmarks along the arclength possible options: ‘uniform_phys’, ‘uniform_gr’ and ‘curvature’, defaults to ‘uniform_gr’

Returns:

(n_landmarks, 2) array of landmarks after reparametrization