Skip to content

Conversation

szoppelt
Copy link

@szoppelt szoppelt commented Jul 3, 2025

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

  • Resolves #

Backwards incompatibilities

None

New Dependencies

JAX, jax.numpy, quadgk, quadax

szoppelt and others added 30 commits January 14, 2025 13:36
Replace Aviary example Jupyter notebooks
Removed jupyter output cells
desc='optional data file of fuselage geometry')

self.options.declare('custom_fuselage_function',
types=FunctionType,
Copy link
Contributor

@jkirk5 jkirk5 Jul 18, 2025

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

Copy link
Contributor

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

Comment on lines +123 to +125
n_points = num_sections
jnp.linspace(0, 1, n_points)
1 / (n_points - 1)
Copy link
Contributor

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)
Copy link
Contributor

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),
Copy link
Contributor

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(
Copy link
Contributor

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?

@jkirk5
Copy link
Contributor

jkirk5 commented Jul 21, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants