-
Notifications
You must be signed in to change notification settings - Fork 71
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
NPSS builder added #146
NPSS builder added #146
Conversation
Looks like most of the tests that are failing are due to missing files:
I think |
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.
Thanks for putting this together, I'm looking forward to trying this out.
I took a look at the non-NPSS files and left a couple of comments.
aviary/examples/external_subsystems/engine_NPSS/NPSS_Model/Maps_and_Elements/3Dmaps.int
Outdated
Show resolved
Hide resolved
aviary/examples/external_subsystems/engine_NPSS/NPSS_Model/Maps_and_Elements/npss.view_Aviary
Outdated
Show resolved
Hide resolved
aviary/examples/external_subsystems/engine_NPSS/NPSS_Model/Output/turbojet.viewOut
Outdated
Show resolved
Hide resolved
aviary/examples/external_subsystems/engine_NPSS/engine_variables.py
Outdated
Show resolved
Hide resolved
aviary/examples/external_subsystems/engine_NPSS/run_simple_engine.py
Outdated
Show resolved
Hide resolved
aviary/examples/external_subsystems/engine_NPSS/run_simple_engine.py
Outdated
Show resolved
Hide resolved
aviary/examples/external_subsystems/engine_NPSS/table_engine_builder.py
Outdated
Show resolved
Hide resolved
aviary/examples/external_subsystems/engine_NPSS/NPSS_Model/DesignEngineGroup.py
Outdated
Show resolved
Hide resolved
aviary/examples/external_subsystems/engine_NPSS/NPSS_Model/DesignEngineGroup.py
Outdated
Show resolved
Hide resolved
W_DES = inputs['W_DES'] | ||
|
||
# generate the input file for the external code | ||
with open(self.input_file, 'w') as input_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.
Is an in-memory wrap of NPSS feasible in the future?
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 think looking into that would be a great next step, if getting the builder to run faster becomes a priority.
aviary/examples/external_subsystems/engine_NPSS/NPSS_Model/DesignEngineGroup.py
Outdated
Show resolved
Hide resolved
aviary/examples/external_subsystems/engine_NPSS/NPSS_Model/DesignEngineGroup.py
Outdated
Show resolved
Hide resolved
if __name__ == "__main__": | ||
import openmdao.api as om | ||
|
||
SNOPT_EN = False |
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.
We don't generally (anymore) put code down in these blocks, because it is untested and tends to get scale. This might be a good idea to add as a test though. You should add a test regardless, even if it doesn't assert any values, but just makes sure this still runs without error as we continue to develop aviary.
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 am not sure how to proceed with this comment. I was looking at the other external_subystem examples and there is no test folder. How are these tested? For my commit, how does that work when half the code is NPSS? I am guessing the runners that run the tests do not have NPSS on the machines.
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 just took a look at the examples. It looks like they are all tested here: https://github.com/OpenMDAO/Aviary/blob/main/aviary/examples/test/test_all_examples.py
That means all you have to do is have a script that has a name beginning with "run_". I see that you do have one, so it is already being tested (though it is failing right now).
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 removed the test and uploaded. Not sure if i need to make another test.
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 added a bench test.
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.
bench test should be working now.
aviary/examples/external_subsystems/engine_NPSS/NPSS_Model/DesignEngineGroup.py
Outdated
Show resolved
Hide resolved
aviary/examples/external_subsystems/engine_NPSS/table_engine_builder.py
Outdated
Show resolved
Hide resolved
aviary/examples/external_subsystems/engine_NPSS/table_engine_builder.py
Outdated
Show resolved
Hide resolved
-engine_data[:, 4], | ||
units='lbm/s', | ||
desc='Current fuel flow rate ') | ||
engine.add_output(Dynamic.Mission.ELECTRIC_POWER, |
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.
So, i see electric power, nox_rate, and T4 on here. I assume those are things that NPSS can calculate, but isn't in this current version of the wrapper? We are only connecting the thrust, max thrust, and neg fuel flow to this metamodel. We should comment out or remove the remaining 3 unused variables, because if we don't, then it is actually interpolating those values on an array of zeros, and the interpolator probably takes twice as long because of it.
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.
Yes, these are not being populated, however Aviary expects this values from an engine, so they need to exist. Without these outputs there are errors.
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.
Interesting. I didn't have to add additional inputs when doing something similar last year, but Aviary could have changed since then. I will have to investigate.
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 just ran into this with my Turboprop work as well; electric power, nox_rate, and T4 are expected as outputs because of the mux that happens later on.
From Jason:
if outputs are missing from the engine deck it will cause problems with the mux comp later. We'd need to figure out the shortened length of each output and each engine may or may not have different indices in each output variable vector.
Summary
Summary of PR.
Related Issues
Backwards incompatibilities
None
New Dependencies
None