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

Bug in off-design #133

Open
askprash opened this issue Feb 19, 2025 · 0 comments
Open

Bug in off-design #133

askprash opened this issue Feb 19, 2025 · 0 comments
Assignees

Comments

@askprash
Copy link
Member

Great catch by @ngomezve "the squasher of 🐞s"! He noticed a bug in the off-design calculation where the problem is over-constrained. This bug has been there since when woper.jl was translated from FORTRAN (started in this commit here).

The original FORTRAN code actually does not take in user specified altitudes for the off-design missions, but scales the cruise altitude based on the weight of the aircraft:

c---- scale initial cruise altitude by p ~ W 
      ip = ipcruise1
      altkm = para(iaalt,ip)/1000.0
      p0new = pared(iep0,ip) * para(iafracW,ip)/parad(iafracW,ip)
      call pralt(p0new,gee, altkm, T0,p0,rho0,a0,mu0)

We can't be setting CL, Ma, wing geometry and cruise altitude all to specified values and still have L = W.

Two options exist -
First if you are running a single off-design mission:
Option 1: allow user to specify the altitude of the start of cruise and calculate the CL that is appropriate. In general that is not very robust since it means for every new aircraft being designed the user should be able to specify what altitude the off-des missions are going to start at.
Option 2: Don't let the user specify the cruise start altitudes for off-design missions, let the CL at start of cruise be the design CL and find the right cruise altitude similar to the scaling above (pralt is the inverse calculation to get the altitude given the pressure above). In general this is likely to work better because you're asking the aircraft to start at a similar aerodynamic state and asking it to figure out how to get there. This breaks down when the off-design missions vary substantially from the design mission.

If you are optimizing the aircraft design along with a handful of off-design missions then both options above are similar since you can pass control of the altitude or CL to the optimizer as an optimization variable.

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

No branches or pull requests

2 participants