Skip to content

Commit

Permalink
DOC: improve MassBasedTank over volume error message.
Browse files Browse the repository at this point in the history
  • Loading branch information
phmbressan committed Nov 22, 2023
1 parent 21e9f58 commit 6894dd4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions rocketpy/motors/tank.py
Original file line number Diff line number Diff line change
Expand Up @@ -1299,10 +1299,11 @@ def fluid_volume(self):

if (diff > 1e-6).any():
raise ValueError(
"The `fluid_volume`, defined as the sum of `gas_volume` and "
+ "`liquid_volume`, is not equal to the total volume of the tank."
+ "\n\t\tThe difference is more than 1e-6 m^3 at "
+ f"{diff.x_array[np.argmin(diff.y_array)]} s."
f"The tank {self.name} was overfilled. The input fluid masses "
+ "produce a volume that surpasses the tank total volume by more "
+ f"than 1e-6 m^3 at {diff.x_array[np.argmax(diff.y_array)]} s."
+ "\n\t\tCheck out the input masses, fluid densities or raise the "
+ "tank height so as to increase its total volume."
)

return fluid_volume
Expand Down

0 comments on commit 6894dd4

Please sign in to comment.