-
Notifications
You must be signed in to change notification settings - Fork 110
Atmosphere Incorporation: USatm1976, MIL_SPEC_210A Hot/Cold/Polar/Tropical, and Offsets #950
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
… files for raw MIL_SPEC_210A data in its original units for easy comparison. changed references to USATM to just atmosphere.py and moved atmosphere group, and atmospherecomp, and akima generator into atmosphere. Removed unused reference to usatm in GASP comments
… of drhos_dh and dsos_dh which were used for calculating MaxQ for spacecraft, reverted density to be computed based on raw density plus a correction factor, reverted speed of sound and dynamic viscosity to be calculated from equations instead of akima since raw data was calculated from equations for USatm1976 and for MIL_SPEC_210A did not have any of that info
…a extractor out of individual raw atmosphere files and consolidated into one call inside of _build_akima_coefs
…ecause the raw data could be in different units.
…d partials to match updated compute, added (int,float) option to to delta_T_Kelvin to allow for user typing in 15 without a decimal point
…e values in init, tested outputs against source data manually and good match. requres inHg60 unit conversion which was added to OM lib
… atmosphere user guide doc
…plines for tropical
This comment was marked as resolved.
This comment was marked as resolved.
… as those value changes were small
…e values in the engine model because original source data is not complete and needed to be extrapolated
| @@ -1,4 +1,4 @@ | |||
| # created 06/06/25 | |||
| # created 01/08/26 at 14:09 by omdao | |||
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.
| # created 01/08/26 at 14:09 by omdao | |
| # created 01/08/26 |
| self.options.declare( | ||
| 'delta_T_Kelvin', | ||
| default=0.0, | ||
| desc='Temperature delta from International Standard Atmosphere (ISA) standard day conditions (degrees Kelvine)', |
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.
| desc='Temperature delta from International Standard Atmosphere (ISA) standard day conditions (degrees Kelvine)', | |
| desc='Temperature delta from International Standard Atmosphere (ISA) standard day conditions (degrees Kelvin)', |
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.
Deg C and K have the same magnitude so it might be more natural language to state that the delta is in Celsius
| self.options.declare( | ||
| 'data_source', | ||
| default='USatm1976', | ||
| desc='The atmospheric model used. Chose one of USatm1976, tropical, polar, hot, cold.', |
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.
Can we simply call it "standard"? It is much simpler to remember than a very specific shortening of "1967 standard atmosphere", and we are using generic terms for the milspec atmospheres anyway
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.
Sounds good to me.
| desc='Temperature delta from International Standard Atmosphere (ISA) standard day conditions (degrees Kelvine)', | ||
| ) | ||
|
|
||
| self.options.declare( |
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 should get updated to use a new Enum that is linked to a new Aviary variable, so users can set this from the csv. Maybe in Mission?. Adding a types argument here pointing to that Enum will also catch incorrect options getting passed - see the speed type option for an example
| "You will need to make a new `_raw_data` dictionary inside your new file. Look at the example `_raw_data` contained in `StandardAtm1976` for reference. \n", | ||
| "\n", | ||
| "## Converting Raw data Proper Units\n", | ||
| "From here on our we need to be especially mindful of units. We are going to use a non-openmdao helper function `_build_akima_coefs` to help create the akima coefficients. \n", |
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.
| "From here on our we need to be especially mindful of units. We are going to use a non-openmdao helper function `_build_akima_coefs` to help create the akima coefficients. \n", | |
| "From here on our we need to be especially mindful of units. We are going to use a helper function `_build_akima_coefs` to help create the akima coefficients. \n", |
I don't think specifying non-openmdao adds any useful info. It's also not a dymos, numpy, pyoptsparse, etc. helper function so why single out OM?
| partials['dsos_dh', 'h'] *= dz_dh**2 | ||
|
|
||
|
|
||
| def _build_akima_coefs(out_stream, raw_data, units): |
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 should probably get moved to a util folder, it feels odd to have here. Maybe an atmosphere/utils.py file?
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.
I also just noticed it probably shouldn't be a private function if we want it to be used by users
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.
Can you move all the atmosphere data files to an atmosphere/data folder?
| "cell_type": "markdown", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "# Adding your own Atmosphere Model\n", |
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.
Maybe this is developer guide atmosphere info. I'm starting to think we need to completely re-organize how we organize the docs anyway though, splitting up the subsystems into different places doesn't seem useful...
| Density in kg/m^3. | ||
| """ | ||
|
|
||
| # turn off ruff linting |
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.
Technically formatting, linting is when actual code besides whitespace gets touched
…low for building atmosphere models
Summary
Incorporates USATM1976 directly into aviary as the default atmosphere so we no longer need to rely on the dymos atmo library.
Incorporates open-source MIL_SPEC_210A atmospheres (hot/cold/polar/tropical) which the user can switch to via options.
Individual atmosphere data is now separated into it's own file, while the core component that imports the data and does the calculations has been named
atmosphere.py.Adds an temperature offset option, allowing the user to shift an atmosphere profile by a specific number of degrees kelvin to mimic hotter / colder days.
Geometric vs. Geopotential input option is preserved.
Removed option to add
dsos_dhas an output. This is now always provided. This is only used by solved 2DOF ODE.Removed
drhos_dhoutput as it was not used in Aviary.Many tests that relied on atmosphere, including some engine conversion tests, referenced the atmosphere model. Because the original dymos atmosphere model was based on English units and used an English akima spline, the values changed slightly when converted to the SI units and the new akima splines. SI units is what the original 1976 atm standard was published in. There were noticeable small differences, rounding etc, between the dymos atmosphere implementation in imperial units and the values published in SI units in the original standard.
Related Issues
Backwards incompatibilities
None
New Dependencies
None