flowtube.tools

Constants and unit conversions.

Functions

P_in_Pa(P, units)

Convert pressure to Pa.

T_in_K(T)

Convert celcius to Kelvin.

cross_sectional_area(diameter)

Calculate cross sectional area.

partial_cylinder_area(height, width)

Calculate the cross-sectional area and perimeter of a partial cylinder ("boat") given its height and width.

table(title, var_names, var, var_fmts, units)

Print a formatted table of variables.

flowtube.tools.T_in_K(T)[source]

Convert celcius to Kelvin.

Parameters:

T (float) – Temperature in Celcius.

Returns:

Temperature in Kelvin.

Return type:

float

flowtube.tools.P_in_Pa(P, units)[source]

Convert pressure to Pa.

Parameters:
  • P (float) – Pressure.

  • units (float) – Supported pressure units: Torr, bar, mbar, or hPa.

Returns:

Pressure in Pa.

Return type:

float

flowtube.tools.cross_sectional_area(diameter)[source]

Calculate cross sectional area.

Parameters:

diameter (float) – Diameter.

Returns:

Cross sectional area.

Return type:

float

flowtube.tools.partial_cylinder_area(height, width)[source]

Calculate the cross-sectional area and perimeter of a partial cylinder (“boat”) given its height and width. Assumes the partial cylinder is a segment of a circle with given width as chord length and that the height is less than the diameter of the circle. Calculations based on: https://mathworld.wolfram.com/CircularSegment.html and https://www.vcalc.com/wiki/KurtHeckman/Circle-area-of-an-arc-segment-h.

Parameters:
  • height (float) – Height of the segment (cm).

  • width (float) – Chord length of the segment (cm).

Returns:

Outer perimeter (cm). float: Cross-sectional area (cm^2).

Return type:

float

flowtube.tools.table(title, var_names, var, var_fmts, units)[source]

Print a formatted table of variables.

Parameters:
  • title (str) – Title of the table.

  • var_names (list) – List of variable names.

  • var (list) – Variable values.

  • var_fmts (list) – List of formats for each variable.

  • units (list) – List of units for each variable.

Return type:

None

Returns:

None