Body Module

Conceptual Overview

The Body module provides the classes used to define the physical structures in the hydrodynamic simulation. These classes serve as the fundamental building blocks of the problem geometry.

The user’s first step in setting up a simulation is to create one or more Body objects. Each object represents a distinct physical component with its own geometric properties (like radii and depths) and dynamic properties (like whether it is heaving).

Once defined, these Body objects are collected into a BodyArrangement (typically a ConcentricBodyGroup), which is then used to initialize a Geometry object.

The most important and commonly used class in this module is the SteppedBody.

API Reference

Body (Abstract Base Class)

class openflash.body.Body[source]

Bases: ABC

Abstract base class for a physical body.

This is an abstract base class that defines the basic interface for all body types. You will not create instances of this class directly.

heaving: bool

SteppedBody

class openflash.body.SteppedBody(a: ndarray, d: ndarray, slant_angle: ndarray, heaving: bool = False)[source]

Bases: Body

Represents a body defined by a series of concentric, vertical-walled steps.

This is the primary implementation for the initial JOSS scope.

Parameters:
  • a (np.ndarray) – Array of outer radii for each step.

  • d (np.ndarray) – Array of values (depth) for each step.

  • slant_angle (np.ndarray) – Array of slant angles for each step surface.

  • heaving (bool, optional) – Flag indicating if the entire body is heaving. Defaults to False.

This is the primary class for defining bodies with concentric, vertical-walled steps. A single SteppedBody can be composed of one or more steps, allowing for complex, tiered structures to be defined as a single entity.