Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
35c7ef3
work in progress
xjjiang Sep 23, 2025
860fe7e
rename aircraft:wing:chord_per_semispan to aircraft:wing:chord_per_se…
xjjiang Sep 26, 2025
ad476b5
stecify design_type in if-else blocks
xjjiang Sep 26, 2025
f7cf14e
work in progress: BWB FLOPS based mass and detailed wing work
xjjiang Sep 27, 2025
20fe46c
Merge branch 'main' into BWB_FLOPS_mass
xjjiang Sep 27, 2025
de7602f
Merge branch 'OpenMDAO:main' into BWB_FLOPS_mass
xjjiang Sep 29, 2025
5162ab0
worked on BWB detailed wing unit tests
xjjiang Sep 29, 2025
18ef9e4
Merge branch 'BWB_FLOPS_mass' of github.com:xjjiang/om-Aviary into BW…
xjjiang Sep 29, 2025
0f0bb3a
fix a small typo
xjjiang Sep 29, 2025
4468168
add Aircraft.Wing.BWB_AFTBODY_MASS to BWBAftBodyMass
xjjiang Oct 4, 2025
fc49809
add BWBWingMiscMass class and exclude BWB case in WingMiscMass class
xjjiang Oct 4, 2025
f5e104a
update BWBDetailedWingBendingFact class with a new output variable 'c…
xjjiang Oct 4, 2025
d689c60
add BWBWingMiscMass class and exclude BWB case in WingMiscMass class
xjjiang Oct 4, 2025
b370154
add a note that WEC in FLOPS in not exactly the same as total_control…
xjjiang Oct 4, 2025
716954a
add BWBTransportAvionicsMassTest
xjjiang Oct 4, 2025
1da61be
add BWBCargoMassTest
xjjiang Oct 4, 2025
4ba89a9
minor update
xjjiang Oct 4, 2025
9225759
add BWBWingMiscMassTest, BWBShearControlMassTest, and BWBShearControl…
xjjiang Oct 4, 2025
35b001c
minor update
xjjiang Oct 4, 2025
57c0f91
add BWBSurfaceCtrlMassTest
xjjiang Oct 4, 2025
464f15a
add Aircraft.Wing.BWB_AFTBODY_MASS to BWBAftBodyMass
xjjiang Oct 4, 2025
f0a7804
add BWBTransportEngineCtrlsTest
xjjiang Oct 4, 2025
d24be85
add BWBCargoContainersMassTest
xjjiang Oct 4, 2025
4a80991
remove BWBFuelCapacityGroupTest
xjjiang Oct 5, 2025
f0640a8
Merge branch 'OpenMDAO:main' into BWB_FLOPS_mass
xjjiang Oct 6, 2025
97d2270
set 'WTIN.NPF' for FLOPS for Aircraft.CrewPayload.Design.NUM_FIRST_CL…
xjjiang Oct 7, 2025
b6720f0
add BWB1aFLOPS to FLOPS_Test_Data.py
xjjiang Oct 7, 2025
4bbdd0f
work in progress: adding BWBPropulsionPreMissionTest
xjjiang Oct 7, 2025
a59c7c6
add use_tempdirs
xjjiang Oct 7, 2025
f2daa12
add BWBTransportAirCondMassTest
xjjiang Oct 7, 2025
2874474
don't run BWB test yet.
xjjiang Oct 7, 2025
ca3bf5b
Merge branch 'OpenMDAO:main' into BWB_FLOPS_mass
xjjiang Oct 7, 2025
32ccf61
Merge branch 'OpenMDAO:main' into BWB_FLOPS_mass
xjjiang Oct 7, 2025
f94cad1
adding bwb_1a_FLOPS_data.py
xjjiang Oct 8, 2025
06af0a2
add BWBTransportAirCondMassTest
xjjiang Oct 8, 2025
bbdfd1a
minor update
xjjiang Oct 8, 2025
47f2904
copy Ken's fix
xjjiang Oct 8, 2025
492ebcd
update engine file
xjjiang Oct 8, 2025
beba8b6
work in progress
xjjiang Oct 9, 2025
ba87052
minor update
xjjiang Oct 9, 2025
5f2d80a
add BWBEngineMassTest
xjjiang Oct 9, 2025
ce89c17
add new test: test_wing_group.py
xjjiang Oct 9, 2025
e091bba
add engine file for FLOPS based BWB
xjjiang Oct 9, 2025
b644ebe
minor update to bwb_1a_FLOPS_data.py
xjjiang Oct 9, 2025
98efcaf
omit 'BWB1aFLOPS'
xjjiang Oct 9, 2025
395a319
work in progress on engine_pod
xjjiang Oct 9, 2025
8a42160
omit BWB1aFLOPS in unit tests
xjjiang Oct 9, 2025
5bf6216
minor update
xjjiang Oct 9, 2025
da4f63d
minor update
xjjiang Oct 9, 2025
170e79d
BWBTransportFuelSystemTest is not ready yet
xjjiang Oct 9, 2025
28201c8
Merge branch 'main' into BWB_FLOPS_mass
xjjiang Nov 3, 2025
02957e4
Merge branch 'OpenMDAO:main' into BWB_FLOPS_mass
xjjiang Nov 4, 2025
495a314
Update bwb_1a_FLOPS_data.py
xjjiang Nov 5, 2025
1ba33b3
Add Engine scaled thrust to anti-icing test
xjjiang Nov 5, 2025
78610fd
add a note
xjjiang Nov 5, 2025
4057fcc
remove aircraft:engine:starter_mass
xjjiang Nov 13, 2025
2858f10
remove aircraft:engine:starter_mass
xjjiang Nov 13, 2025
4164ed4
enable value checking for BWB since we have BWB data now.
xjjiang Nov 13, 2025
602ab4b
update FLOPS based BWB data.
xjjiang Nov 13, 2025
a907880
update wing area for BWB to match with FLOPS run
xjjiang Nov 13, 2025
28d2085
update start mass by adding scale avg_diam by thrust ratio
xjjiang Nov 13, 2025
a9d8cc4
deal with the case that vertical tail area is zero
xjjiang Nov 13, 2025
8d6531d
add/update FLOPS based mass unit tests for BWB.
xjjiang Nov 13, 2025
adfc649
update FLOPS based mass TotalSummationTest
xjjiang Nov 13, 2025
2ff6007
update bwb_1a_FLOPS_data.py
xjjiang Nov 13, 2025
6f908f6
add unit tests for detailed layout and detailed wing data set of BWB.
xjjiang Nov 18, 2025
303cbdd
add unit tests for detailed layout and detailed wing data set of BWB.
xjjiang Nov 18, 2025
c64ae19
rename bwb_1a_FLOPS_data.py bwb_simple_FLOPS_data.py
xjjiang Nov 18, 2025
8681b8b
remove LANDG.THROF because it does not exist.
xjjiang Nov 18, 2025
e0684f0
add BWB detailed layout and detailed wing data set for unit testing
xjjiang Nov 18, 2025
61a9de3
add BWBdetailedFLOPS to FLOPS_Test_Data
xjjiang Nov 18, 2025
b30be93
add BWB test case
xjjiang Nov 18, 2025
c4c1c2b
remove an unnecessary input
xjjiang Nov 18, 2025
ff9f071
minor update
xjjiang Nov 18, 2025
35e5dd0
remove unimported variables
xjjiang Nov 18, 2025
84ab7ce
renamed a couple of test classes
xjjiang Nov 18, 2025
5b5d708
minor updates
xjjiang Nov 18, 2025
7656a87
add use_tempdirs wherever needed
xjjiang Nov 18, 2025
c954476
minor updates
xjjiang Nov 18, 2025
75ec810
minor updates
xjjiang Nov 18, 2025
71f9933
minor updates
xjjiang Nov 18, 2025
f58c80d
add unit test in test_propulsion_premission.py
xjjiang Nov 19, 2025
44262b5
update TOTAL_SCALED_SLS_THRUST in BWBPropulsionPreMissionTest
xjjiang Nov 19, 2025
01f99c0
update validataion data
xjjiang Nov 19, 2025
a36c485
update wing aspect ratio to 7.557 from 3.4488821
xjjiang Nov 19, 2025
b0ff436
add Aircraft.Wing.NUM_INPUT_STATION_DIST
xjjiang Nov 20, 2025
b54affa
convert NETAW to Aircraft.Wing.NUM_INTEGRATION_STATIONS. Not needed i…
xjjiang Nov 20, 2025
9064f56
minor update
xjjiang Nov 20, 2025
9556f27
set Aircraft.Engine.NUM_ENGINES to np.array([3]) instead of 3
xjjiang Nov 21, 2025
8f6baad
remove newly added variable Aircraft.Wing.NUM_INPUT_STATION_DIST. Als…
xjjiang Nov 21, 2025
7a1ef2f
one more file to update
xjjiang Nov 21, 2025
4f52781
Merge branch 'main' into BWB_FLOPS_mass
jkirk5 Nov 24, 2025
076ce3e
Update aviary/models/engines/PAX300_baseline_ENGDEK.csv
jkirk5 Nov 24, 2025
eca234b
Merge branch 'OpenMDAO:main' into BWB_FLOPS_mass
xjjiang Dec 2, 2025
f2ad32e
change print to raise
xjjiang Dec 8, 2025
b02a058
rename bwb_wing_detailed.py to wing_detailed_bwb.py
xjjiang Dec 8, 2025
3b51e01
rename CargoMass to PayloadGroup
xjjiang Dec 8, 2025
f33d337
change print to raise
xjjiang Dec 8, 2025
6da8939
Merge branch 'main' into BWB_FLOPS_mass
xjjiang Dec 8, 2025
06a63f7
change CargoMassTest to PayloadGroupTest
xjjiang Dec 8, 2025
7eba110
rename some variables
xjjiang Dec 8, 2025
cb925d1
update test_cargo
xjjiang Dec 8, 2025
eb8a01b
minor modification of docstring
xjjiang Dec 9, 2025
1f0a5c6
removed temp comments
xjjiang Dec 9, 2025
cc06326
For horizontal tail, vertical tail and canard, rewrite characteristic…
xjjiang Dec 9, 2025
435b717
roll back my work on characteristic lengths of horizontal tail, verti…
xjjiang Dec 10, 2025
1cee3cb
Merge branch 'OpenMDAO:main' into BWB_FLOPS_mass
xjjiang Dec 16, 2025
21e93a8
Take Aircraft.Engine.SCALE_FACTOR as input.
xjjiang Dec 16, 2025
f6a5f36
Merge branch 'OpenMDAO:main' into BWB_FLOPS_mass
xjjiang Dec 17, 2025
04be791
minor update to data files
xjjiang Dec 17, 2025
b165099
Merge branch 'BWB_FLOPS_mass' of github.com:xjjiang/om-Aviary into BW…
xjjiang Dec 17, 2025
1731995
Merge branch 'OpenMDAO:main' into BWB_FLOPS_mass
xjjiang Dec 19, 2025
0655b2e
Merge branch 'OpenMDAO:main' into BWB_FLOPS_mass
xjjiang Dec 22, 2025
3a2c82e
Merge branch 'main' into BWB_FLOPS_mass
xjjiang Dec 22, 2025
082c951
Merge branch 'OpenMDAO:main' into BWB_FLOPS_mass
xjjiang Dec 23, 2025
4382492
remove unused inputs from EquipMassPartialSum of GASP based mass subs…
xjjiang Dec 23, 2025
1352c30
Merge branch 'OpenMDAO:main' into BWB_FLOPS_mass
xjjiang Dec 23, 2025
3e2b809
remove unused variables
xjjiang Dec 23, 2025
5d8708c
:Merge branch 'BWB_FLOPS_mass' of github.com:xjjiang/om-Aviary into B…
xjjiang Dec 23, 2025
e5b19d3
roll back my new docstring
xjjiang Dec 24, 2025
152584b
Merge branch 'main' into BWB_FLOPS_mass
xjjiang Dec 31, 2025
bcdab37
changes based on suggestions from Jason
xjjiang Dec 31, 2025
d01a255
minor update
xjjiang Dec 31, 2025
68f56f5
minor updates based on Jason's comments
xjjiang Jan 5, 2026
6d953d7
Merge branch 'OpenMDAO:main' into BWB_FLOPS_mass
xjjiang Jan 8, 2026
2b82396
Merge branch 'OpenMDAO:main' into BWB_FLOPS_mass
xjjiang Jan 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion aviary/docs/examples/modified_aircraft.csv
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ aircraft:wing:airfoil_technology,1.92669766647637,unitless
aircraft:wing:area,1370.0,ft**2
aircraft:wing:aspect_ratio,11.02091,unitless
aircraft:wing:bending_material_mass_scaler,1.0,unitless
aircraft:wing:chord_per_semispan,0.31,0.23,0.084,unitless
aircraft:wing:chord_per_semispan_dist,0.31,0.23,0.084,unitless
aircraft:wing:composite_fraction,0.2,unitless
aircraft:wing:control_surface_area,137,ft**2
aircraft:wing:control_surface_area_ratio,0.1,unitless
Expand Down
2 changes: 1 addition & 1 deletion aviary/interface/test/sizing_results_for_test.json
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@
"<class 'float'>"
],
[
"aircraft:wing:chord_per_semispan",
"aircraft:wing:chord_per_semispan_dist",
[
0.31,
0.23,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ aircraft:wing:aspect_ratio,11.5587605382765,unitless
aircraft:wing:aspect_ratio_reference,11.5587605382765,unitless
aircraft:wing:bending_material_mass_scaler,1,unitless
aircraft:wing:bwb_aft_body_mass_scaler,1,unitless
aircraft:wing:chord_per_semispan,0.273522534166506,0.204274849507037,0.0888152947868224,0.0725353313595661,unitless
aircraft:wing:chord_per_semispan_dist,0.273522534166506,0.204274849507037,0.0888152947868224,0.0725353313595661,unitless
aircraft:wing:composite_fraction,0.33333,unitless
aircraft:wing:control_surface_area_ratio,0.333,unitless
aircraft:wing:dihedral,6,deg
Expand Down
434 changes: 434 additions & 0 deletions aviary/models/aircraft/blended_wing_body/bwb_detailed_FLOPS_data.py

Large diffs are not rendered by default.

379 changes: 379 additions & 0 deletions aviary/models/aircraft/blended_wing_body/bwb_simple_FLOPS_data.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ aircraft:wing:airfoil_technology,1.92669766647637,unitless
aircraft:wing:area,1370.0,ft**2
aircraft:wing:aspect_ratio,11.22091,unitless
aircraft:wing:bending_material_mass_scaler,1.0,unitless
aircraft:wing:chord_per_semispan,0.31,0.23,0.084,unitless
aircraft:wing:chord_per_semispan_dist,0.31,0.23,0.084,unitless
aircraft:wing:composite_fraction,0.2,unitless
aircraft:wing:control_surface_area,137,ft**2
aircraft:wing:control_surface_area_ratio,0.1,unitless
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ aircraft:wing:airfoil_technology,1.92669766647637,unitless
aircraft:wing:area,1370.0,ft**2
aircraft:wing:aspect_ratio,11.22091,unitless
aircraft:wing:bending_material_mass_scaler,1.0,unitless
aircraft:wing:chord_per_semispan,0.31,0.23,0.084,unitless
aircraft:wing:chord_per_semispan_dist,0.31,0.23,0.084,unitless
aircraft:wing:composite_fraction,0.2,unitless
aircraft:wing:control_surface_area,137,ft**2
aircraft:wing:control_surface_area_ratio,0.1,unitless
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ aircraft:vertical_tail:num_tails,1,unitless
aircraft:wing:aeroelastic_tailoring_factor,0.0,unitless
aircraft:wing:airfoil_technology,1.92669766647637,unitless
aircraft:wing:bending_material_mass_scaler,1.0,unitless
aircraft:wing:chord_per_semispan,0.31,0.23,0.084,unitless
aircraft:wing:chord_per_semispan_dist,0.31,0.23,0.084,unitless
aircraft:wing:composite_fraction,0.2,unitless
aircraft:wing:control_surface_area,137,ft**2
aircraft:wing:control_surface_area_ratio,0.1,unitless
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ aircraft:wing:airfoil_technology,1.92669766647637,unitless
aircraft:wing:area,1370.0,ft**2
aircraft:wing:aspect_ratio,11.22091,unitless
aircraft:wing:bending_material_mass_scaler,1.0,unitless
aircraft:wing:chord_per_semispan,0.31,0.23,0.084,unitless
aircraft:wing:chord_per_semispan_dist,0.31,0.23,0.084,unitless
aircraft:wing:composite_fraction,0.2,unitless
aircraft:wing:control_surface_area,137,ft**2
aircraft:wing:control_surface_area_ratio,0.1,unitless
Expand Down
654 changes: 654 additions & 0 deletions aviary/models/engines/PAX300_baseline_ENGDEK.csv

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ aircraft:wing:airfoil_technology,1.01,unitless #check
aircraft:wing:area,1480,ft**2
aircraft:wing:aspect_ratio_reference,0.01,unitless #check
aircraft:wing:bending_material_mass_scaler,1.01,unitless #check
aircraft:wing:chord_per_semispan,0.13,0.115,0.06,unitless
aircraft:wing:chord_per_semispan_dist,0.13,0.115,0.06,unitless
aircraft:wing:composite_fraction,0.01,unitless #check
aircraft:wing:dihedral,-1.0,deg
aircraft:wing:control_surface_area_ratio,0.2234,unitless
Expand Down
10 changes: 5 additions & 5 deletions aviary/subsystems/aerodynamics/gasp_based/gaspaero.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ def compute(self, inputs, outputs):
ufac = (1 + lift_ratio) ** 2 / (
sigstr * (lift_ratio / bbar) ** 2 + 2 * sigma * lift_ratio / bbar + 1
)
else:
elif design_type is AircraftTypes.BLENDED_WING_BODY:
# Modify for tailless "BWB"
if bbar < 0.01 * wingspan:
bbar = 1.0
Expand Down Expand Up @@ -2480,7 +2480,7 @@ def setup(self):
),
promotes=['*'],
)
else:
elif design_type is AircraftTypes.TRANSPORT:
self.add_subsystem(
'aero_setup',
AeroSetup(
Expand All @@ -2503,7 +2503,7 @@ def setup(self):
BWBLiftCoeffClean(output_alpha=self.options['output_alpha'], num_nodes=nn),
promotes=['*'],
)
else:
elif design_type is AircraftTypes.TRANSPORT:
self.add_subsystem(
'lift_coef',
LiftCoeffClean(output_alpha=self.options['output_alpha'], num_nodes=nn),
Expand Down Expand Up @@ -2559,7 +2559,7 @@ def setup(self):
),
promotes=['*'],
)
else:
elif design_type is AircraftTypes.TRANSPORT:
self.add_subsystem(
'aero_setup',
AeroSetup(
Expand Down Expand Up @@ -2626,7 +2626,7 @@ def setup(self):
promotes_inputs=['*'],
promotes_outputs=['*'],
)
else:
elif design_type is AircraftTypes.TRANSPORT:
self.add_subsystem(
'lift_coef',
LiftCoeff(num_nodes=nn),
Expand Down
91 changes: 38 additions & 53 deletions aviary/subsystems/geometry/flops_based/fuselage.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ class FuselagePrelim(om.ExplicitComponent):
Aircraft.Fuselage.PLANFORM_AREA = length * max_width.
"""

def initialize(self):
add_aviary_option(self, Settings.VERBOSITY)

def setup(self):
add_aviary_input(self, Aircraft.Fuselage.LENGTH, units='ft')
add_aviary_input(self, Aircraft.Fuselage.MAX_HEIGHT, units='ft')
Expand All @@ -39,16 +36,16 @@ def setup_partials(self):
)

def compute(self, inputs, outputs):
verbosity = self.options[Settings.VERBOSITY]
max_height = inputs[Aircraft.Fuselage.MAX_HEIGHT]
max_width = inputs[Aircraft.Fuselage.MAX_WIDTH]
length = inputs[Aircraft.Fuselage.LENGTH]
if length <= 0.0:
if verbosity > Verbosity.BRIEF:
print('Aircraft.Fuselage.LENGTH must be positive.')
raise ValueError(
f'Aircraft.Fuselage.LENGTH must be positive, however {length} is provided.'
)

avg_diameter = 0.5 * (max_height + max_width)
outputs[Aircraft.Fuselage.REF_DIAMETER] = avg_diameter
ref_diameter = 0.5 * (max_height + max_width)
outputs[Aircraft.Fuselage.REF_DIAMETER] = ref_diameter

outputs[Aircraft.Fuselage.PLANFORM_AREA] = length * max_width

Expand All @@ -64,9 +61,6 @@ def compute_partials(self, inputs, partials, discrete_inputs=None):
class BWBFuselagePrelim(om.ExplicitComponent):
"""Calculate fuselage average diameter and planform area for BWB"""

def initialize(self):
add_aviary_option(self, Settings.VERBOSITY)

def setup(self):
add_aviary_input(self, Aircraft.Fuselage.LENGTH, units='ft')
add_aviary_input(self, Aircraft.Fuselage.MAX_WIDTH, units='ft')
Expand Down Expand Up @@ -99,25 +93,26 @@ def setup_partials(self):
)

def compute(self, inputs, outputs):
verbosity = self.options[Settings.VERBOSITY]
max_width = inputs[Aircraft.Fuselage.MAX_WIDTH]
length = inputs[Aircraft.Fuselage.LENGTH]
max_height = inputs[Aircraft.Fuselage.MAX_HEIGHT]
root_chord = inputs[Aircraft.Wing.ROOT_CHORD]
rear_spar_percent_chord = inputs['Rear_spar_percent_chord']

if length <= 0.0:
if verbosity > Verbosity.BRIEF:
print('Aircraft.Fuselage.LENGTH must be positive.')
raise ValueError(
f'Aircraft.Fuselage.LENGTH must be positive, however {length} is provided.'
)
if rear_spar_percent_chord <= 0.0:
if verbosity > Verbosity.BRIEF:
print('Rear_spar_percent_chord must be positive. It is default to 0.7')
raise ValueError(
'Rear_spar_percent_chord must be positive, '
f'however {rear_spar_percent_chord} is provided.'
)

# not sure if this is right definition and not sure if it is used for BWB.
avg_diameter = 0.5 * (max_height + max_width)
ref_diameter = 0.5 * (max_height + max_width)
planform_area = max_width * (length + root_chord / rear_spar_percent_chord) / 2.0

outputs[Aircraft.Fuselage.REF_DIAMETER] = avg_diameter
outputs[Aircraft.Fuselage.REF_DIAMETER] = ref_diameter
outputs[Aircraft.Fuselage.PLANFORM_AREA] = planform_area

def compute_partials(self, inputs, partials):
Expand All @@ -139,15 +134,16 @@ def compute_partials(self, inputs, partials):


class SimpleCabinLayout(om.ExplicitComponent):
"""Given fuselage length, height and width, compute passenger compartment length."""
"""
Given fuselage length, height and width, compute passenger compartment length.
This is for transporter aircraft, not BWB.
"""

def initialize(self):
add_aviary_option(self, Settings.VERBOSITY)

def setup(self):
add_aviary_input(self, Aircraft.Fuselage.LENGTH, units='ft')
add_aviary_input(self, Aircraft.Fuselage.MAX_HEIGHT, units='ft')
add_aviary_input(self, Aircraft.Fuselage.MAX_WIDTH, units='ft')

add_aviary_output(self, Aircraft.Fuselage.PASSENGER_COMPARTMENT_LENGTH, units='ft')

Expand All @@ -161,24 +157,19 @@ def compute(self, inputs, outputs):
verbosity = self.options[Settings.VERBOSITY]

length = inputs[Aircraft.Fuselage.LENGTH]
max_height = inputs[Aircraft.Fuselage.MAX_HEIGHT]
max_width = inputs[Aircraft.Fuselage.MAX_WIDTH]
if length <= 0.0:
if verbosity > Verbosity.BRIEF:
print('Aircraft.Fuselage.LENGTH must be positive to use simple cabin layout.')
if max_height <= 0.0 or max_width <= 0.0:
if verbosity > Verbosity.BRIEF:
print(
'Aircraft.Fuselage.MAX_HEIGHT & Aircraft.Fuselage.MAX_WIDTH must be positive.'
)
raise ValueError(
f'Aircraft.Fuselage.LENGTH must be positive, however {length} is provided.'
)

pax_compart_length = 0.6085 * length * (np.arctan(length / 59.0)) ** 1.1
if pax_compart_length > 190.0:
if verbosity > Verbosity.BRIEF:
print(
'Passenger compartiment lenght is longer than recommended maximum length. '
'Suggest use detailed laylout algorithm.'
raise UserWarning(
'Passenger compartment length is longer than recommended maximum'
' length. Suggest using detailed laylout algorithm.'
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
' length. Suggest using detailed laylout algorithm.'
' length. Suggest using detailed layout algorithm.'

)

outputs[Aircraft.Fuselage.PASSENGER_COMPARTMENT_LENGTH] = pax_compart_length

def compute_partials(self, inputs, J):
Expand All @@ -191,11 +182,12 @@ def compute_partials(self, inputs, J):


class DetailedCabinLayout(om.ExplicitComponent):
"""Compute fuselage dimensions using cabin seat information."""
"""
Compute fuselage dimensions using cabin seat information.
This is for transporter aircraft, not BWB.
"""

def initialize(self):
add_aviary_option(self, Settings.VERBOSITY)
add_aviary_option(self, Aircraft.Fuselage.NUM_FUSELAGES)
add_aviary_option(self, Aircraft.CrewPayload.Design.NUM_FIRST_CLASS)
add_aviary_option(self, Aircraft.CrewPayload.Design.NUM_TOURIST_CLASS)
add_aviary_option(self, Aircraft.CrewPayload.Design.NUM_SEATS_ABREAST_FIRST)
Expand All @@ -215,14 +207,9 @@ def setup(self):
self.declare_partials('*', '*', method='fd', form='forward')

def compute(self, inputs, outputs):
verbosity = self.options[Settings.VERBOSITY]
num_first_class_pax = self.options[Aircraft.CrewPayload.Design.NUM_FIRST_CLASS]
num_tourist_class_pax = self.options[Aircraft.CrewPayload.Design.NUM_TOURIST_CLASS]
fuselage_multiplier = 1.0
num_fuselage = self.options[Aircraft.Fuselage.NUM_FUSELAGES]
if num_fuselage > 1:
if verbosity > Verbosity.BRIEF:
print('Multiple fuselage configuration is not implemented yet.')

num_seat_abreast_first = self.options[Aircraft.CrewPayload.Design.NUM_SEATS_ABREAST_FIRST]
num_seat_abreast_tourist = self.options[
Expand Down Expand Up @@ -466,20 +453,20 @@ def compute(self, inputs, outputs):
bay_width_max = 12.0 # ft

if length <= 0.0:
if verbosity > Verbosity.BRIEF:
print('Aircraft.Fuselage.LENGTH must be positive to use simple cabin layout.')
raise ValueError(
f'Aircraft.Fuselage.LENGTH must be positive to use simple cabin layout.'
)
if max_width <= 0.0:
if verbosity > Verbosity.BRIEF:
print(
'Aircraft.Fuselage.MAX_HEIGHT & Aircraft.Fuselage.MAX_WIDTH must be positive.'
)
raise ValueError(
f'Aircraft.Fuselage.MAX_HEIGHT must be positive, however {max_width} is provided.'
)

pax_compart_length = rear_spar_percent_chord * length
if pax_compart_length > 190.0:
if verbosity > Verbosity.BRIEF:
print(
'Passenger compartiment lenght is longer than recommended maximum length. '
'Suggest use detailed laylout algorithm.'
raise UserWarning(
'Passenger compartment lenght is longer than recommended maximum'
' length. Suggest using detailed laylout algorithm.'
Comment on lines +468 to +469
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
'Passenger compartment lenght is longer than recommended maximum'
' length. Suggest using detailed laylout algorithm.'
'Passenger compartment length is longer than recommended maximum'
' length. Suggest using detailed layout algorithm.'

)

sweep = inputs[Aircraft.BWB.PASSENGER_LEADING_EDGE_SWEEP]
Expand Down Expand Up @@ -540,8 +527,6 @@ class BWBDetailedCabinLayout(om.ExplicitComponent):
"""Compute BWB fuselage dimensions using cabin seat information."""

def initialize(self):
add_aviary_option(self, Settings.VERBOSITY)
add_aviary_option(self, Aircraft.Fuselage.NUM_FUSELAGES)
add_aviary_option(self, Aircraft.CrewPayload.Design.NUM_BUSINESS_CLASS)
add_aviary_option(self, Aircraft.CrewPayload.Design.NUM_FIRST_CLASS)
add_aviary_option(self, Aircraft.CrewPayload.Design.NUM_TOURIST_CLASS)
Expand Down
Loading
Loading