TankGeometry Class#

class rocketpy.TankGeometry[source]#

Class to define the geometry of a tank. It is used to calculate the geometrical properties such as volume, area and radius. The tank is axi-symmetric, and its geometry is defined by a set of Functions that are used to calculate the radius as a function of height.

Variables:
  • TankGeometry.geometry (dict) – Dictionary containing the geometry of the tank. The dictionary keys are disjoint domains of the corresponding coordinates in meters on the TankGeometry symmetry axis. The dictionary values are rocketpy.Function objects that map the Tank height to its corresponding radius. As an example, { (-1,1): Function(lambda h: (1 - h**2) ** (1/2)) } defines an spherical tank of radius 1.

  • TankGeometry.radius (Function) – Piecewise defined radius in meters as a rocketpy.Function based on the TankGeometry.geometry dict.

  • TankGeometry.average_radius (float) – The average radius in meters of the Tank radius. It is calculated as the average of the radius Function over the tank height.

  • TankGeometry.bottom (float) – The bottom of the tank. It is the lowest coordinate that belongs to the domain of the geometry.

  • TankGeometry.top (float) – The top of the tank. It is the highest coordinate that belongs to the domain of the geometry.

  • TankGeometry.total_height (float) – The total height of the tank, in meters. It is calculated as the difference between the top and bottom coordinates.

  • TankGeometry.area (Function) – Tank cross sectional area in meters squared as a function of height, defined as the area of a circle with radius TankGeometry.radius.

  • TankGeometry.volume (Function) – Tank volume in in meters cubed as a function of height, defined as the Tank volume from the bottom to the given height.

  • TankGeometry.total_volume (float) – Total volume of the tank, in meters cubed. It is calculated as the volume from the bottom to the top of the tank.

  • TankGeometry.inverse_volume (Function) – Tank height as a function of volume, defined as the inverse of the TankGeometry.volume Function.

__init__(geometry_dict={})[source]#

Initialize TankGeometry class.

Parameters:

geometry_dict (dict, optional) – Dictionary containing the geometry of the tank. The geometry is calculated by a PiecewiseFunction. Hence, the dict keys are disjoint tuples containing the lower and upper bounds of the domain of the corresponding Function, while the values correspond to the radius function from an axis of symmetry.

property geometry#

The dictionary containing the geometry of the tank.

Returns:

Dictionary containing the geometry of the tank.

Return type:

dict

radius#

The radius of the tank as a function of height.

Returns:

Piecewise defined Function of tank radius.

Return type:

Function

property average_radius#

The average radius of the tank.

Returns:

Average radius of the tank.

Return type:

float

property bottom#

The bottom of the tank. It is the lowest coordinate that belongs to the domain of the geometry.

Returns:

Bottom coordinate of the tank.

Return type:

float

property top#

The top of the tank. It is the highest coordinate that belongs to the domain of the geometry.

Returns:

Top coordinate of the tank.

Return type:

float

property total_height#

The total height of the tank, in meters.

Returns:

Total height of the tank.

Return type:

float

area#

The area of the tank cross section as a function of height.

Returns:

Tank cross sectional area as a function of height.

Return type:

Function

volume#

The volume of the tank as a function of height.

Returns:

Tank volume as a function of height.

Return type:

Function

property total_volume#

The total volume of the tank.

Returns:

Total volume of the tank.

Return type:

float

inverse_volume#

The height of the tank as a function of volume.

Returns:

Tank height as a function of volume.

Return type:

Function

volume_moment(lower, upper)[source]#

Calculates the first volume moment in m^4 of the tank as a function of height. The first volume moment is used in the evaluation of the tank centroid, and can be understood as the weighted sum of the tank’s infinitesimal slices volume by their height.

The height referential is the zero level of the defined tank geometry, not to be confused with the tank bottom.

Returns:

Tank’s first volume moment as a function of height.

Return type:

Function

Ix_volume(lower, upper)[source]#

The volume of inertia of the tank in m^5 with respect to the x-axis as a function of height. The x direction is assumed to be perpendicular to the motor body axis.

The inertia reference point is the zero level of the defined tank geometry, not to be confused with the tank bottom.

Parameters:
  • lower (float) – Lower bound of the domain where the volume of inertia is valid.

  • upper (float) – Upper bound of the domain where the volume of inertia is valid.

Returns:

Tank volume of inertia as a function of height.

Return type:

Function

Iy_volume(lower, upper)[source]#

The volume of inertia of the tank with respect to the y-axis as a function of height. The y direction is assumed to be perpendicular to the motor body axis.

The inertia reference point is the zero level of the defined tank geometry, not to be confused with the tank bottom.

Due to symmetry, this is the same as the Ix_volume.

Returns:

Tank volume of inertia as a function of height.

Return type:

Function

Iz_volume(lower, upper)[source]#

The volume of inertia of the tank with respect to the z-axis as a function of height. The z direction is assumed to be parallel to the motor body axis.

The inertia reference point is the zero level of the defined tank geometry, not to be confused with the tank bottom.

Returns:

Tank volume of inertia as a function of height.

Return type:

Function

add_geometry(domain, radius_function)[source]#

Adds a new geometry to the tank. The geometry is defined by a Function source, and a domain where it is valid.

Parameters:
  • domain (tuple) – Tuple containing the lower and upper bounds of the domain where the radius is valid.

  • radius_function (Function, callable) – Function that defines the radius of the tank as a function of height.