Professional Documents
Culture Documents
G2aero Readthedocs Io en Latest
G2aero Readthedocs Io en Latest
Release v0.1.1
1 Organization 3
2 Citations 5
2.1 How To Guides . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Explanation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.3 Technical Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.4 Feedback, Support, and Contributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
i
ii
G2Aero, Release v0.1.1
G2Aero is a flexible and practical tool for design and deformation of 2D airfoils and 3D blades using data-driven
approaches. G2Aero utilizes the geometry of matrix manifolds – specifically the Grassmannian – to build a novel
framework for representing physics-based separable deformations of shapes. G2Aero offers the flexibility to generate
perturbations in a customizable way over any portion of the blade. The G2Aero framework utilizes data-driven methods
based on a curated database of physically relevant airfoils. Specific tools include:
• principal geodesic analysis over normal coordinate neighborhoods of matrix manifolds;
• a variety of data-regularized deformations to nominal 2D airfoil shapes;
• Riemannian interpolation connecting a sequence of airfoil cross-sections to build 3D blades from 2D data;
• consistent perturbations over the span of interpolated 3D blades based on dominant modes from the data-driven
analysis.
CONTENTS: 1
G2Aero, Release v0.1.1
2 CONTENTS:
CHAPTER
ONE
ORGANIZATION
3
G2Aero, Release v0.1.1
4 Chapter 1. Organization
CHAPTER
TWO
CITATIONS
If you use this software in your research or publications, please using the following BibTeX citations:
@inproceedings{grassmannian2022,
title={Grassmannian Shape Representations for Aerodynamic Applications},
author={Olga Doronina and Zachary Grey and Andrew Glaws},
booktitle={AAAI 2022 Workshop on AI for Design and Manufacturing (ADAM)},
year={2022},
url={https://openreview.net/forum?id=1RRU6ud9YC}
}
Requirements
You will need a working Python 3.x installation; You will also need to install the following packages:
• numpy
• scipy
• PyYAML
5
G2Aero, Release v0.1.1
Alternatively, you can install the latest version directly from the most up-to-date version of the source code by
cloning/forking the GitHub repository
Once you have the source, you can build G2Aero (and add it to your environment) by executing
or
pip install -e .
in the top-level directory. The required Python packages will automatically be installed as well.
You can test your installation by looking for the g2aero executable built by the installation
which g2aero
import g2aero
Testing
pytest
from the root directory of the package. This will run a basic test problem.
[1]: # Python
import os
import numpy as np
# G2Aero
from g2aero.PGA import PGAspace, Dataset
from g2aero import Grassmann as gr
#Plotting
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
%matplotlib inline
6 Chapter 2. Citations
G2Aero, Release v0.1.1
We begin by loading a saved dataset of consistently reparametrized discrete airfoil shapes stored in one of the .npz files
in data/airfoils/. These specific airfoils correspond to thousands of perturbations to CST expansions used in wind
turbine blade design with variations in the trailing edge (TE) gap size.
Next, we build the PGA space from the dataset of airfoil shapes. The PGAspace.create_from_dataset() method
returns the PGAspace object and an array of normal coordinates T spanning a subspace at the tangent space of the
Karcher mean defining a section through the Grassmannian.
To visualize this PGA space, we plot the first four out of 2*(n_landmarks - 2) ordered normal coordinates over the
Grassmannian as scatterplots and histograms representing marginal slices through the data.
nbsphinx-code-borderwhite
Let’s try reconstructing a shape using fewer normal coordinates (low-dimensional PGA space) and compare it to the
original shape. Here we set the reduced number of parameters (the dimension of PGA space) to r=4 and choose the
shape with index j=1 for demonstration. We also need to calculate LA standardization. LA standardized shapes and
corresponding affine transformation is stored in the data object of Dataset class.
First, we demonstrate that this is a distinct element of the Grassmannian. Using the Grassmannian distance (square
root of the sum of squared principal anlges between representative shape elements), we emphasize that we are moving
along a different (reduced dimension) section of the Grassmannian given a non-zero Grassmannian distance.
8 Chapter 2. Citations
G2Aero, Release v0.1.1
Then, we compute a worst-case Euclidean error (maximum over Euclidean distances between row-wise pairs of shape
landmarks) to offer a human interpretable notion of error in the reconstructed image of the shape in the plane. This
reconstruction utilizes a consistent right inverse with nominal M[j] and b[j] defined by the LA standardization of the
original shape.
With only four dimensions, the error in the reconstruction of this particular example shape is quite small. Finally, we
overlay the low-dimensional shape with the original shape to visualze the magnitude of the mis-match over physically
relevant scales.
nbsphinx-code-borderwhite
Usually, a wind turbine blade definition is provided by a .yaml file which contains cross-sectional airfoils (normalized
by chord size), their location along the blade span, and profiles of pitch axis (axis of twist), pitch angle (twist), scaling,
and shift.
Our routine for blade interpolation consists of the following steps:
1. Read the blade definition from the .yaml file and reparametrize given cross-section airfoils so they have an equal
number of landmarks.
2. Interpolate shapes between given cross-sections with the unit chord.
3. Apply affine transformation to the interpolated shapes to scale, rotate, shift and bend (out-of-plane rotation) the
blade according to the profiles provided in .yaml file.
This example also can be found as a script in G2Aero/examples/blade_interpolation.py
[1]: import os
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
We first create a class object Blade with information from .yaml file and save Blade.xy_landmarks (2D cross-
sectional airfoils reparametrized to have the same number of landmarks) and Blade.eta_nominal (locations from 0
to 1 of these cross sections along the normalized blade span) to use as input for the interpolator. Note that the number
of landmarks is defined by the user and set to n_landmarks=401 in this example.
10 Chapter 2. Citations
G2Aero, Release v0.1.1
fig, ax = plt.subplots(1, 1)
for i, xy in enumerate(xy_nominal):
ax.plot(xy[:, 0], xy[:, 1])
ax.axis('equal')
ax.set_xlabel(r'$x^{loc}$', fontsize=15)
ax.set_ylabel(r'$y^{loc}$', fontsize=15)
ax.set_title('Given nominal shapes')
[2]: Text(0.5, 1.0, 'Given nominal shapes')
nbsphinx-code-borderwhite
2. Interpolation
Then we create the interpolator GrInterp with given 2D cross-sections and their spanwise location as input parameters.
Now we need to define an array of spanwise locations where we want to get new interpolated cross-sections. We can
provide any desired locations, e.g. 500 locations uniform along the blade span
or generate locations using the interpolator method. It distributes locations according to the Grassmann distance be-
tween given shapes. Note that this method also has arguments n_hub, n_tip, n_end, which can help specify locations
near the hub and near the tip (see Technical Reference for method details)
[5]: eta_span = GrInterp.sample_eta(n_samples=200)
Next, we pass the array of desired locations to the interpolator to get interpolated shapes. phys_crosssections
contains 2D interpolated shapes parallel to each other and with the unit chord.
[6]: phys_crosssections, gr_crosssections = GrInterp(eta_span, grassmann=True)
nbsphinx-code-borderwhite
Finally, we apply affine transformation to the interpolated shapes to scale, rotate, shift and bend (out-of-plane rotation)
the blade according to the profiles provided in .yaml file.
Now we can visualize interpolated blade. Black cross-sections are cross -sections provided by .yaml file
nominal_shapes = global_blade_coordinates(Transform.grassmann_to_phys(GrInterp.xy_
˓→grassmann, eta_nominal))
plot_3d_blade(xyz_global, nominal_shapes)
nbsphinx-code-borderwhite
12 Chapter 2. Citations
G2Aero, Release v0.1.1
2.2 Explanation
Contributions are always welcome! To contribute to G2aero, report an issue, or seek support, please initiate a pull
request or issue through the project github.
2.2. Explanation 13
G2Aero, Release v0.1.1
14 Chapter 2. Citations
CHAPTER
THREE
• genindex
• modindex
• search
15