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.
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.
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.
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.
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.
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.