From 9f69c740acf189a12715b17da8c967687119d64b Mon Sep 17 00:00:00 2001 From: Pedro Bressan Date: Tue, 21 Nov 2023 19:28:44 -0300 Subject: [PATCH] TST: fix test of MassBasedTank overfill. --- tests/test_tank.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/test_tank.py b/tests/test_tank.py index 932c6c409..32cd2ba3a 100644 --- a/tests/test_tank.py +++ b/tests/test_tank.py @@ -140,7 +140,7 @@ def test_mass_based_tank(): ) # density value may be estimate top_endcap = lambda y: np.sqrt( - 0.0775**2 - (y - 0.6924) ** 2 + 0.0775**2 - (y - 0.7924) ** 2 ) # Hemisphere equation creating top endcap bottom_endcap = lambda y: np.sqrt( 0.0775**2 - (0.0775 - y) ** 2 @@ -150,8 +150,8 @@ def test_mass_based_tank(): real_geometry = TankGeometry( { (0, 0.0559): bottom_endcap, - (0.0559, 0.7139): lambda y: 0.0744, - (0.7139, 0.7698): top_endcap, + (0.0559, 0.8039): lambda y: 0.0744, + (0.8039, 0.8698): top_endcap, } ) @@ -172,7 +172,6 @@ def test_mass_based_tank(): gas_mass=gas_masses, liquid=lox, gas=n2, - discretize=None, ) # Generate tank geometry {radius: height, ...} @@ -190,6 +189,10 @@ def test_mass_based_tank(): discretize=None, ) + # Assert volume bounds + assert (real_tank_lox.gas_height <= real_tank_lox.geometry.total_volume).all + assert (example_tank_lox.gas_height <= example_tank_lox.geometry.total_volume).all + initial_liquid_mass = 5 initial_gas_mass = 0 liquid_mass_flow_rate_in = 0.1