Skip to content

Commit

Permalink
Fixed non-regression tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
christophe-david committed Mar 23, 2023
1 parent ddc07f6 commit b4788e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/fastoad/models/performances/mission/openmdao/mission.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,9 @@ def setup(self):
self.add_output(self.specific_burned_fuel_variable, units="NM**-1")

def compute(self, inputs, outputs, discrete_inputs=None, discrete_outputs=None):
payload = inputs[self.payload_variable]
burned_fuel = inputs[self.burned_fuel_variable]
mission_range = inputs[self.range_variable]
# Denominators may be null at first iterations, so we avoid that.
payload = np.maximum(1.0, inputs[self.payload_variable])
mission_range = np.maximum(1.0, inputs[self.range_variable])

outputs[self.specific_burned_fuel_variable] = burned_fuel / payload / mission_range
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def setup(self, component: om.ExplicitComponent):
component.add_input(**variable.get_openmdao_kwargs())

for name, (units, desc) in output_definition.items():
component.add_output(name, units=units, desc=desc)
component.add_output(name, 0.0, units=units, desc=desc)

def compute(
self, start_flight_point: FlightPoint, inputs: Vector, outputs: Vector
Expand Down

0 comments on commit b4788e7

Please sign in to comment.