UllageBasedTank Class#

class rocketpy.UllageBasedTank[source]#

Class to define a tank whose flow is described by ullage volume, i.e., the volume of the tank that is not occupied by the liquid. It assumes that the ullage volume is uniformly filled by the gas. This class inherits from the Tank class. See the Tank class for more information on its attributes and methods.

See also

Tanks Usage

__init__(name, geometry, flux_time, liquid, gas, ullage, discretize=100)[source]#
Parameters:
  • name (str) – Name of the tank.

  • geometry (TankGeometry) – Geometry of the tank.

  • flux_time (float, tuple of float, optional) – Tank flux time in seconds. It is the time range in which the tank flux is being analyzed. In general, during this time, the tank is being filled or emptied. If a float is given, the flux time is assumed to be between 0 and the given float, in seconds. If a tuple of float is given, the flux time is assumed to be between the first and second elements of the tuple.

  • liquid (Fluid) – Liquid inside the tank as a Fluid object.

  • gas (Fluid) – Gas inside the tank as a Fluid object.

  • ullage (int, float, callable, string, array, Function) – Ullage volume as a function of time in m^3. Also understood as the volume of the Tank that is not occupied by liquid. Must be a valid Function source. If a callable is given, it must be a function of time in seconds. If a .csv file is given, the first column must be the time in seconds and the second column must be the ullage volume in m^3.

  • discretize (int, optional) – Number of points to discretize fluid inputs. If the ullage input is already discretized this parameter may be set to None. Otherwise, an uniform discretization will be applied based on the discretize value. The default is 100.

fluid_mass#

Returns the total mass of liquid and gases inside the tank as a function of time.

Returns:

Mass of the tank as a function of time. Units in kg.

Return type:

Function

net_mass_flow_rate#

Returns the net mass flow rate of the tank as a function of time by taking the derivative of the mass function.

Returns:

Net mass flow rate of the tank as a function of time.

Return type:

Function

fluid_volume#

Returns the volume total fluid volume inside the tank as a function of time. This volume is the sum of the liquid and gas volumes.

Returns:

Volume of the fluid as a function of time.

Return type:

Function

liquid_volume#

Returns the volume of the liquid as a function of time. The volume is computed by subtracting the ullage volume from the total volume of the tank.

Returns:

Volume of the liquid as a function of time.

Return type:

Function

gas_volume#

Returns the volume of the gas as a function of time. From the Tank assumptions the gas volume is equal to the ullage volume.

Returns:

Volume of the gas as a function of time.

Return type:

Function

gas_mass#

Returns the mass of the gas as a function of time.

Returns:

Mass of the gas as a function of time.

Return type:

Function

liquid_mass#

Returns the mass of the liquid as a function of time.

Returns:

Mass of the liquid as a function of time.

Return type:

Function

liquid_height#

Returns the liquid level as a function of time. This height is measured from the zero level of the tank geometry.

Returns:

Height of the ullage as a function of time.

Return type:

Function

gas_height#

Returns the gas level as a function of time. This height is measured from the zero level of the tank geometry. Since the gas is assumed to be uniformly distributed in the ullage, the gas height is constant and equal to the top of the tank geometry.

Returns:

Height of the ullage as a function of time.

Return type:

Function

discretize_ullage()[source]#

Discretizes the ullage input according to the flux time and the discretize parameter.