Fix unused tanks
Description
Fixed bug and updated logic so that tanks are only filled if their used_tank flag is True, otherwise they are filled with 0 kg. (e.g. if a tank is available but not used during mission).
Related Issue(s)
Other Changes
- Refactored the refueling and defueling functions to delete double entries and simplify the code.
Screenshots/Logs
Testing Instructions
- Download this branch. Execute
weight_and_balance
module to the project provided in #198. - An error is expected now in the
calculate_fuel_mass_properties
and not during defueling anymore, as the used_tank flag for the wing center tank is False and the fuel mass to be filled up exceeds the total capacity of the available tanks. - Change in component_design/specific/tank ID = "4" (the wing center tank) the
maximum_energy_capacity
to a meaningful value and theenergy_capacity_required_for_mission
totrue
and execute w&b again.
Developer Checklist
-
Code has been tested locally.
Additional Notes
At the moment the used_tank flag is set by tank_design. W&b throws an error after the third iteration loop for kerosene if there is still remaining fuel to be refilled, but not enough capacity in the tanks. W&B is not responsabile for resizing the tanks, it only checks if the mission fuel fits in the available tanks.
Merge request reports
Activity
Please register or sign in to reply