Git Product home page Git Product logo

peterdsharpe / aerosandbox Goto Github PK

View Code? Open in Web Editor NEW
715.0 35.0 111.0 179.74 MB

Aircraft design optimization made fast through computational graph transformations (e.g., automatic differentiation). Composable analysis tools for aerodynamics, propulsion, structures, trajectory design, and much more.

Home Page: https://peterdsharpe.github.io/AeroSandbox/

License: MIT License

Python 8.87% MATLAB 0.07% Jupyter Notebook 91.06% Batchfile 0.01%
aerodynamics airplane cfd mdo aircraft-design aerospace optimization vlm aerodynamic-analysis xfoil

aerosandbox's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aerosandbox's Issues

s_ref assertion in geometry

Describe the bug
In geometry.py the attribute s_ref asserts if only one wing is specified.

Expected behavior
It seems that the comment is right, but the code does not reflect that.
if len(self.wings) > 1: # If there is at least one wing
should this be:
if len(self.wings) > 0: # If there is at least one wing

Desktop (please complete the following information):

  • OS: Windows 10
  • Anaconda Python 3.7.x

Numpy Error

I am having trouble running any of the examples given. I get the same error every time (below is the error given from the example shown on the code home page):

Running VLM3 calculation...
Meshing...
Traceback (most recent call last):
File "example.py", line 97, in
aero_problem.run() # Runs and prints results to console
File "C:\Users\ALEXANDROS\Anaconda3\envs\panel\lib\site-packages\aerosandbox\aerodynamics\vlm3.py", line 26, in run
self.make_panels()
File "C:\Users\ALEXANDROS\Anaconda3\envs\panel\lib\site-packages\aerosandbox\aerodynamics\vlm3.py", line 185, in make_panels
np.expand_dims((1 - nondim_spanwise_coordinates), 2) * np.expand_dims(
File "C:\Users\ALEXANDROS\Anaconda3\envs\panel\lib\site-packages\autograd\tracer.py", line 48, in f_wrapped
return f_raw(*args, **kwargs)
File "<array_function internals>", line 6, in expand_dims
File "C:\Users\ALEXANDROS\Anaconda3\envs\panel\lib\site-packages\numpy\lib\shape_base.py", line 597, in expand_dims
axis = normalize_axis_tuple(axis, out_ndim)
File "C:\Users\ALEXANDROS\Anaconda3\envs\panel\lib\site-packages\numpy\core\numeric.py", line 1327, in normalize_axis_tuple
axis = tuple([normalize_axis_index(ax, ndim, argname) for ax in axis])
File "C:\Users\ALEXANDROS\Anaconda3\envs\panel\lib\site-packages\numpy\core\numeric.py", line 1327, in
axis = tuple([normalize_axis_index(ax, ndim, argname) for ax in axis])
numpy.AxisError: axis 2 is out of bounds for array of dimension 2

I tried with and without the use of anaconda and virtual environments on 2 different computers, however, I get the same error every time. Could it be that the newest version of numpy or autograd made changes that affect the functions used?
I would really appreciate your reply.

Set CL instead of Alpha in OperatingPoint

Describe the solution you'd like
Set a lifting coefficient instead of an angle of attack to perform the calculations.

Describe alternatives you've considered
For the moment I am iteratively changing the angle of attack until I converge to the desired CL.

VLM for trajectory optimization

Hi,

I am trying to use vortex lattice methods for optimal control problems. I successfully used the AeroBuildup module for optimizing a trajectory, but optimizing the design with this module doesn't make sense because my design isn't to adapted to it.
When trying to switch to vortex lattice method with a number of variables > 1 using the following code:

import aerosandbox.numpy as np
import aerosandbox as asb

opti = asb.Opti()

n_vars = 2
alpha = opti.variable(n_vars=n_vars)
beta = np.linspace(0,2,n_vars)

vlm_results = asb.VortexLatticeMethod(
    airplane=airplane,
    op_point=asb.OperatingPoint(
        atmosphere=asb.Atmosphere(),
        alpha = alpha,
        beta = beta
    )
).run()

opti.subject_to([
    vlm_results["F_g"][1] = 100
])

sol = opti.solve()

I get this error:

Traceback (most recent call last):
  File "AeroSandbox/aerosandbox/aerodynamics/aero_3D/vortex_lattice_method.py", line 197, in run
    steady_freestream_velocity = self.op_point.compute_freestream_velocity_geometry_axes()  # Direction the wind is GOING TO, in geometry axes coordinates
  File "AeroSandbox/aerosandbox/performance/operating_point.py", line 235, in compute_freestream_velocity_geometry_axes
    return self.compute_freestream_direction_geometry_axes() * self.velocity
  File "AeroSandbox/aerosandbox/performance/operating_point.py", line 231, in compute_freestream_direction_geometry_axes
    return self.compute_rotation_matrix_wind_to_geometry() @ np.array([-1, 0, 0])
  File "AeroSandbox/aerosandbox/performance/operating_point.py", line 212, in compute_rotation_matrix_wind_to_geometry
    alpha_rotation = np.rotation_matrix_3D(
  File "AeroSandbox/aerosandbox/numpy/rotations.py", line 104, in rotation_matrix_3D
    return array(rot)
  File "/AeroSandbox/aerosandbox/numpy/array.py", line 31, in array
    return _cas.vertcat(
  File "/home/charles/miniconda3/envs/py39/lib/python3.9/site-packages/casadi/casadi.py", line 466, in vertcat
    def vertcat(*args): return _vertcat(args)
  File "/home/charles/miniconda3/envs/py39/lib/python3.9/site-packages/casadi/casadi.py", line 20204, in _vertcat
    return _casadi._vertcat(*args)
NotImplementedError: Wrong number or type of arguments for overloaded function '_vertcat'.
  Possible prototypes are:
    _vertcat([Sparsity])
    _vertcat([DM])
    _vertcat([SX])
    _vertcat([MX])
  You have: '(([MX|int],DM,[MX|int]))'

I guess this compute_rotation_matrix_wind_to_geometry does not support mixed types. Is it a feature that is planned to be available any time soon ?

Thank you

Error running fitting example

Hi Peter,

I updated to Version 2.3.2 and trying to run the fitting example. I got two errors in fitting.py:

First:

Traceback (most recent call last):
File ".\example.py", line 28, in
Cl = af.fit_xfoil_data_Cl(plot_fit=True)
File "c:\users\lenovo\anaconda3\lib\site-packages\aerosandbox\tools\airfoil_fitter\airfoil_fitter.py", line 154, in fit_xfoil_data_Cl
verbose=self.verbose,
File "c:\users\lenovo\anaconda3\lib\site-packages\aerosandbox\tools\fitting.py", line 85, in fit
weights /= np.sum(weights)
TypeError: No loop matching the specified signature and casting was found for ufunc true_divide_

I changed line 85 with:
np.divide(weights, np.sum(weights), out=weights, casting='unsafe')
which removed the TypeError. All weights are zero ???

Second:

This was a data lenght mismatch at line 113

Traceback (most recent call last):
File ".\example.py", line 28, in
Cl = af.fit_xfoil_data_Cl(plot_fit=True)
File "c:\users\lenovo\anaconda3\lib\site-packages\aerosandbox\tools\airfoil_fitter\airfoil_fitter.py", line 154, in fit_xfoil_data_Cl
verbose=self.verbose,
File "c:\users\lenovo\anaconda3\lib\site-packages\aerosandbox\tools\fitting.py", line 113, in fit
f"The supplied data series "{key}" has length {series_length}, but y_data has length {n_datapoints}.")
ValueError: The supplied data series "alpha_indices" has length 37, but y_data has length 868.

Can you please have a look at these errors.

Regards,
John

object has no attribute 'front_left_vertices'

Hello,

Bug Description

I am having problems when trying to use the analysis.draw() command.
It always returns the following error:
AttributeError: 'VortexLatticeMethod' object has no attribute 'front_left_vertices'

  • Operating System: Linux Mint 19
  • Python Version: 3.8.5
  • AeroSandbox Verion: 3.2.15

Reproduce case

from aerosandbox.aerodynamics.aero_3D.test_aero_3D.geometries.vanilla import airplane
import aerosandbox as asb

### Do the AVL run
analysis = VortexLatticeMethod(
    airplane=airplane,
    op_point=asb.OperatingPoint(
        atmosphere=asb.Atmosphere(altitude=0),
        velocity=10,
        alpha=0,
        beta=0,
        p=0,
        q=0,
        r=0,
    ),
    spanwise_resolution=12,
    chordwise_resolution=12,
)

res = analysis.run()

for k, v in res.items():
    print(f"{str(k).rjust(10)} : {v:.4f}")

analysis.draw()

Fuselage with Rectangular Profile

Description of Proposed Feature

Alternatives I Have Considered

Additional Context

Hello
I would like to know if it is possible to have fuselages with rectangular profiles
thanks

Avoid comparing float to integer

In the forces calculation you have this line of code:

self.CL_over_CDi = cas.if_else(self.CDi == 0, 0, self.CL / self.CDi)

I think it is better to use np.isclose, as it is more robust to finding zeroes and to NaN values.

self.CL_over_CDi = cas.if_else(np.islclose(self.CDi, tol_rel, tol_abs), 0, self.CL / self.CDi)

Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.isclose.html

unit checking

I think it'd be great if AeroSandbox could check the units of my inputs ;)

Wing with a winglet

Dear @peterdsharpe,

I am planning on using your library to finish some assignments for an aerodynamical course.

Do you reckon it would be possible to simulate a wing with a winglet, to compute it's induced drag?

If the code does not support it yet, would you have an idea on how to do it, so I can implement it, use it and then merge it to your master branch?

Thank you.

ControlSurface not working

Hi Peter,

I have been experimenting with your software and now I wanted to model control surfaces on a wing as well. The picture in the ReadMe shows a VLM simulation with an aileron deflection. I tried to reproduce it but can't make it work, the deflection never shows up.
Are control surfaces currently not working because they are under a rework? If so, in what version do they work?
I'm using aerosandbox 3.5.9

Thank you for your time.
Best,
Max

Wrong requirements when installing via pip

Bug Description

I believe the requirements file is out of date on PyPi

Steps to Reproduce

Tried to run tutorial 04 - Geometry and Data Structures/01 - AeroSandbox Data Structures/

ModuleNotFoundError: No module named 'pyvista'

Expected Behavior

Image of geometry should be created

System Information

  • Operating System:
  • Python Version:
  • AeroSandbox Verion: AeroSandbox-3.2.6-py3-none-any.whl

Other Information

when running 'pip show aerosandbox' pyvista is not listed in the requirements

if i install pyvista separately (via pip) the image is created

4h installing and it keeps going

Bug Description

pip seems to be installing ALL the versions of every dependency needed for aerosandbox I have tried both on win10 latest and on ubuntu 20.04.

INFO: pip is looking at multiple versions of six to determine which version is compatible with other requirements. This could take a while.
Collecting six>=1.5

It shows that message with every dependency, and it is taking forever to install. pip suggests this:

INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. If you want to abort this run, you can press Ctrl + C to do so. To improve how pip performs, tell us
what happened here: https://pip.pypa.io/surveys/backtracking

Steps to Reproduce

pip install aerosandbox[full]

Expected Behavior

System Information

  • Operating System: Win 10 and Ubuntu 20.04
  • Python Version: 3.7
  • AeroSandbox Verion:

Other Information

AeroSandbox use for aero/hydrostructural model

Hi all,

First thank you for this great package. I am used to use various lifting lines or VLM programs such as AVL and the integrated optimization feature looks really cool to use.
I have a few questions related to the usage of aerosandbox for mainly two things:

  1. Modelling ground effect / freesurface
    Is there a possibility within aerosandbox to include symmetry/anti symmetry planes ? This kind of feature can be included in AVL for instance, which enables me to estimate the influence of the freesurface (constant pressure i.e zero lift boundary) an hydrofoil
  2. Doing aeroelastic loops
    I checked the example "simple_beam_opt.py" in aerosandbox/structures which gives somes insights about how to evaluate deformation on a wing. However, Its not clear to me how to integrate this into a loop with lifting line/VLM fluid calculations. I tried to recycle this script imagining how it could be integrated in a loop, but its not clear to me how to get the result coming from aero model to the structural problem:
import aerosandbox.numpy as np
import casadi as cas
from aerosandbox import *


loops = 2

def trapz(x):
    out = (x[:-1] + x[1:]) / 2
    out[0] += x[0] / 2
    out[-1] += x[-1] / 2
    return out

### Constants
E = 228e9  # Pa, modulus of CF
I = 1e4
EI = E*I
n_sections = 6
n_panels_per_section = 4


n = n_sections + 1


x_les_ini = cas.linspace(0,-0.25,n)  # og one this one
y_les_ini = cas.linspace(0, 1, n)
z_les_ini = cas.linspace(0,0.5,n)
chords = cas.linspace(1,1,n)
dx = np.zeros(n)
dy = np.zeros(n)
dz = np.zeros(n)
for i in range(loops):
    opti = cas.Opti()

    x_les = x_les_ini + dx
    y_les = y_les_ini + dy
    z_les = z_les_ini + dz

    airplane = Airplane(
        name="Spanload Optimization Test",
        x_ref=0,  # CG location
        y_ref=0,  # CG location
        z_ref=0,  # CG location
        fuselages=[],
        wings=[
            Wing(
                name="Main Wing",
                x_le=0,  # Coordinates of the wing's leading edge
                y_le=0,  # Coordinates of the wing's leading edge
                z_le=0,  # Coordinates of the wing's leading edge
                symmetric=True,
                xsecs=[
                    WingXSec(
                        x_le=x_les[i],
                        y_le=y_les[i],
                        z_le=z_les[i],
                        chord=chords[i],  # variable(1,0.01,2),
                        airfoil=generic_airfoil,
                        spanwise_spacing="uniform"
                    )
                    for i in range(n)
                ],
            ),
        ]
    )

    ap = Casll1(  # Set up the AeroProblem
        airplane=airplane,
        op_point=OperatingPoint(
            velocity=100,
            alpha=2,
            beta=0,
            p=0,
            q=0,
            r=0,
        )
    )

    # Defining derivatives
    u = 1 * opti.variable(n)
    du = 0.1 * opti.variable(n)
    ddu = 0.01 * opti.variable(n)
    dEIddu = 100 * opti.variable(n)
    ddEIddu = ap.solve.get_lift_distribution() # i know this is not existing, but its just to give an example


    opti.subject_to([
        cas.diff(u) == trapz(du) * dx,
        cas.diff(du) == trapz(ddu) * dx,
        cas.diff(EI * ddu) == trapz(dEIddu) * dx,
        cas.diff(dEIddu) == trapz(ddEIddu) * dx
    ])

    # Add BCs
    opti.subject_to([
        u[0] == 0,
        du[0] == 0,
        ddu[-1] == 0,  # No tip moment
        dEIddu[-1] == 0
    ])

    # dx = ? 
    # dy = ?
    # dz = ?

Thanks

NameError: name 'cas' is not defined

I get "NameError: name 'cas' is not defined" when I run the lifting line example in test aero3D

Steps to Reproduce

Expected Behavior

System Information

  • Operating System:Windows 10
  • Python Version:3.7
  • AeroSandbox Verion:3.0.7

Other Information

Continuous Integration

I've realized you are doing a lot of changes and so forth.

Have you heard of Travis CLI? They provide free testing with each commit for open source code (like yours!).

Basically we need to set up a tests folder where tests are set up. At this stage of rapid development of your code it would suffice to assume what comes out is correct and so basically the expected outcome is the current output.

In this way, whenever you keep changing stuff you will get emails when you things broke down the way.

Additionally, it allows you to test deploys on different operating systems (as far as I recall) and for different Python versions.

Error Running vlm3_conventional.py

Traceback (most recent call last):
File "C:/Users/Gyaase Elvis/Anaconda3/envs/cpacscreator/Lib/site-packages/aerosandbox_legacy_v0/examples_legacy_v0/vlm3_conventional.py", line 19, in
control_surface_hinge_point=0.75 # as chord fraction
TypeError: init() got an unexpected keyword argument 'xyz_le'

I get the above error when i run the file, any help?

Regarding Moments Estimation

Hi @peterdsharpe, I was validating the code with avl and I found that the moments estimated from this code is way off. Upon looking at vlm3.py I found the formula for moments are incorrect.
Could you please check and confirm with it.

Issues with running the example code on Anaconda

Hi,
I followed the installation steps and tried running the example put up on the page and I encountered an error like this:

File "", line 1, in
runfile('C:/Users/dnsum/Documents/1. Leap Aero/test codes/aerosandbox_tutorial.py', wdir='C:/Users/dnsum/Documents/1. Leap Aero/test codes')

File "C:\Anoconda\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile
execfile(filename, namespace)

File "C:\Anoconda\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)

File "C:/Users/dnsum/Documents/1. Leap Aero/test codes/aerosandbox_tutorial.py", line 8, in
from aerosandbox import *

File "C:\Anoconda\lib\site-packages\aerosandbox_init_.py", line 1, in
from .aerodynamics import *

File "C:\Anoconda\lib\site-packages\aerosandbox\aerodynamics_init_.py", line 1, in
from .vlm1 import *

File "C:\Anoconda\lib\site-packages\aerosandbox\aerodynamics\vlm1.py", line 1, in
from .aerodynamics import *

File "C:\Anoconda\lib\site-packages\aerosandbox\aerodynamics\aerodynamics.py", line 4, in
from numba import jit

File "C:\Anoconda\lib\site-packages\numba_init_.py", line 11, in
from . import config, errors, _runtests as runtests, types

File "C:\Anoconda\lib\site-packages\numba\config.py", line 18, in
import llvmlite.binding as ll

File "C:\Anoconda\lib\site-packages\llvmlite\binding_init_.py", line 6, in
from .dylib import *

File "C:\Anoconda\lib\site-packages\llvmlite\binding\dylib.py", line 4, in
from . import ffi

File "C:\Anoconda\lib\site-packages\llvmlite\binding\ffi.py", line 138, in
from pkg_resources import resource_filename

File "C:\Anoconda\lib\site-packages\pkg_resources_init_.py", line 3241, in
@_call_aside

File "C:\Anoconda\lib\site-packages\pkg_resources_init_.py", line 3225, in _call_aside
f(*args, **kwargs)

File "C:\Anoconda\lib\site-packages\pkg_resources_init_.py", line 3254, in _initialize_master_working_set
working_set = WorkingSet._build_master()

File "C:\Anoconda\lib\site-packages\pkg_resources_init_.py", line 574, in _build_master
ws = cls()

File "C:\Anoconda\lib\site-packages\pkg_resources_init_.py", line 567, in init
self.add_entry(entry)

File "C:\Anoconda\lib\site-packages\pkg_resources_init_.py", line 623, in add_entry
for dist in find_distributions(entry, True):

File "C:\Anoconda\lib\site-packages\pkg_resources_init_.py", line 1960, in find_distributions
importer = get_importer(path_item)

File "C:\Anoconda\lib\pkgutil.py", line 419, in get_importer
importer = path_hook(path_item)

TypeError: expected str, bytes or os.PathLike object, not NoneType

Infeasible Problem Detected - CasLL1 alpha sweep with custom Cl, Cd and Cm functions

Hey Peter,
I'm trying to use casll1 as a solver instead of optimizing and I'm performing an alpha sweep analysis on a conventional configuration using my own functions for the sectional Cl, Cd and Cm. These functions are just polynomial fits to data obtained from CFD analyses on the airfoil for the Reynolds and Mach number of interest.
I'm defining the aircraft and running the alpha sweep the same way presented in the examples with the addition of the custom airfoil functions. However, depending on the operating point, the solver raises an error, which can be read using the cas.Opti().debug method:

sol
Opti(Opti {
  instance #0
  #variables: 2 (nx = 144)
  #parameters: 1 (np = 1)
  #constraints: 2 (ng = 144)
  CasADi solver allocated.
  CasADi solver was called: Infeasible_Problem_Detected
})

I played around with the solver settings and various paneling combinations, however, the issue persisted. Is this an issue with the casll1 solver or does it have to do with CasADI? Is there a way to use the casll1 solver without setting up an optimization environment?

I am also attaching the code I'm using along with a json file containing all the data required for the aircraft and operating point definition.
aircraft_casll1.zip

Sorry for the long question. I really think what you are building here is great!

Help

Do you have the MSES code which could design airfoil? Could you provide it?

Add Explanation and Conventions on Wing Modelling Method(s)

Description of Proposed Feature

Wing Modelling may follow various methods, which require explanation and conventions in particular on how large dihedral (i.e. winglets) or large twist (in propeller blade design) and perhaps blending of kinks are handled.
Beside that, aerodynamicists and designers like to keep things simple, thus such methods should be implemented to generate with a minimum of input parameters the required input for the formulation of WingXSec(). It further could also make sense to handle in particular planforms (or at least certain parameters, like the tip-root-chord ratio) as interchangeable objects between different wings.

I.e. just think of a single-kinked leading edge and a straight trailing edge. Consider sweep, dihedral and twist (and any later change of them) and further a flap along the entire half-span starting at x_hinge_root = 0.75 and ending with x_hinge_tip = 0.6. How many sections would you have to specify at least? Ok, imagine further a change in airfoil starting at another location than the leading edge kink or any other new design feature to account for. Imagine further, you want to scale all chords or scale the entire wing, keeping aspect ratio constant. There are quite a lot parameters to watch.

Below a brief summary is provided:

Method 1:
Planform (2D) -> Dihedral and Twist -> 3D LE & TE -> Section Sweep along LE & TE (with constant or variing / interpolated airfoils, if specified)

In this method the planform may again be specified by different input:

  • Either the 2D LE & TE are defined, using (unsteady) poly-lines or (multiple) bezier-splines, from which all other planform properties (i.e. projected area, aspect ratio, chord distribution, 25%-chord-line and sweep angle distribution) are derived
  • Or the before mentioned vice versa, where any arbitrary XX%-chord-line could be chosen for convenience

Method 2:
Freeform, using Bezier Surfaces or NURBS (unconventional, but feasible), whose poles are parametrized and can thus be highly abstracted by partially constraining them to each other.

Although may be not explained straight forward, I hope, this gave some inspiration.

Alternatives I Have Considered

None.

Additional Context

None.

ployly module not found error.

Hi, i'm quite new to this but have been having problems getting anything to run as any example i run comes up with ModuleNotFoundError: No module named 'plotly'.
I have installed various versions of plotly to try and get it to work but it hasn't. Any help would be appreciated.

Python 3.8.2 (v3.8.2:7b3ab5921f, Feb 24 2020, 17:52:18)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license()" for more information.

= RESTART: /Users/bradleyrelyea/Desktop/AeroSandbox-1.1.5/casvlm1_conventional_analysis_alpha_sweep.py
Traceback (most recent call last):
File "/Users/bradleyrelyea/Desktop/AeroSandbox-1.1.5/casvlm1_conventional_analysis_alpha_sweep.py", line 3, in
from aerosandbox import *
File "/Users/bradleyrelyea/Desktop/AeroSandbox-1.1.5/aerosandbox/init.py", line 1, in
from .aerodynamics import *
File "/Users/bradleyrelyea/Desktop/AeroSandbox-1.1.5/aerosandbox/aerodynamics/init.py", line 1, in
from .casvlm1 import *
File "/Users/bradleyrelyea/Desktop/AeroSandbox-1.1.5/aerosandbox/aerodynamics/casvlm1.py", line 1, in
from .aerodynamics import *
File "/Users/bradleyrelyea/Desktop/AeroSandbox-1.1.5/aerosandbox/aerodynamics/aerodynamics.py", line 1, in
from ..geometry import *
File "/Users/bradleyrelyea/Desktop/AeroSandbox-1.1.5/aerosandbox/geometry.py", line 1, in
import plotly.express as px
ModuleNotFoundError: No module named 'plotly'

Keeping both a gui and a command line interface

You state you want to add a GUI in the future development section. However, I urge you to still have both the GUI and command-line interface have the same features. That way both programmer(using a subprocess module like in python) and non-programmers can still use your software in the future.

Unable to Run Example Script

Bug Description

Trying to run example script from the readme

Steps to Reproduce

Install package (either local or with pypi, tried both)
Copy script from readme
Run program

Expected Behavior

Produce images from readme, instead there is some incompatibility with WingXSec, these are easily fixed.

However, VLM3 is not found, and the existing example uses only airplane and op_point, while the current implementation also expects an "opti" param. I'm not sure how to incorporate this?

System Information

  • Operating System: MacOS
  • Python Version: 3.7.0
  • AeroSandbox Verion: 3.0.11

Other Information

Thanks! Would love to experiment with this program more, but need a basis to work off. I am trying to do some analysis for different car wing setups (single + dual element). Mostly interested in doing L/D analysis for various airfoil designs.

Anything to get me in the right direction would be appreciated! Thanks!

Set bounds to versions in setup.py

Describe the bug
The library versions in the field install_requires do not have any bounds.

This could create reproducibility problems.

It is best to set lower bounds <= or different than != in this field, and to freeze them in the requirements.txt file (as you have done).

3D Panel method

Hi Peter!

I want to use the panel method to evaluate the pressure field on the lower and the upper surfaces of an extruded NACA profile. The presence of the fuselage can be neglected and the profile considered as a cantilever beam fixed on one end. The resulting pressure field is then integrated to calculate the resultant at specific points.

Here is an example:
{D00B17B5-8332-4707-98AE-E3A926380B2C} png

My question is, then, how can I use the AeroSandbox package to evaluate the pressure field? I saw this image (https://peterdsharpe.github.io/AeroSandbox/media/images/panel1_naca4412.png) on the package readme.md and I wanted to do the same. The problem is that I looked extensively at the package's code and tutorials and I didn't find any reference to the panel method. Is any sort of panel method implemented in your toolbox? Or I'm completely wrong and you calculated the pressure field in the image using the VLM?

Keep up with the wonderful work you're doing, the outcomes of AeroSandbox are really interesting.

Airplane not considering Wing>xsecs>Airfoil: name or coordinates for draw()

When drawing a simple Wing with only two xsecs and each with airfoil=Airfoil(name="naca0099") the image is does not respect the airfoil.

To Reproduce

import copy
from aerosandbox import *

airplane = Airplane(
    name="Test1",
    x_ref=0,  # CG location
    y_ref=0,  # CG location
    z_ref=0,  # CG location
    wings=[
        Wing(
            name="Main Wing",
            x_le=0,  # Coordinates of the wing's leading edge
            y_le=0,  # Coordinates of the wing's leading edge
            z_le=0,  # Coordinates of the wing's leading edge
            symmetric=True,
            xsecs=[  # The wing's cross ("X") sections
                WingXSec(  # Root
                    x_le=0,  # Coordinates of the XSec's leading edge, relative to the wing's leading edge.
                    y_le=0,  # Coordinates of the XSec's leading edge, relative to the wing's leading edge.
                    z_le=0,  # Coordinates of the XSec's leading edge, relative to the wing's leading edge.
                    chord=0.1,
                    twist=0,  # degrees
                    airfoil=Airfoil(name="naca0099"),
                ),
                WingXSec(  # Mid
                    x_le=0.0,
                    y_le=0.2,
                    z_le=0,
                    chord=0.1,
                    twist=0,
                    airfoil=Airfoil(name="naca0099"),
                )
            ]
        )
    ]
)

# Create solved object
ap = copy.deepcopy(airplane)
ap.draw()

Expected behavior
Image with a Cross Section corresponding to NACA0099:
Screen Shot 2020-06-14 at 19 01 06

Result not desired
Screen Shot 2020-06-14 at 19 15 17
Screen Shot 2020-06-14 at 19 15 49

Platform (untested elsewhere)

  • OS: macOS Catalina Version 10.15.5
  • Python 3.6.5 with virtualenv==16.5.0 containing:
    AeroSandbox==2.2.9
    casadi==3.5.1
    cycler==0.10.0
    dill==0.3.1.1
    kiwisolver==1.2.0
    matplotlib==3.2.1
    multiprocess==0.70.9
    numpy==1.18.5
    pandas==1.0.4
    plotly==4.8.1
    pyparsing==2.4.7
    python-dateutil==2.8.1
    pytz==2020.1
    retrying==1.3.3
    scipy==1.4.1
    seaborn==0.10.1
    six==1.15.0
    tqdm==4.46.1

Other Info
Tried using coordinate from .dat file for foil without success.

error when run the file" \examples\geometry_engine\airfoil\airfoil_xfoil_parallel.py"

when run the airfoil_xfoil_parallel.py file under spyder envirement, the out put are as follows:

Running XFoil sweeps on Airfoil sd7032...
Traceback (most recent call last):

File "D:\PROGRAM\python\AeroSandbox\examples\geometry_engine\airfoil\airfoil_xfoil_parallel.py", line 8, in
parallel=True

File "C:\ProgramData\Anaconda3\lib\site-packages\aerosandbox\geometry\airfoil.py", line 987, in get_xfoil_data
pool = mp.Pool(mp.cpu_count())

File "C:\ProgramData\Anaconda3\lib\site-packages\multiprocess\context.py", line 119, in Pool
context=self.get_context())

File "C:\ProgramData\Anaconda3\lib\site-packages\multiprocess\pool.py", line 176, in init
self._repopulate_pool()

File "C:\ProgramData\Anaconda3\lib\site-packages\multiprocess\pool.py", line 241, in _repopulate_pool
w.start()

File "C:\ProgramData\Anaconda3\lib\site-packages\multiprocess\process.py", line 112, in start
self._popen = self._Popen(self)

File "C:\ProgramData\Anaconda3\lib\site-packages\multiprocess\context.py", line 322, in _Popen
return Popen(process_obj)

File "C:\ProgramData\Anaconda3\lib\site-packages\multiprocess\popen_spawn_win32.py", line 46, in init
prep_data = spawn.get_preparation_data(process_obj._name)

File "C:\ProgramData\Anaconda3\lib\site-packages\multiprocess\spawn.py", line 172, in get_preparation_data
main_mod_name = getattr(main_module.spec, "name", None)

AttributeError: module 'main' has no attribute 'spec'

AVL Fortran runtime error: End of file

Bug Description

When running 01 - AVL.ipynb AVL produces the following error:


 Reading file: airplane.avl  ...

 Configuration: Example Airplane                                            

   Building surface: Wing                                    
At line 629 of file ../src/ainput.f
Fortran runtime error: End of file

Error termination. Backtrace:
#0  0x7f67df8dcd5a
#1  0x7f67df8dd869
#2  0x7f67df8de54f
#3  0x7f67dfb21c5b
#4  0x7f67dfb1b15c
#5  0x7f67dfb1bdc9
#6  0x5606701ea350
#7  0x5606701cb015
#8  0x5606701cc652
#9  0x7f67df5870b2
#10  0x5606701c86bd
#11  0xffffffffffffffff

Steps to Reproduce

  1. I first installed AVL using steps found here: https://ubuntuforums.org/showthread.php?t=2274062
  2. Added AVL to system path.
  3. Ran 01 - Basic Aircraft Geometry.ipynb 01 - AVL.ipynb

System Information

  • Operating System: Ubuntu 20.04
  • Python Version: 3.9
  • AeroSandbox Verion: 3.3.0
  • AVL Version: 3.32

Other Information

I tested AVL on the supergee.avl example and obtained the following plots, so I am confident it is installed correctly.
image
image

Incorrect Inviscid Airfoil Analysis

Bug Description

Running an inviscid analysis on a NACA 0012 airfoil at 0 degrees angle of attack produces non-zero lift coefficient.

Steps to Reproduce

from aerosandbox import Airfoil, AirfoilInviscid, OperatingPoint
a = AirfoilInviscid(
    airfoil=[
        Airfoil("naca0012")
            .repanel(50)
    ],
    op_point=OperatingPoint(
        velocity=1,
        alpha=0,
    )
)
print(f"CL: {a.Cl}")

CL: -0.17311351475463538

Expected Behavior

CL: 0

System Information

  • Operating System: Windows 10
  • Python Version: 3.9
  • AeroSandbox Version: 3.0.13

Tutorial 01 - Vortex Lattice Method is not working

Hello,
there is some issue with tutorial on VLM (AeroSandbox/tutorial/06 - Aerodynamics/01 - AeroSandbox 3D Aerodynamics Tools/01 - Vortex Lattice Method.ipynb)

If I run it, I've got error: TypeError: VortexLatticeMethod.init() missing 1 required positional argument: 'opti'
In case I provide argument opti=asb.Opti() I obtain other error:
TypeError: AeroSandboxObject.init() takes 1 positional argument but 3 were given

Could you please help me with solving this issue?

Thank you,
Jan

Units

Nice project.
I noticed your note re SI units

One final point to note: as we're all sensible and civilized human beings here, all inputs and outputs to AeroSandbox are expressed in base metric units (meters, Newtons, kilograms, etc.).

So may I take it that velocity is in m/s?
If I wrote a pull request going through and annotating the docstrings to reflect would that be ok?

Problem running the optimization example

Describe the bug
When I run vlm2_tapered_wing_optimization.py, I get following numpy error thrown:
TypeError: invalid data type for einsum.
The function is calculate_Vij (line 1597) in aerodynamics.py

Traceback (most recent call last):
File "examples/vlm2_tapered_wing_optimization.py", line 91, in
bounds=[(0.001, 1), (0, 10)]
File "C:\anaconda3\envs\AeroSandbox\lib\site-packages\scipy-1.3.0-py3.7-win-amd64.egg\scipy\optimize_minimize.py", line 608, in minimize
constraints, callback=callback, **options)
File "C:\anaconda3\envs\AeroSandbox\lib\site-packages\scipy-1.3.0-py3.7-win-amd64.egg\scipy\optimize\slsqp.py", line 423, in _minimize_slsqp
g = append(fprime(x), 0.0)
File "C:\anaconda3\envs\AeroSandbox\lib\site-packages\scipy-1.3.0-py3.7-win-amd64.egg\scipy\optimize\optimize.py", line 326, in function_wrapper
return function(*(wrapper_args + args))
File "C:\anaconda3\envs\AeroSandbox\lib\site-packages\autograd-1.2-py3.7.egg\autograd\wrap_util.py", line 20, in nary_f
return unary_operator(unary_f, x, *nary_op_args, **nary_op_kwargs)
File "C:\anaconda3\envs\AeroSandbox\lib\site-packages\autograd-1.2-py3.7.egg\autograd\differential_operators.py", line 24, in grad
vjp, ans = _make_vjp(fun, x)
File "C:\anaconda3\envs\AeroSandbox\lib\site-packages\autograd-1.2-py3.7.egg\autograd\core.py", line 10, in make_vjp
end_value, end_node = trace(start_node, fun, x)
File "C:\anaconda3\envs\AeroSandbox\lib\site-packages\autograd-1.2-py3.7.egg\autograd\tracer.py", line 10, in trace
end_box = fun(start_box)
File "C:\anaconda3\envs\AeroSandbox\lib\site-packages\autograd-1.2-py3.7.egg\autograd\wrap_util.py", line 15, in unary_f
return fun(*subargs, **kwargs)
File "examples/vlm2_tapered_wing_optimization.py", line 53, in objective_function
ap = get_ap(inputs)
File "examples/vlm2_tapered_wing_optimization.py", line 47, in get_ap
ap.run(verbose=False)
File "C:\anaconda3\envs\AeroSandbox\lib\site-packages\aerosandbox-0.1.5-py3.7.egg\aerosandbox\aerodynamics.py", line 23, in wrapper
File "C:\anaconda3\envs\AeroSandbox\lib\site-packages\aerosandbox-0.1.5-py3.7.egg\aerosandbox\aerodynamics.py", line 785, in run
File "C:\anaconda3\envs\AeroSandbox\lib\site-packages\aerosandbox-0.1.5-py3.7.egg\aerosandbox\aerodynamics.py", line 1307, in setup_geometry
File "C:\anaconda3\envs\AeroSandbox\lib\site-packages\aerosandbox-0.1.5-py3.7.egg\aerosandbox\aerodynamics.py", line 23, in wrapper
File "C:\anaconda3\envs\AeroSandbox\lib\site-packages\aerosandbox-0.1.5-py3.7.egg\aerosandbox\aerodynamics.py", line 1597, in calculate_Vij
File "C:\anaconda3\envs\AeroSandbox\lib\site-packages\autograd-1.2-py3.7.egg\autograd\tracer.py", line 48, in f_wrapped
return f_raw(*args, **kwargs)
File "<array_function internals>", line 6, in einsum
File "C:\anaconda3\envs\AeroSandbox\lib\site-packages\numpy-1.17.0rc1-py3.7-win-amd64.egg\numpy\core\einsumfunc.py", line 1356, in einsum
return c_einsum(*operands, **kwargs)
TypeError: invalid data type for einsum

Include versioneer.py to have automatic version update in setup.py

Is your feature request related to a problem?
I have realized that you update manually the version number. This could create problems and mismatches.

Describe the solution you'd like
Include versioneer in the project.

It is a great tool, since when you haven't explicitly created a new tag, it indicates from the most recent tag you are working from, the number of commits you are ahead and the commit hash. When a clean tag is created, it's caught and correctly set.

I can implement this feature if you want to.

Add columns for hinge force coefficients (c.Fx, cFy) in XFoil's Airfoil Polar File

Description of Proposed Feature

XFoil and XFLR5 are lacking ever since of a complete polar data output of an airfoil, where an airfoils' flap has been specified.
While for this case just the hinge moment coefficient cH has been provided in that file, hinge force coefficients in x- and y-direction were missing through all released versions, although these coefficients are (likewise the hinge moment coefficient) a result of integrating (or summing) the cp-distribution over the flapped panels.
For the sake of completeness, the hinge force coefficients should be added to that file output. This allows also the computation of the flap's pressure point location that may be relevant in subsequent aero-elastic analyses.

Alternatives I Have Considered

Although it might be possible to write a script, reading the airfoil coordinates and every operations points' cp-distributions to perform these integrations / summations and then add these results to an improved polar data file, I could imagine it would be wiser to patch XFoil directly for various reasons.

Additional Context

Likewise the hinge moment coefficients, the hinge force coefficients are of interrest in wing conception and preliminary design. While the hinge moment coefficients are a good measure to be accounted in initial sizing of the control system, the hinge force coefficients tell you the load split between main foil and flap and thus serve at least in determining ball parl numbers for subsequent structural wing and flap sizing.

Question: STL Support?

Is it possible to load an STL (or other CAD file) of a wing/fuselage to do aero analysis?

No force output by panel1

Hello,
When I test the panel1 program ,I find that the relevant codes related to aero force have been annotated. I tried to activate them again, but there are many problems ,and the results are also not right. Is it posiible to recover the calcuration of force?

Problems installing on a Mac

Describe the bug
The installation seems to break for xfoil.

So it is actually not an AeroSandbox bug, but one of its dependencies.

I wonder if xfoil is mandatory for the VLM, or it could be set up as an optional install only required for certain features (I have seen this in pandas with Excel sheets).

To Reproduce
Steps to reproduce the behavior:

  1. git clone https://github.com/peterdsharpe/AeroSandbox.git
  2. cd AeroSandbox
  3. pip install -e .

Expected behavior
Clean installation.

Screenshots

Building wheels for collected packages: xfoil
  Running setup.py bdist_wheel for xfoil ... error
  Complete output from command /Users/Kike/anaconda/envs/aerosandbox/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/hg/364vw98j6r98p3z00l61zbpw0000gn/T/pip-install-nqxjpel8/xfoil/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /private/var/folders/hg/364vw98j6r98p3z00l61zbpw0000gn/T/pip-wheel-z9nqcwl6 --python-tag cp36:
  /Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'zip_save'
    warnings.warn(msg)
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.9-x86_64-3.6
  creating build/lib.macosx-10.9-x86_64-3.6/xfoil
  copying xfoil/xfoil.py -> build/lib.macosx-10.9-x86_64-3.6/xfoil
  copying xfoil/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/xfoil
  copying xfoil/test.py -> build/lib.macosx-10.9-x86_64-3.6/xfoil
  copying xfoil/model.py -> build/lib.macosx-10.9-x86_64-3.6/xfoil
  running build_ext
  @(#)PROGRAM:ld  PROJECT:ld64-409.12
  BUILD 17:47:51 Sep 25 2018
  configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em arm64e arm64_32
  LTO support using: LLVM version 10.0.0, (clang-1000.11.45.5) (static support for 21, runtime is 21)
  TAPI support using: Apple TAPI version 10.0.0 (tapi-1000.11.8.2)
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/private/var/folders/hg/364vw98j6r98p3z00l61zbpw0000gn/T/pip-install-nqxjpel8/xfoil/setup.py", line 149, in <module>
      zip_save=False
    File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/site-packages/setuptools/__init__.py", line 144, in setup
      return distutils.core.setup(**attrs)
    File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 223, in run
      self.run_command('build')
    File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/site-packages/setuptools/command/build_ext.py", line 87, in run
      _build_ext.run(self)
    File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/command/build_ext.py", line 308, in run
      force=self.force)
    File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/ccompiler.py", line 1031, in new_compiler
      return klass(None, dry_run, force)
    File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/cygwinccompiler.py", line 285, in __init__
      CygwinCCompiler.__init__ (self, verbose, dry_run, force)
    File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/cygwinccompiler.py", line 129, in __init__
      if self.ld_version >= "2.10.90":
  TypeError: '>=' not supported between instances of 'NoneType' and 'str'
  
  ----------------------------------------
  Failed building wheel for xfoil
  Running setup.py clean for xfoil
Failed to build xfoil
Installing collected packages: numpy, casadi, six, retrying, plotly, xfoil, AeroSandbox
  Running setup.py install for xfoil ... error
    Complete output from command /Users/Kike/anaconda/envs/aerosandbox/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/hg/364vw98j6r98p3z00l61zbpw0000gn/T/pip-install-nqxjpel8/xfoil/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/hg/364vw98j6r98p3z00l61zbpw0000gn/T/pip-record-qfdiogyh/install-record.txt --single-version-externally-managed --compile:
    /Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'zip_save'
      warnings.warn(msg)
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.9-x86_64-3.6
    creating build/lib.macosx-10.9-x86_64-3.6/xfoil
    copying xfoil/xfoil.py -> build/lib.macosx-10.9-x86_64-3.6/xfoil
    copying xfoil/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/xfoil
    copying xfoil/test.py -> build/lib.macosx-10.9-x86_64-3.6/xfoil
    copying xfoil/model.py -> build/lib.macosx-10.9-x86_64-3.6/xfoil
    running build_ext
    @(#)PROGRAM:ld  PROJECT:ld64-409.12
    BUILD 17:47:51 Sep 25 2018
    configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em arm64e arm64_32
    LTO support using: LLVM version 10.0.0, (clang-1000.11.45.5) (static support for 21, runtime is 21)
    TAPI support using: Apple TAPI version 10.0.0 (tapi-1000.11.8.2)
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/hg/364vw98j6r98p3z00l61zbpw0000gn/T/pip-install-nqxjpel8/xfoil/setup.py", line 149, in <module>
        zip_save=False
      File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/site-packages/setuptools/__init__.py", line 144, in setup
        return distutils.core.setup(**attrs)
      File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/command/install.py", line 545, in run
        self.run_command('build')
      File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/command/build.py", line 135, in run
        self.run_command(cmd_name)
      File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/site-packages/setuptools/command/build_ext.py", line 87, in run
        _build_ext.run(self)
      File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/command/build_ext.py", line 308, in run
        force=self.force)
      File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/ccompiler.py", line 1031, in new_compiler
        return klass(None, dry_run, force)
      File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/cygwinccompiler.py", line 285, in __init__
        CygwinCCompiler.__init__ (self, verbose, dry_run, force)
      File "/Users/Kike/anaconda/envs/aerosandbox/lib/python3.6/distutils/cygwinccompiler.py", line 129, in __init__
        if self.ld_version >= "2.10.90":
    TypeError: '>=' not supported between instances of 'NoneType' and 'str'
    
    ----------------------------------------
Command "/Users/Kike/anaconda/envs/aerosandbox/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/hg/364vw98j6r98p3z00l61zbpw0000gn/T/pip-install-nqxjpel8/xfoil/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/hg/364vw98j6r98p3z00l61zbpw0000gn/T/pip-record-qfdiogyh/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/hg/364vw98j6r98p3z00l61zbpw0000gn/T/pip-install-nqxjpel8/xfoil/

Desktop (please complete the following information):

  • OS: MacOs HighSierra 10.13.6
  • AeroSandbox 1.1.1

VLM3 calculation prints out VLM2

Describe the bug
Seems to be a copy/paste typo in aerodynamics.py:
class vlm3(AeroProblem) and there in the function def run(self, verbose=True)::

It prints:
if self.verbose: print("Running VLM2 calculation...")
and
if self.verbose: print("VLM2 calculation complete!")

Expected behavior
if self.verbose: print("Running VLM3 calculation...")
and
if self.verbose: print("VLM3 calculation complete!")

Error Running casll1_fuselage_simple_analysis_point.py

I had this error running this example
Traceback (most recent call last):
File "C:/Users/Gyaase Elvis/PycharmProjects/Aerosoft_2/aircraft_analysis/temp.py", line 154, in
ap = Casll1Fuse( # Set up the AeroProblem
NameError: name 'Casll1Fuse' is not defined

Any help would be appreciated

Importing aerosandbox.library.airfoils raises warnings

Bug Description

When importing aerosandbox.library.airfoils warnings are raised relating to the lack of coordinates available for the generic and flat plate airfoils.

Steps to Reproduce

>>> import aerosandbox.library.airfoils
C:\Users\MatthewBerk\git\DawnDesignTool\.venv\lib\site-packages\aerosandbox\library\airfoils.py:35: UserWarning: Airfoil Generic Cambered Airfoil had no coordinates assigned, and could not parse the `coordinates` input!
  generic_cambered_airfoil = Airfoil(
C:\Users\MatthewBerk\git\DawnDesignTool\.venv\lib\site-packages\aerosandbox\library\airfoils.py:47: UserWarning: Airfoil Generic Airfoil had no coordinates assigned, and could not parse the `coordinates` input!
  generic_airfoil = Airfoil(
C:\Users\MatthewBerk\git\DawnDesignTool\.venv\lib\site-packages\aerosandbox\library\airfoils.py:102: UserWarning: Airfoil Flat Plate had no coordinates assigned, and could not parse the `coordinates` input!
  flat_plate = Airfoil(

Expected Behavior

No output

System Information

  • Operating System: Windows 10
  • Python Version: 3.9.7
  • AeroSandbox Version: 3.3.4

Other Information

I suspect that the other airfoils in aerosandbox.library.airfoils get away with this by either being in the UIUC database or by being NACA, which both seem to have special handling in the aerosandbox.geometry.airfoil.Airfoil constructor. However 'generic' and 'flat_plate' airfoils do not have UIUC or NACA equivalents and aren't being found.

Use multivariate regression analysis to obtain "Application Laws" for Airfoil Polar Data

Background / Motivation

XFLR5 required to perform an excessive number of airfoil polar calculations in order to interpolate from this data, when applied to the 3D wing for estimating drag for instance. Slight changes on the airfoil along the wing span (i.e. a change of max. thickness, nose radius size or TE-angle - just to name a few) most often required to ammend the polar data representing these changes again for a set of different Re-Numbers, flap angles, perhaps flap ratios. The more complex the wing became in these terms the much more airfoil polar data was required.
Beside that, existing problems like "C.l out of envelope" or "cannot interpolate at Re=..." and similar errormessages should be handled in an automated fashion. Outliers in the different curves should automatically be identified and further on ignored.
Range parameters, like alpha(cLmax), alpha(cLmin), cLmax, cLmin, as well as further characteristic measures like the relevant derivatives as dcL/dalpha, dalpha/ddelta etc. should be automatically identified - for convenience, to allow plausibility checks and first and foremost to speed up the entire process.

Description of Proposed Feature

Consider all airfoil polar results as unknown functions of following Parameters:

  • alpha
  • Airspeed -> Re, Ma
  • Airfoil Geometry: true_chord -> Re, Nose_Radius, Max_Thickness, Pos_Max_Thickness, Chamber(...), TE-Gap, TE-angle etc.
  • Flap specific Geometry: number of flaps, Flap deflection, Flap ratio resp. x_hinge and y_hinge
  • further information, i.e. forced transitions, or Ncrit

Above List of parameters can be reduced or extended, pending on the complexity of the 3D Wing, to be analyzed.
Pending on the wing´s complexity and its coarsely foreseen range in airspeed for most of these parameters lower and upper boundaries and the number of intermediate steps in between should be specified by the user.
For all combinations of defined parameter values the polar data shall be obtained, using xfoil. This concludes in n operation points, where n is the product of the different numbers of values, each parameter is investigated for, i.e.:

7 different Re-Numbers * 5 different flap deflections * 20 different AoA´s * 2 different Airfoils (varying along the wing in a single or multiple measures, such as nose_radius, maximum thickness etc) * 3 different flap ratios * ... whatever parameter is still to be addressed ... =~ 5200+ operation points :-/

Thus, n is always quite a huge number to be handled manually (without automation), although multivariate regression allows to condense this number. Symmetries in the data (i.e. the point-symmetric cL vs alpha curve of an symmetric airfoil) may further be used to condense this data).
However, once the dataset is complete, a multivariate regression can be performed for each of the application laws on:

cL(alpha, delta, Re, flap ratio, ...), cD(...), cM(...), cHM(...), cHF(...) where these functions are approximated by (sometimes quite) high order polynomials:

c[0] + c[1]*alpha + c[2]*delta + ... + c[4]*flap_ratio + ... + c[i]*alpha^2 + c[i+1]alphadelta + c[i+2]*delta^2 + ... + c[j]*alpha^15 + ...

It must be noted that by far not every term in these polynomials will be really needed to approximate the data sufficiently. Some terms have higher influence, others have less, a lot are insignifcant. The regression statistics will figure out, which terms should be kept and which can be droppped, allowing again to condense the polynomial automatically.

The final result is a more or less handy polynomial function, which is always steady and multiple times derivable in the specified ranges, where the coefficient c[1] is nothing else than first derivate by alpha, i.e. dcL/dalpha or dcM/dalpha etc. Hence, cutting these polynomials after the first order terms, provides the "linearized" airfoil polar data very accurately.

Alternatives I Have Considered

None. As mentioned before, unaddressing this, like in XFLR5, will leave the user to a considerable workload, in particular, when intermediate flap deflections shall be investigated, or when the flap ratio varies along the span.

Additional Context

If needed I can provide a full example.

Please excuse my English.

pytest is required but not included

Bug Description

Steps to Reproduce

Install Aerosandbox
Attempt to run the simple_example.py in the examples directory on this repo

Expected Behavior

Script running. But it says I don't have pytest. I believe this is from aerosandbox importing Opti, and then opti importing pytest.

System Information

  • Operating System: Ubuntu 20.04.2
  • Python Version: 3.8.5
  • AeroSandbox Verion: Unknown, but just installed from pip yesterday.

Other Information

Validation test

Is your feature request related to a problem? Please describe.
What is your opinion on including a validation test case?
That way solver accuracy can be displayed and tests can be added to cover new features as they are added.

Describe the solution you'd like
I will write an example next week for PR if you will consider.
I will also include an airfoil file load method as listed in task https://github.com/peterdsharpe/AeroSandbox/projects/2#card-23370502

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.