@@ -203,7 +203,7 @@ def compute_partials(self, inputs, partials):
203
203
204
204
205
205
def computeCorrectedDrag (drag , extraDragCoeff , wingArea , dynPressure ):
206
- return drag + 1 / 2 * extraDragCoeff * wingArea * dynPressure
206
+ return drag + extraDragCoeff * wingArea * dynPressure
207
207
208
208
209
209
# --- Lift and drag calculations ---
@@ -525,15 +525,24 @@ def setup(self):
525
525
526
526
# Test the performance group derivatives
527
527
if __name__ == "__main__" :
528
+ import os
529
+ import sys
528
530
529
- from AircraftSpecs .STWSpecs import aircraftSpecs
530
- from AircraftSpecs .STWFlightPoints import flightPointSets
531
-
532
- aircraftSpecs ["cruiseSpeed" ] = 200.0
533
- aircraftSpecs ["dynPressure" ] = 0.5 * 1.225 * aircraftSpecs ["cruiseSpeed" ] ** 2
531
+ sys .path .append (os .path .join (os .path .dirname (os .path .abspath (__file__ )), "../AircraftSpecs" ))
532
+ from AircraftSpecs .STWSpecs import aircraftSpecs # noqa: E402
533
+ from AircraftSpecs .STWFlightPoints import flightPointSets # noqa: E402
534
534
535
535
prob = om .Problem ()
536
536
prob .model = AircraftPerformanceGroup (aircraftSpecs = aircraftSpecs , flightPoints = flightPointSets ["3pt" ])
537
537
prob .setup ()
538
+ # Set some reasonable input values
539
+ prob .set_val ("wingboxMass" , 1000.0 , units = "kg" )
540
+ prob .set_val ("wingboxVolume" , 6.0 , units = "m**3" )
541
+ prob .set_val ("wingArea" , aircraftSpecs ["refArea" ], units = "m**2" )
542
+ for fp in flightPointSets ["3pt" ]:
543
+ prob .set_val (f"{ fp .name } Lift" , fp .loadFactor * aircraftSpecs ["refMTOW" ] * 9.81 / 2.0 )
544
+ prob .set_val ("cruiseDrag" , aircraftSpecs ["refMTOW" ] * 9.81 / 2.0 / 20 )
545
+ prob .run_model ()
546
+ prob .model .list_outputs ()
538
547
prob .check_partials (compact_print = True , form = "central" , step = 1e-6 )
539
548
om .n2 (prob , show_browser = True )
0 commit comments