BWB FLOPS Fortran_to_Aviary#947
Conversation
| if Aircraft.CrewPayload.BAGGAGE_MASS_PER_PASSENGER not in input_values: | ||
| if Mission.Design.RANGE in input_values: | ||
| design_range = input_values.get_val(Mission.Design.RANGE, 'nmi')[0] | ||
| baggage_per_pax = 35.0 | ||
| if design_range > 2900: | ||
| baggage_per_pax = 44.0 | ||
| elif design_range > 900: | ||
| baggage_per_pax = 40.0 | ||
| input_values.set_val( | ||
| Aircraft.CrewPayload.BAGGAGE_MASS_PER_PASSENGER, [baggage_per_pax], 'lbm' | ||
| ) | ||
| if verbosity >= Verbosity.BRIEF: | ||
| print( | ||
| 'Set Aircraft.CrewPayload.BAGGAGE_MASS_PER_PASSENGER to : ' | ||
| f'FLOPS specific assumption {baggage_per_pax}' | ||
| ) | ||
|
|
There was a problem hiding this comment.
Why was this removed? It seemed fine to me, it matches the FLOPS behavior.
Although I think the initial setting of baggage_per_pax=35 needs to be moved between lines 1041 and 1042 (between the two "if" statements) so that variable is sure to always have a value for when you set it later
I see this got moved to the preprocessor. See my comments there instead!
There was a problem hiding this comment.
In preprocessor, I added a line baggage_mass_per_pax = 35.0 which means that Aircraft.CrewPayload.BAGGAGE_MASS_PER_PASSENGER has a default value of 35 lbm. I think the logic is complete and is consistent with FLOPS now.
|
|
||
| if ( | ||
| Aircraft.HorizontalTail.TAPER_RATIO not in input_values | ||
| or input_values.get_val(Aircraft.HorizontalTail.TAPER_RATIO)[0] < 0.0 |
There was a problem hiding this comment.
Another place I don't think this is FLOPS behavior (this goes for all of the "< 0.0" checks in this section)
There was a problem hiding this comment.
If TRHT does not exist in FLOPS input, we will get a runtime error when someone runs fortran_to_aviary. Are you sure you want to change it to if input_values.get_val(Aircraft.HorizontalTail.TAPER_RATIO)[0] < 0.0?
| if ( | ||
| Aircraft.CrewPayload.BAGGAGE_MASS_PER_PASSENGER not in aviary_options | ||
| and Mission.Design.RANGE in aviary_options | ||
| or aviary_options.get_val(Mission.Design.RANGE, 'nmi') < 0.0 | ||
| ): | ||
| design_range = aviary_options.get_val(Mission.Design.RANGE, 'nmi') | ||
|
|
||
| if design_range <= 900.0: | ||
| baggage_mass_per_pax = 35.0 | ||
| elif design_range <= 2900.0: | ||
| baggage_mass_per_pax = 40.0 | ||
| else: | ||
| baggage_mass_per_pax = 44.0 | ||
| baggage_mass_per_pax = 35.0 | ||
| if Mission.Design.RANGE in aviary_options: | ||
| design_range = aviary_options.get_val(Mission.Design.RANGE, 'nmi') | ||
|
|
||
| if design_range <= 900.0: | ||
| baggage_mass_per_pax = 35.0 | ||
| elif design_range <= 2900.0: | ||
| baggage_mass_per_pax = 40.0 | ||
| else: | ||
| baggage_mass_per_pax = 44.0 | ||
|
|
||
| aviary_options.set_val( | ||
| Aircraft.CrewPayload.BAGGAGE_MASS_PER_PASSENGER, | ||
| val=baggage_mass_per_pax, | ||
| units='lbm', | ||
| ) |
There was a problem hiding this comment.
| if ( | |
| Aircraft.CrewPayload.BAGGAGE_MASS_PER_PASSENGER not in aviary_options | |
| and Mission.Design.RANGE in aviary_options | |
| or aviary_options.get_val(Mission.Design.RANGE, 'nmi') < 0.0 | |
| ): | |
| design_range = aviary_options.get_val(Mission.Design.RANGE, 'nmi') | |
| if design_range <= 900.0: | |
| baggage_mass_per_pax = 35.0 | |
| elif design_range <= 2900.0: | |
| baggage_mass_per_pax = 40.0 | |
| else: | |
| baggage_mass_per_pax = 44.0 | |
| baggage_mass_per_pax = 35.0 | |
| if Mission.Design.RANGE in aviary_options: | |
| design_range = aviary_options.get_val(Mission.Design.RANGE, 'nmi') | |
| if design_range <= 900.0: | |
| baggage_mass_per_pax = 35.0 | |
| elif design_range <= 2900.0: | |
| baggage_mass_per_pax = 40.0 | |
| else: | |
| baggage_mass_per_pax = 44.0 | |
| aviary_options.set_val( | |
| Aircraft.CrewPayload.BAGGAGE_MASS_PER_PASSENGER, | |
| val=baggage_mass_per_pax, | |
| units='lbm', | |
| ) | |
| if ( | |
| Aircraft.CrewPayload.BAGGAGE_MASS_PER_PASSENGER not in aviary_options | |
| ): | |
| if Mission.Design.RANGE in aviary_options: | |
| design_range = aviary_options.get_val(Mission.Design.RANGE, 'nmi') | |
| if design_range <= 900.0: | |
| baggage_mass_per_pax = 35.0 | |
| elif design_range <= 2900.0: | |
| baggage_mass_per_pax = 40.0 | |
| else: | |
| baggage_mass_per_pax = 44.0 | |
| else: | |
| baggage_mass_per_pax = 35.0 | |
| aviary_options.set_val( | |
| Aircraft.CrewPayload.BAGGAGE_MASS_PER_PASSENGER, | |
| val=baggage_mass_per_pax, | |
| units='lbm', | |
| ) |
I don't fully understand the proposed changes. Checking for design range < 0 doesn't change the logic branches at all, any value <= 900 will set the mass per pax to 35. I propose some code that cleans up the if statements and covers some edge cases the proposed code misses.
…into BWB_FLOPS_F2A
…orizontalTail.VERTICAL_TAIL_FRACTION) < 0.0'
Summary
This PR updates utility application
fortran_to_aviaryto include the features needed for FLOPS based BWB aircraft dataset.Related Issues
Backwards incompatibilities
None
New Dependencies
None