From 6894dd4ff18e64b6599ce65e0d7cb1004f6d9ec0 Mon Sep 17 00:00:00 2001 From: Pedro Bressan Date: Wed, 22 Nov 2023 20:29:31 -0300 Subject: [PATCH] DOC: improve MassBasedTank over volume error message. --- rocketpy/motors/tank.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/rocketpy/motors/tank.py b/rocketpy/motors/tank.py index d87bfd2a1..bba0ff7c9 100644 --- a/rocketpy/motors/tank.py +++ b/rocketpy/motors/tank.py @@ -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