Hydrostatics#

TankOptions#

class TankOptions(include_mass=False, include_fsm=True)#

Options for tank handling in hydrostatic calculations.

Parameters:
  • include_mass – Include tank fluid mass in displacement (default: False)

  • include_fsm – Apply Free Surface Moment correction to GM (default: True)

static none()#

Create options with no tank effects (mass=False, fsm=False).

static all()#

Create options with all tank effects (mass=True, fsm=True).

static mass_only()#

Create options with only mass included (mass=True, fsm=False).

static fsm_only()#

Create options with only FSM correction (mass=False, fsm=True).

include_mass: bool#

Whether tank mass is included.

include_fsm: bool#

Whether FSM correction is applied.

HydrostaticsCalculator#

class HydrostaticsCalculator(vessel, water_density=1025.0)#

Calculator for hydrostatic properties.

Parameters:
  • vessel – The vessel to calculate hydrostatics for

  • water_density – Water density in kg/m³ (default: 1025.0 for seawater)

from_draft(draft, trim=0.0, heel=0.0, vcg=None, num_stations=None, tank_options=None)#

Calculates hydrostatics at a given draft, trim, and heel.

Parameters:
  • draft – Draft at reference point (m)

  • trim – Trim angle (degrees)

  • heel – Heel angle (degrees)

  • vcg (float or None) – Vertical center of gravity for GM calculation (optional)

  • num_stations – Number of stations (optional)

  • tank_options – TankOptions object (optional)

Returns:

HydrostaticState with all properties

from_drafts(draft_ap, draft_fp, heel=0.0, vcg=None, tank_options=None)#

Calculates hydrostatics from drafts at Aft and Forward Perpendiculars.

Parameters:
  • draft_ap – Draft at Aft Perpendicular (m)

  • draft_fp – Draft at Forward Perpendicular (m)

  • heel – Heel angle (degrees)

  • vcg (float or None) – Vertical center of gravity for GM calculation (optional)

  • tank_options – TankOptions object (optional)

Returns:

HydrostaticState with all properties

from_displacement(displacement_mass, vcg=None, cog=None, trim=None, heel=None, tank_options=None)#

Calculates hydrostatics for a given displacement, finding the required draft.

Parameters:
  • displacement_mass – Target displacement in kg

  • vcg – Vertical center of gravity (m) for GM calculation (optional)

  • cog – Full center of gravity (LCG, TCG, VCG) tuple (optional, overrides vcg)

  • trim – Fixed trim angle in degrees (optional, default 0.0)

  • heel – Fixed heel angle in degrees (optional, default 0.0)

  • tank_options – TankOptions object (optional)

Returns:

HydrostaticState with all properties

Note

When tank_options is provided with include_mass=True, displacement_mass is interpreted as the mass of the vessel excluding the fluid in the tanks. The total displacement used for calculation will be displacement_mass + tank_fluid_mass.

from_loading(loading, num_stations=None)#

Calculates hydrostatics for a given LoadingCondition.

This method automatically applies the given loading condition (including tank fill overrides), calculates the equilibrium based on total displacement and combined COG, and restores the original tank fill levels.

Parameters:
  • loadingLoadingCondition to analyze.

  • num_stations – Number of stations (optional).

Returns:

HydrostaticState with all properties.

HydrostaticState#

class HydrostaticState#

Result of hydrostatic calculations.

Basic Properties

draft: float#

Draft at Midship Section (MP) in meters.

draft_ap: float#

Draft at Aft Perpendicular (AP) in meters.

draft_fp: float#

Draft at Forward Perpendicular (FP) in meters.

draft_mp: float#

Draft at Midship Perpendicular (MP) in meters (alias for draft).

volume: float#

Submerged volume (m³).

displacement: float#

Total displacement mass in kg (Volume * Water Density). Represents the total weight of the floating system (Vessel + Tanks).

vessel_displacement: float#

Vessel displacement mass in kg (Total - Tank Mass). Represents the input displacement (Lightship + Deadweight excluding tanks).

tank_displacement: float#

Tank fluid mass in kg (sum of all tank fluid masses). 0.0 if include_mass is False.

Centers

cob: tuple[float, float, float]#

Center of Buoyancy (LCB, TCB, VCB) vector.

cog: tuple[float, float, float] or None#

Center of Gravity (LCG, TCG, VCG) vector, if provided. Matches displacement.

vessel_cog: tuple[float, float, float] or None#

Vessel Center of Gravity (LCG, TCG, VCG) vector (Ship-only). Matches vessel_displacement.

Waterplane Properties

waterplane_area: float#

Waterplane area (m²).

lcf: float#

Longitudinal Center of Flotation (m).

Metacentric Radii

bmt: float#

Transverse metacentric radius (m).

bml: float#

Longitudinal metacentric radius (m).

Metacentric Heights (Corrected for Free Surface)

gmt: float or None#

Transverse metacentric height (Wet/Corrected) (m).

gml: float or None#

Longitudinal metacentric height (Wet/Corrected) (m).

Metacentric Heights (Uncorrected)

gmt_dry: float or None#

Transverse metacentric height (Dry/Uncorrected) (m).

gml_dry: float or None#

Longitudinal metacentric height (Dry/Uncorrected) (m).

Dimensions

lwl: float#

Length at Waterline (m).

bwl: float#

Beam at Waterline (m).

los: float#

Length Overall Submerged (m).

wetted_surface_area: float#

Wetted Surface Area (m²).

thickness_volume: float#

Volume added by the hull plate thickness (m³).

contact_surface_area: float#

Shared area between hulls excluded from wetted surface (m²).

midship_area: float#

Midship Section Area (m²).

Form Coefficients

cb: float#

Block Coefficient.

\[C_b = \frac{\nabla}{L_{wl} \cdot B_{wl} \cdot T}\]
cm: float#

Midship Section Coefficient.

\[C_m = \frac{A_m}{B_{wl} \cdot T}\]
cp: float#

Prismatic Coefficient.

\[C_p = \frac{\nabla}{A_m \cdot L_{wl}}\]

Free Surface Corrections

free_surface_correction_t: float#

Transverse Free Surface Correction (m).

free_surface_correction_l: float#

Longitudinal Free Surface Correction (m).

Stiffness Matrix

stiffness_matrix: list[float]#

6x6 Hydrostatic Stiffness Matrix (flattened row-major).

Advanced Properties

sectional_areas: list[tuple[float, float]]#

Sectional Area Curve as list of (x, area) pairs.

freeboard: float or None#

Minimum freeboard in meters, or None if no deck edges defined.