Tanks#
Classes for tank management and free surface effects.
Tank#
- class Tank(file_path, fluid_density=1025.0, name=None)#
A tank with fluid management capabilities.
- Parameters:
file_path – Path to the geometry file (STL or VTK)
fluid_density – Fluid density in kg/m³
name – Optional name for the tank
- __init__(file_path, fluid_density=1025.0, name=None)#
Creates a Tank from a file.
- static from_box_hull_intersection(hull, x_min, x_max, y_min, y_max, z_min, z_max, fluid_density=1025.0, name='HullTank')#
Creates a Tank as the intersection of a box with a hull geometry. Useful for double bottom tanks or side tanks that follow the hull shape.
- Parameters:
hull – Hull object to intersect with
x_min – Minimum x coordinate (aft)
x_max – Maximum x coordinate (fwd)
y_min – Minimum y coordinate (stbd)
y_max – Maximum y coordinate (port)
z_min – Minimum z coordinate (bottom)
z_max – Maximum z coordinate (top)
fluid_density – Fluid density in kg/m³
name – Tank name
- static from_box(name, x_min, x_max, y_min, y_max, z_min, z_max, fluid_density)#
Creates a box-shaped tank.
- Parameters:
name – Tank name
x_min – Minimum x coordinate
x_max – Maximum x coordinate
y_min – Minimum y coordinate
y_max – Maximum y coordinate
z_min – Minimum z coordinate
z_max – Maximum z coordinate
fluid_density – Fluid density in kg/m³
Properties
Fill State
Center of Gravity
Free Surface Moments
FSM Configuration
- set_fsm_mode(mode, t=None, l=None)#
Sets the free surface moment calculation mode.
- Parameters:
mode – Mode string (‘actual’, ‘maximum’, ‘fixed’)
t – Transverse FSM (m^4), required if mode is ‘fixed’
l – Longitudinal FSM (m^4), required if mode is ‘fixed’
Geometry
- get_vertices()#
Returns the vertices of the tank shell mesh.
- get_faces()#
Returns the faces (triangles) of the tank shell mesh.
- get_fluid_vertices(heel=0.0, trim=0.0)#
Returns the vertices of the fluid mesh at specified attitude.