Skip to content

Using the int() function on Aircraft.BWB.NUM_BAYS #1084

@xjjiang

Description

@xjjiang

Desired capability or behavior.

For BWB aircraft using FLOPS based geometry, there is a need for the number of bays (Aircraft.BWB.NUM_BAYS). It has to be a float because it is needed by the computation of Aircraft.Furnishings.MASS. In the computation of Aircraft.BWB.NUM_BAYS, int() function is used. Here is a comment from Ken:

"For the int calls, I see that those are part of a while loop that solves a nonlinear equation by Gauss-Siedel until it converges. The interesting part is that it solves int(x) = f(int(x)) instead of x=f(x). if we smooth any of the ints, the algorithm will probably take many more iterations. I wonder if it would still converge. One solution might be to rewrite this using an OpenMDAO solver, solve for a real-valued num_bays, then use a smoothed int afterwards. FLOPS did something similar with the skin friction calculation, except there were no ints. I rewrote the equations in residual form and used a Newton solver on them."

I did a test that I removed int() in the while loop and made a call to smooth_int_tanh() after the loop. This would change a lot of our test results but all of them are minor. This testing modification is not merged into main.

See BWBDetailedCabinLayout in subsystems/geometry/flops_based/fuselage.py for details.

Is your feature request related to a problem? Please describe.

No response

Associated Bug Report

No response

Metadata

Metadata

Labels

code cleanupCode cleanup, refactoring, or similar helpful reorganizationperformanceImprove runtime or optimization performance

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions