STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
feedtwin.vessels.geometry Namespace Reference

Classes

class  TankGeometry
class  Head
class  CylindricalTank
class  TabulatedGeometry

Functions

float level_of_volume (TankGeometry geometry, float volume)
None register_geometry (str name, GeometryFactory factory)
TankGeometry build_geometry (str name, **object kwargs)
list[str] registered_geometries ()
TankGeometry _cylindrical (float diameter, float barrel_length, float head_ratio=2.0, float|None bottom_head_ratio=None, float|None top_head_ratio=None)
CylindricalTank cylindrical_from_volume (float volume, float diameter)

Variables

dict _LAST_LEVEL = {}
int _LAST_LEVEL_SHAPES = 64
 GeometryFactory = Callable[..., TankGeometry]
dict _GEOMETRIES = {}

Detailed Description

Tank geometry: how much liquid is in there, and how much surface it shows.

Three numbers come out of a tank's shape and all three matter:

**Volume below a level.** A propellant load is a mass, and where the surface
sits follows from the shape. Treat a tank as a plain cylinder and you misplace
the surface by the whole height of the end caps -- 5 cm on a 6 in. tank with
2:1 ellipsoidal heads, which is 15% of the volume of a short tank.

**Cross-section at the surface.** This is the area across which warm pressurant
talks to cold liquid, and it is what
:mod:`~feedtwin.vessels.collapse` multiplies its heat flux by. In the barrel it
is constant; in a head it is not, and a nearly-empty tank has a much smaller
interface than a half-full one.

**Wetted wall area.** What the liquid can chill, and what an insulation model
needs. Carried now because Phase 14 wants it and because it is free once the
shape is described.

Shapes are registered by name, so a tank with a geometry nobody anticipated is
a registration rather than an edit to this module -- and the escape hatch below
that is :class:`TabulatedGeometry`, which takes a *V(h)* curve straight off a
CAD model and asks no questions about the shape at all.

Function Documentation

◆ _cylindrical()

TankGeometry feedtwin.vessels.geometry._cylindrical ( float diameter,
float barrel_length,
float head_ratio = 2.0,
float | None bottom_head_ratio = None,
float | None top_head_ratio = None )
protected

Definition at line 380 of file geometry.py.

References head.

◆ build_geometry()

TankGeometry feedtwin.vessels.geometry.build_geometry ( str name,
**object kwargs )

Definition at line 367 of file geometry.py.

◆ cylindrical_from_volume()

CylindricalTank feedtwin.vessels.geometry.cylindrical_from_volume ( float volume,
float diameter )
A barrel of the right volume at a stated diameter, 2:1 heads.

What a drawing gives you: a volume and a diameter, not a barrel length.
The heads are fixed at the pressure-vessel default and the barrel takes
the remainder; a volume smaller than two heads gets a zero barrel rather
than a negative one.

Definition at line 403 of file geometry.py.

References max, and register_geometry().

◆ level_of_volume()

float feedtwin.vessels.geometry.level_of_volume ( TankGeometry geometry,
float volume )
Invert ``volume_below``: where the surface sits for a given fill [m].

Numerically rather than analytically. ``volume_below`` is monotonic for any
physical tank, so a bracketed root always exists and always converges; the
alternative is a closed-form inverse per shape, which is three times the
code and wrong the moment somebody registers a fourth shape.

Definition at line 62 of file geometry.py.

◆ register_geometry()

None feedtwin.vessels.geometry.register_geometry ( str name,
GeometryFactory factory )

Definition at line 363 of file geometry.py.

Referenced by cylindrical_from_volume().

◆ registered_geometries()

list[str] feedtwin.vessels.geometry.registered_geometries ( )

Definition at line 376 of file geometry.py.

Variable Documentation

◆ _GEOMETRIES

dict feedtwin.vessels.geometry._GEOMETRIES = {}
protected

Definition at line 360 of file geometry.py.

◆ _LAST_LEVEL

dict feedtwin.vessels.geometry._LAST_LEVEL = {}
protected

Definition at line 95 of file geometry.py.

◆ _LAST_LEVEL_SHAPES

int feedtwin.vessels.geometry._LAST_LEVEL_SHAPES = 64
protected

Definition at line 97 of file geometry.py.

◆ GeometryFactory

feedtwin.vessels.geometry.GeometryFactory = Callable[..., TankGeometry]

Definition at line 358 of file geometry.py.