-
Notifications
You must be signed in to change notification settings - Fork 102
Simple Mass Component #810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Replace Aviary example Jupyter notebooks
Removed jupyter output cells
Add files via upload
…nal_flight_phases_2.ipynb
…aft_mission_optimization.ipynb
desc='optional data file of fuselage geometry') | ||
|
||
self.options.declare('custom_fuselage_function', | ||
types=FunctionType, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FunctionType is not defined? I don't know what kind of object is is supposed to be
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This component is super broken, the only input that actually does anything is thickness distribution. Span, chord, thickness, twist, all unused
n_points = num_sections | ||
jnp.linspace(0, 1, n_points) | ||
1 / (n_points - 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if the last 2 lines are supposed to be modifying n_points? Maybe missing a n_points =
?
num_sections = self.options['num_sections'] | ||
|
||
# Wing spanwise distribution | ||
jnp.linspace(0, aircraft__wing__span, num_sections) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Numpy functions do not modify arrays, and instead create a fresh array and return that - need to capture the output of this function, probably intended to be num_sections = jnp.linspace(...)
?
|
||
if airfoil_file is not None: | ||
aircraft__horizontal_tail__mass, _ = quadgk( | ||
density * 2 * thickness * jnp.sqrt(1 + jnp.gradient(camber_line) ** 2), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wing.py
uses thickness_dist here, I think that is the intended calculation? Missing here
'twist', val=jnp.zeros(self.options['num_sections']), units='deg' | ||
) # Twist angles -- no aviary input | ||
|
||
self.add_input( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thickness_dist
is a calculated value for the tail components, but an input here?
There are major discrepancies between the wing and tail mass computations that need to be resolved before I'll approve merge. Tests could use some additional cases, there are currently no tests happening for airfoil data files. If a data file for a NACA airfoil is given, the results should match the calculated value |
Summary
This is the "simple mass" contribution. It is fairly bare bones right now, accounting for a relatively simple wing, fuselage, and tail components, with mass calculated using basic physics. There is also a materials database dictionary inside to allow for various densities to be used. The test folder contains all the unittests for each component as well as the summation.
The components were built using OpenMDAO JAX -- with jax and jax.numpy.
Integration was done using quadgk, a package created to mimic scipy.quad but with JAX compatibility. The JAX developers do not plan to add scipy.quad to jax.scipy, and scipy.quad was favored for the integration compared to jax.trapz.
The basics for the wing and tail involve a 4-digit NACA airfoil and the corresponding equations that describe the thickness, chord, and camber. I have basic functions implemented inside it to allow for .dat files (assuming the airfoil data file follows the convention that UIUC's airfoil database follows) and interpolators to pick out these.
Related Issues
Backwards incompatibilities
None
New Dependencies
JAX, jax.numpy, quadgk, quadax