Skip to content
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

Generalized propulsion functions #113

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

ngomezve
Copy link
Contributor

@ngomezve ngomezve commented Dec 16, 2024

This PR introduces new engine functions: enginecalc! and engineweight! that replace the engine function calls. These functions act as handles for any propulsion function that can use the same syntax, e.g., do design or off-design cases.

The enginecalc! and engineweight! functions are stored and then extracted from a new Engine object produced when the input file is read. The user is free to then replace those functions with others if a more custom propulsion option is desired.

The old turbofan functions are now stored in a dedicated turbofan folder inside src/engine. New functions called tfwrap! and tfweightwrap! have been created as wrappers for the old functions and related pieces of code, such that these can be called by the generalized functions.

Copy link

codecov bot commented Dec 16, 2024

Codecov Report

Attention: Patch coverage is 98.51485% with 3 lines in your changes missing coverage. Please review.

Project coverage is 73.53%. Comparing base (5c5b701) to head (6c2f47e).

Files with missing lines Patch % Lines
src/misc/engine.jl 77.77% 2 Missing ⚠️
src/engine/turbofan/tfwrap.jl 97.91% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #113      +/-   ##
==========================================
+ Coverage   73.42%   73.53%   +0.10%     
==========================================
  Files          78       81       +3     
  Lines       13671    13733      +62     
==========================================
+ Hits        10038    10098      +60     
- Misses       3633     3635       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ngomezve ngomezve marked this pull request as ready for review January 15, 2025 15:24
src/misc/engine.jl Show resolved Hide resolved
src/misc/engine.jl Outdated Show resolved Hide resolved
src/misc/engine.jl Outdated Show resolved Hide resolved
src/sizing/wsize.jl Outdated Show resolved Hide resolved
src/sizing/wsize.jl Outdated Show resolved Hide resolved
src/sizing/wsize.jl Outdated Show resolved Hide resolved
src/misc/engine.jl Outdated Show resolved Hide resolved
#Unpack aircraft
pari, parg, parm, para, pare, fuse, fuse_tank, wing, htail, vtail = unpack_ac(ac, imission)
#Engine model
enginecalc!, _ = extract_engine_model(ac.engine)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could access all of this directly with engine.enginecalc! with the suggested changes

src/misc/engine.jl Outdated Show resolved Hide resolved
@ngomezve
Copy link
Contributor Author

I made the changes suggested by @askprash. The code is still somewhat slower and with more allocations than main; not totally sure why. In main, the default aircraft median sizing time is 62.773 ms with 663255 allocations. In dev_generalprop, the median time is 64.327 ms with 706241 allocations.

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.

2 participants