Skip to content

Commit

Permalink
Merge branch 'main' into I533-3d-model-units
Browse files Browse the repository at this point in the history
  • Loading branch information
jkirk5 authored Sep 16, 2024
2 parents 5d7c67b + 4b6a205 commit 8250ecf
Show file tree
Hide file tree
Showing 40 changed files with 419 additions and 656 deletions.
2 changes: 1 addition & 1 deletion aviary/docs/examples/OAS_subsystem.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.17"
"version": "3.10.13"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion aviary/docs/examples/more_advanced_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.18"
"version": "3.10.13"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion aviary/docs/examples/reserve_missions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.1.-1"
"version": "3.10.13"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion aviary/docs/examples/simple_mission_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.1.-1"
"version": "3.10.13"
}
},
"nbformat": 4,
Expand Down
12 changes: 6 additions & 6 deletions aviary/docs/getting_started/input_csv_phase_info.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
"from aviary.utils.process_input_decks import create_vehicle\n",
"from aviary.utils.aviary_values import AviaryValues\n",
"vehicle_deck = AviaryValues()\n",
"_ , initial_guesses = create_vehicle(vehicle_deck=vehicle_deck)\n",
"for key, val in initial_guesses.items():\n",
"_ , initialization_guesses = create_vehicle(vehicle_deck=vehicle_deck)\n",
"for key, val in initialization_guesses.items():\n",
" print(f\"{key}: {val}\")"
]
},
Expand All @@ -56,10 +56,10 @@
"metadata": {},
"source": [
"In the example vehicle input .csv files there is a section headed '# Initial Guesses' which contains the above list in the format: \"actual_takeoff_mass,0\"\n",
"The user can also specify these parameters with the prefix 'initial_guesses:'\n",
"e.g. 'initial_guesses:actual_takeoff_mass,150000' would set actual_takeoff_mass in the initial_guesses dictionary to 150000.\n",
"The user can also specify these parameters with the prefix 'initialization_guesses:'\n",
"e.g. 'initialization_guesses:actual_takeoff_mass,150000' would set actual_takeoff_mass in the initialization_guesses dictionary to 150000.\n",
"\n",
"If mission_method is TWO_DEGREES_OF_FREEDOM or mass_method is GASP then the initial_guessing() method is called and wherever the initial_guesses values are equal to 0, they are updated with calculated estimates based off the problem type (sizing, alternate, fallout) and mass, speed, range, thrust, and payload data specified in the vehicle input .csv file.\n",
"If mission_method is TWO_DEGREES_OF_FREEDOM or mass_method is GASP then the initialization_guessing() method is called and wherever the initialization_guesses values are equal to 0, they are updated with calculated estimates based off the problem type (sizing, alternate, fallout) and mass, speed, range, thrust, and payload data specified in the vehicle input .csv file.\n",
"\n",
"The initial guess of `reserves` is used to define the reserve fuel. Initially, its value can be anything larger than or equal to 0. There are two Aviary variables to control the reserve fuel in the model file (`.csv`):\n",
"- `Aircraft.Design.RESERVE_FUEL_ADDITIONAL`: the required fuel reserves: directly in lbm,\n",
Expand All @@ -83,7 +83,7 @@
"outputs": [],
"source": [
"# Testing Cell\n",
"from aviary.utils.process_input_decks import initial_guessing\n",
"from aviary.utils.process_input_decks import initialization_guessing\n",
"from aviary.api import Aircraft\n",
"Aircraft.Design.RESERVE_FUEL_ADDITIONAL;\n",
"Aircraft.Design.RESERVE_FUEL_FRACTION;"
Expand Down
2 changes: 1 addition & 1 deletion aviary/docs/getting_started/onboarding_level2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.0"
"version": "3.10.13"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.3"
"version": "3.10.13"
}
},
"nbformat": 4,
Expand Down
6 changes: 3 additions & 3 deletions aviary/docs/user_guide/SGM_capabilities.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@
"from aviary.utils.process_input_decks import create_vehicle, update_GASP_options\n",
"from aviary.interface.download_models import get_model\n",
"\n",
"aviary_inputs, initial_guesses = create_vehicle(get_model('aircraft_for_bench_GwGm.csv'))\n",
"aviary_inputs, initialization_guesses = create_vehicle(get_model('aircraft_for_bench_GwGm.csv'))\n",
"aviary_inputs = update_GASP_options(aviary_inputs)\n",
"aviary_inputs.set_val(Mission.Summary.CRUISE_MASS_FINAL,\n",
" val=initial_guesses['cruise_mass_final'], units='lbm')\n",
" val=initialization_guesses['cruise_mass_final'], units='lbm')\n",
"aviary_inputs.set_val(Mission.Summary.GROSS_MASS,\n",
" val=initial_guesses['actual_takeoff_mass'], units='lbm')\n",
" val=initialization_guesses['actual_takeoff_mass'], units='lbm')\n",
"aviary_inputs.set_val(Aircraft.Engine.NUM_ENGINES, val=[1], units='unitless')\n",
"default_mission_subsystems = [\n",
" CoreAerodynamicsBuilder('core_aerodynamics', code_origin=LegacyCode.GASP),\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.3"
"version": "3.10.13"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion aviary/docs/user_guide/subsystems.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.1.-1"
"version": "3.10.13"
}
},
"nbformat": 4,
Expand Down
20 changes: 10 additions & 10 deletions aviary/interface/methods_for_level2.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
from aviary.mission.gasp_based.polynomial_fit import PolynomialFit
from aviary.subsystems.premission import CorePreMission
from aviary.utils.functions import create_opts2vals, add_opts2vals, promote_aircraft_and_mission_vars, wrapped_convert_units
from aviary.utils.process_input_decks import create_vehicle, update_GASP_options, initial_guessing
from aviary.utils.process_input_decks import create_vehicle, update_GASP_options, initialization_guessing
from aviary.utils.preprocessors import preprocess_crewpayload
from aviary.interface.utils.check_phase_info import check_phase_info
from aviary.utils.aviary_values import AviaryValues
Expand Down Expand Up @@ -261,7 +261,7 @@ def load_inputs(self, aviary_inputs, phase_info=None, engine_builders=None, meta
## LOAD INPUT FILE ###
# Create AviaryValues object from file (or process existing AviaryValues object
# with default values from metadata) and generate initial guesses
aviary_inputs, initial_guesses = create_vehicle(
aviary_inputs, initialization_guesses = create_vehicle(
aviary_inputs, meta_data=meta_data, verbosity=verbosity)

# pull which methods will be used for subsystems and mission
Expand All @@ -271,10 +271,10 @@ def load_inputs(self, aviary_inputs, phase_info=None, engine_builders=None, meta

if mission_method is TWO_DEGREES_OF_FREEDOM or mass_method is GASP:
aviary_inputs = update_GASP_options(aviary_inputs)
initial_guesses = initial_guessing(aviary_inputs, initial_guesses,
engine_builders)
initialization_guesses = initialization_guessing(aviary_inputs, initialization_guesses,
engine_builders)
self.aviary_inputs = aviary_inputs
self.initial_guesses = initial_guesses
self.initialization_guesses = initialization_guesses

## LOAD PHASE_INFO ###
if phase_info is None:
Expand Down Expand Up @@ -344,9 +344,9 @@ def load_inputs(self, aviary_inputs, phase_info=None, engine_builders=None, meta

if mission_method is TWO_DEGREES_OF_FREEDOM:
aviary_inputs.set_val(Mission.Summary.CRUISE_MASS_FINAL,
val=self.initial_guesses['cruise_mass_final'], units='lbm')
val=self.initialization_guesses['cruise_mass_final'], units='lbm')
aviary_inputs.set_val(Mission.Summary.GROSS_MASS,
val=self.initial_guesses['actual_takeoff_mass'], units='lbm')
val=self.initialization_guesses['actual_takeoff_mass'], units='lbm')

# Commonly referenced values
self.cruise_alt = aviary_inputs.get_val(
Expand All @@ -364,7 +364,7 @@ def load_inputs(self, aviary_inputs, phase_info=None, engine_builders=None, meta
elif mission_method is HEIGHT_ENERGY:
self.problem_type = aviary_inputs.get_val(Settings.PROBLEM_TYPE)
aviary_inputs.set_val(Mission.Summary.GROSS_MASS,
val=self.initial_guesses['actual_takeoff_mass'], units='lbm')
val=self.initialization_guesses['actual_takeoff_mass'], units='lbm')
if 'target_range' in self.post_mission_info:
aviary_inputs.set_val(Mission.Design.RANGE, wrapped_convert_units(
phase_info['post_mission']['target_range'], 'NM'), units='NM')
Expand Down Expand Up @@ -2137,8 +2137,8 @@ def _add_guesses(self, phase_name, phase, guesses):

# If using the GASP model, set initial guesses for the rotation mass and flight duration
if self.mission_method is TWO_DEGREES_OF_FREEDOM:
rotation_mass = self.initial_guesses['rotation_mass']
flight_duration = self.initial_guesses['flight_duration']
rotation_mass = self.initialization_guesses['rotation_mass']
flight_duration = self.initialization_guesses['flight_duration']

if self.mission_method in (HEIGHT_ENERGY, SOLVED_2DOF):
control_keys = ["mach", "altitude"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
@unittest.skipUnless(importlib.util.find_spec("pyoptsparse") is not None, "pyoptsparse is not installed")
class HE_SGMDescentTestCase(unittest.TestCase):
def setUp(self):
aviary_inputs, initial_guesses = create_vehicle(
aviary_inputs, initialization_guesses = create_vehicle(
'models/test_aircraft/aircraft_for_bench_FwFm.csv')
aviary_inputs.set_val(Aircraft.Engine.SCALED_SLS_THRUST, val=28690, units="lbf")
aviary_inputs.set_val(Dynamic.Mission.THROTTLE, val=0, units="unitless")
Expand Down
13 changes: 5 additions & 8 deletions aviary/models/N3CC/N3CC_generic_low_speed_polars_FLOPSinp.csv
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ aircraft:fuselage:max_width,12.3,ft
aircraft:fuselage:military_cargo_floor,False,unitless
aircraft:fuselage:num_fuselages,1,unitless
aircraft:fuselage:passenger_compartment_length,97.5,ft
aircraft:fuselage:wetted_area,4235.082096,lbm
aircraft:fuselage:wetted_area_scaler,1.0,unitless
aircraft:fuselage:wetted_area,4235.082096,ft**2
aircraft:horizontal_tail:area,349.522730527158,ft**2
aircraft:horizontal_tail:aspect_ratio,5.22699386503068,unitless
aircraft:horizontal_tail:laminar_flow_lower,0,unitless
Expand All @@ -80,8 +79,7 @@ aircraft:horizontal_tail:sweep,30.5853213018973,deg
aircraft:horizontal_tail:taper_ratio,0.2734375,unitless
aircraft:horizontal_tail:thickness_to_chord,0.115,unitless
aircraft:horizontal_tail:vertical_tail_fraction,0,unitless
aircraft:horizontal_tail:wetted_area,576.571192,lbm
aircraft:horizontal_tail:wetted_area_scaler,1.0,unitless
aircraft:horizontal_tail:wetted_area,576.571192,ft**2
aircraft:hydraulics:mass_scaler,0.95543,unitless
aircraft:hydraulics:system_pressure,5000,psi
aircraft:instruments:mass_scaler,1.66955,unitless
Expand All @@ -95,7 +93,7 @@ aircraft:nacelle:avg_diameter,7.2,ft
aircraft:nacelle:avg_length,35,ft
aircraft:nacelle:laminar_flow_lower,0,unitless
aircraft:nacelle:laminar_flow_upper,0,unitless
aircraft:nacelle:wetted_area_scaler,244.468282,unitless
aircraft:nacelle:wetted_area,244.468282,ft**2
aircraft:paint:mass_per_unit_area,0,lbm/ft**2
aircraft:propulsion:engine_oil_mass_scaler,1,unitless
aircraft:propulsion:misc_mass_scaler,0,unitless
Expand All @@ -108,7 +106,7 @@ aircraft:vertical_tail:num_tails,1,unitless
aircraft:vertical_tail:sweep,39.735053245438,deg
aircraft:vertical_tail:taper_ratio,0.25,unitless
aircraft:vertical_tail:thickness_to_chord,0.1,unitless
aircraft:vertical_tail:wetted_area_scaler,445.645658,unitless
aircraft:vertical_tail:wetted_area,445.645658,ft**2
aircraft:wing:aeroelastic_tailoring_factor,0.33333,unitless
aircraft:wing:airfoil_technology,1.6,unitless
aircraft:wing:area,1220,1,0,0,0,0,ft**2
Expand Down Expand Up @@ -144,8 +142,7 @@ aircraft:wing:thickness_to_chord_dist,0.14233,0.12233,0.1108,0.1058,unitless
aircraft:wing:thickness_to_chord_reference,0.116565,unitless
aircraft:wing:ultimate_load_factor,3.75,unitless
aircraft:wing:var_sweep_mass_penalty,0,unitless
aircraft:wing:wetted_area,2210.280228,lbm
aircraft:wing:wetted_area_scaler,1.0,unitless
aircraft:wing:wetted_area,2210.280228,ft**2
mission:constraints:max_mach,0.785,unitless
mission:design:gross_mass,1,lbm
mission:design:lift_coefficient,-1,unitless
Expand Down
2 changes: 1 addition & 1 deletion aviary/models/large_single_aisle_1/V3_bug_fixed_IO.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
Aircraft.Fuselage.TAIL_FINENESS, 3, units="unitless"
)
V3_bug_fixed_options.set_val(
Aircraft.Fuselage.WETTED_AREA_FACTOR, 4000, units="unitless"
Aircraft.Fuselage.WETTED_AREA, 4000, units="ft**2"
)
V3_bug_fixed_options.set_val(
Aircraft.VerticalTail.MOMENT_RATIO, 2.362, units="unitless"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ aircraft:fuselage:pressure_differential,7.5,psi
aircraft:fuselage:seat_pitch,29,inch
aircraft:fuselage:seat_width,20.2,inch
aircraft:fuselage:tail_fineness,3,unitless
aircraft:fuselage:wetted_area_factor,4000,unitless
aircraft:fuselage:wetted_area,4000,ft**2
aircraft:horizontal_tail:area,0,ft**2
aircraft:horizontal_tail:aspect_ratio,4.75,unitless
aircraft:horizontal_tail:form_factor,1.25,unitless
Expand Down Expand Up @@ -156,14 +156,14 @@ mission:taxi:duration,0.1677,h
settings:equations_of_motion,2DOF
settings:mass_method,GASP

# Initial Guesses
# Initialization Guesses
actual_takeoff_mass,0
climb_range,0
cruise_mass_final,0
flight_duration,0
fuel_burn_per_passenger_mile,0.1
fuel_burn_per_passenger_mile,0
reserves,0
rotation_mass,0.99
rotation_mass,0
time_to_climb,0

# Unconverted Values
Expand Down
8 changes: 4 additions & 4 deletions aviary/models/small_single_aisle/small_single_aisle_GwGm.csv
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ aircraft:fuselage:pressure_differential,7.5,psi
aircraft:fuselage:seat_pitch,31,inch
aircraft:fuselage:seat_width,24,inch
aircraft:fuselage:tail_fineness,3.368,unitless
aircraft:fuselage:wetted_area_factor,1,unitless
aircraft:fuselage:wetted_area_scaler,1,unitless
aircraft:horizontal_tail:area,0,ft**2
aircraft:horizontal_tail:aspect_ratio,4.26,unitless
aircraft:horizontal_tail:form_factor,1.55,unitless
Expand Down Expand Up @@ -156,14 +156,14 @@ mission:taxi:duration,0.3333,h
settings:equations_of_motion,2DOF
settings:mass_method,GASP

# Initial Guesses
# Initialization Guesses
actual_takeoff_mass,0
climb_range,0
cruise_mass_final,0
flight_duration,0
fuel_burn_per_passenger_mile,0.1
fuel_burn_per_passenger_mile,0
reserves,0
rotation_mass,0.99
rotation_mass,0
time_to_climb,0

# Unconverted Values
Expand Down
8 changes: 4 additions & 4 deletions aviary/models/test_aircraft/aircraft_for_bench_FwGm.csv
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ aircraft:fuselage:pressure_differential,7.5,psi
aircraft:fuselage:seat_pitch,29,inch
aircraft:fuselage:seat_width,20.2,inch
aircraft:fuselage:tail_fineness,3,unitless
aircraft:fuselage:wetted_area_factor,4000,unitless
aircraft:fuselage:wetted_area,4000,ft**2
aircraft:horizontal_tail:area,355.0,ft**2
aircraft:horizontal_tail:aspect_ratio,6.0,unitless
aircraft:horizontal_tail:form_factor,1.25,unitless
Expand Down Expand Up @@ -254,14 +254,14 @@ aircraft:fuel:burn_per_passenger_mile,0.1
settings:equations_of_motion,2DOF
settings:mass_method,FLOPS

# Initial Guesses
# Initialization Guesses
actual_takeoff_mass,0
climb_range,0
cruise_mass_final,0
flight_duration,0
fuel_burn_per_passenger_mile,0.1
fuel_burn_per_passenger_mile,0
reserves,0
rotation_mass,0.99
rotation_mass,0
time_to_climb,0

INGASP.ALR,1.11
Expand Down
3 changes: 0 additions & 3 deletions aviary/models/test_aircraft/aircraft_for_bench_GwFm.csv
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,9 @@ aircraft:fuselage:passenger_compartment_length,85.5,ft
aircraft:fuselage:pilot_compartment_length,9.5,ft
aircraft:fuselage:planform_area,1578.24,ft**2
aircraft:fuselage:pressure_differential,7.5,psi
aircraft:fuselage:provide_surface_area,True,unitless
aircraft:fuselage:seat_pitch,29,inch
aircraft:fuselage:seat_width,20.2,inch
aircraft:fuselage:tail_fineness,3,unitless
aircraft:fuselage:wetted_area_factor,4000,unitless
aircraft:fuselage:wetted_area_scaler,1.0,unitless
aircraft:fuselage:wetted_area,4158.62,ft**2
aircraft:horizontal_tail:area,355.0,ft**2
aircraft:horizontal_tail:aspect_ratio,4.75,unitless
Expand Down
8 changes: 4 additions & 4 deletions aviary/models/test_aircraft/aircraft_for_bench_GwGm.csv
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ aircraft:fuselage:pressure_differential,7.5,psi
aircraft:fuselage:seat_pitch,29,inch
aircraft:fuselage:seat_width,20.2,inch
aircraft:fuselage:tail_fineness,3,unitless
aircraft:fuselage:wetted_area_factor,4000,unitless
aircraft:fuselage:wetted_area,4000,ft**2
aircraft:horizontal_tail:area,0,ft**2
aircraft:horizontal_tail:aspect_ratio,4.75,unitless
aircraft:horizontal_tail:form_factor,1.25,unitless
Expand Down Expand Up @@ -154,14 +154,14 @@ mission:taxi:duration,0.1677,h
settings:equations_of_motion,2DOF
settings:mass_method,GASP

# Initial Guesses
# Initialization Guesses
actual_takeoff_mass,0
climb_range,0
cruise_mass_final,0
flight_duration,0
fuel_burn_per_passenger_mile,0.1
fuel_burn_per_passenger_mile,0
reserves,0
rotation_mass,0.99
rotation_mass,0
time_to_climb,0

INGASP.ALR,1.11
Expand Down
8 changes: 4 additions & 4 deletions aviary/models/test_aircraft/aircraft_for_bench_GwGm_lbm_s.csv
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ aircraft:fuselage:pressure_differential,7.5,psi
aircraft:fuselage:seat_pitch,29,inch
aircraft:fuselage:seat_width,20.2,inch
aircraft:fuselage:tail_fineness,3,unitless
aircraft:fuselage:wetted_area_factor,4000,unitless
aircraft:fuselage:wetted_area,4000,ft**2
aircraft:horizontal_tail:area,0,ft**2
aircraft:horizontal_tail:aspect_ratio,4.75,unitless
aircraft:horizontal_tail:form_factor,1.25,unitless
Expand Down Expand Up @@ -155,14 +155,14 @@ mission:taxi:duration,0.1677,h
settings:equations_of_motion,2DOF
settings:mass_method,GASP

# Initial Guesses
# Initialization Guesses
actual_takeoff_mass,0
climb_range,0
cruise_mass_final,0
flight_duration,0
fuel_burn_per_passenger_mile,0.1
fuel_burn_per_passenger_mile,0
reserves,0
rotation_mass,0.99
rotation_mass,0
time_to_climb,0

INGASP.ALR,1.11
Expand Down
Loading

0 comments on commit 8250ecf

Please sign in to comment.