Tank Abstract Class#
- class rocketpy.Tank[source]#
Abstract Tank class that defines a tank object for a rocket motor, so that it evaluates useful properties of the tank and its fluids, such as mass, volume, fluid flow rate, center of mass, etc.
See also
- Variables:
Tank.name (
str
) – Name of the tank.Tank.geometry (
TankGeometry
) – Geometry of the tank.Tank.flux_time (
float
,tuple
offloat
, optional) – Tank flux time in seconds.Tank.liquid (
Fluid
) – Liquid inside the tank as a Fluid object.Tank.gas (
Fluid
) – Gas inside the tank as a Fluid object.Tank.discretize (
int
, optional) – Number of points to discretize fluid inputs.Tank.fluid_mass (
Function
) – Total mass of liquid and gases in kg inside the tank as a function of time.Tank.net_mass_flow_rate (
Function
) – Net mass flow rate of the tank in kg/s as a function of time, also understood as time derivative of the fluids mass.Tank.liquid_volume (
Function
) – Volume of the liquid inside the Tank in m^3 as a function of time.Tank.gas_volume (
Function
) – Volume of the gas inside the Tank in m^3 as a function of time.Tank.liquid_height (
Function
) – Height of the liquid inside the Tank in m as a function of time. The zero level reference is the same as set in Tank.geometry.Tank.gas_height (
Function
) – Height of the gas inside the Tank in m as a function of time. The zero level reference is the same as set in Tank.geometry.Tank.liquid_mass (
Function
) – Mass of the liquid inside the Tank in kg as a function of time.Tank.gas_mass (
Function
) – Mass of the gas inside the Tank in kg as a function of time.Tank.liquid_center_of_mass (
Function
) – Center of mass of the liquid inside the Tank in m as a function of time. The zero level reference is the same as set in Tank.geometry.Tank.gas_center_of_mass (
Function
) – Center of mass of the gas inside the Tank in m as a function of time. The zero level reference is the same as set in Tank.geometry.Tank.center_of_mass (
Function
) – Center of mass of liquid and gas (i.e. propellant) inside the Tank in m as a function of time. The zero level reference is the same as set in Tank.geometry.Tank.liquid_inertia (
Function
) – The inertia of the liquid inside the Tank in kg*m^2 as a function of time around a perpendicular axis to the Tank symmetry axis. The reference point is the Tank center of mass.Tank.gas_inertia (
Function
) – The inertia of the gas inside the Tank in kg*m^2 as a function of time around a perpendicular axis to the Tank symmetry axis. The reference point is the Tank center of mass.Tank.inertia (
Function
) – The inertia of the liquid and gas (i.e. propellant) inside the Tank in kg*m^2 as a function of time around a perpendicular axis to the Tank symmetry axis. The reference point is the Tank center of mass.
- __init__(name, geometry, flux_time, liquid, gas, discretize=100)[source]#
Initialize Tank class.
- Parameters:
name (
str
) – Name of the tank.geometry (
TankGeometry
) – Geometry of the tank.flux_time (
float
,tuple
offloat
, 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.gas (
Fluid
) – Gas inside the tank as a Fluid object.liquid (
Fluid
) – Liquid inside the tank as a Fluid object.discretize (
int
, optional) – Number of points to discretize fluid inputs. If the input already has a appropriate discretization, this parameter must be set to None. The default is 100.
- property flux_time#
Returns the start and final times of the tank flux.
- Returns:
Tuple containing start and final times of the tank flux.
- Return type:
tuple
- abstract property 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:
- abstract property net_mass_flow_rate#
Returns the net mass flow rate of the tank as a function of time. Net mass flow rate is the mass flow rate entering the tank minus the mass flow rate exiting the tank, including liquids and gases.
- Returns:
Net mass flow rate of the tank as a function of time.
- Return type:
- abstract property 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:
- abstract property liquid_volume#
Returns the volume of the liquid as a function of time.
- Returns:
Volume of the liquid as a function of time.
- Return type:
- abstract property gas_volume#
Returns the volume of the gas as a function of time.
- Returns:
Volume of the gas as a function of time.
- Return type:
- abstract property 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:
- abstract property gas_height#
Returns the gas 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:
- abstract property 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:
- abstract property 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:
- liquid_center_of_mass#
Returns the center of mass of the liquid portion of the tank as a function of time. This height is measured from the zero level of the tank geometry.
- Returns:
Center of mass of the liquid portion of the tank as a function of time.
- Return type:
- gas_center_of_mass#
Returns the center of mass of the gas portion of the tank as a function of time. This height is measured from the zero level of the tank geometry.
- Returns:
Center of mass of the gas portion of the tank as a function of time.
- Return type:
- center_of_mass#
Returns the center of mass of the tank’s fluids as a function of time. This height is measured from the zero level of the tank geometry.
- Returns:
Center of mass of the tank’s fluids as a function of time.
- Return type:
- liquid_inertia#
Returns the inertia tensor of the liquid portion of the tank as a function of time. The reference point is the center of mass of the tank.
- Returns:
Inertia tensor of the liquid portion of the tank as a function of time.
- Return type:
- gas_inertia#
Returns the inertia tensor of the gas portion of the tank as a function of time. The reference point is the center of mass of the tank.
- Returns:
Inertia tensor of the gas portion of the tank as a function of time.
- Return type:
- inertia#
Returns the inertia tensor of the tank’s fluids as a function of time. The reference point is the center of mass of the tank.
- Returns:
Inertia tensor of the tank’s fluids as a function of time.
- Return type:
- _check_volume_bounds()[source]#
Checks if the tank is overfilled or underfilled. Raises a ValueError if either the gas_volume or liquid_volume are out of tank geometry bounds.