flowtube.tools
Constants and unit conversions.
Constants:
STANDARD_TEMPERATURE_K: Standard temperature in Kelvin.
STANDARD_PRESSURE_Pa: Standard pressure in Pascal.
UNIVERSAL_GAS_CONSTANT: Universal gas constant in kg m2 s-2 K-1 mol-1.
BOLTZMANN_CONSTANT: Boltzmann constant in kg m2 s-2 K-1.
AVOGADROS_NUMBER: Avogadro’s number in mol-1.
P_CF: Conversion factors to Pascal for Torr, bar, mbar, hPa, and Pa pressure units.
Attributes
Functions
|
Convert permeation rate to mixing ratio. |
|
Convert vapor pressure to mixing ratio. Assumes the carrier gas |
|
Convert Celsius to Kelvin. |
|
Convert pressure to Pa. |
|
Calculate cross sectional area. |
|
Calculate the cross-sectional area and perimeter of a partial |
|
Print a formatted table of variables. |
Module Contents
- flowtube.tools.permeation_rate_to_MR(flow_rate: float, permeation_rate: float, reactant_gas: str) float[source]
Convert permeation rate to mixing ratio.
- Parameters:
flow_rate (float) – Flow rate through permeation in sccm.
permeation_rate (float) – Permeation rate in ng/min.
reactant_gas (str) – Molecular formula of reactant gas.
- Returns:
Reactant volumetric mixing ratio (mol mol-1).
- Return type:
float
- flowtube.tools.vapor_pressure_to_MR(vapor_pressure: float, P_units: str, system_pressure: float, P_units_system: str) float[source]
Convert vapor pressure to mixing ratio. Assumes the carrier gas becomes fully saturated with the volatile substance.
- Parameters:
vapor_pressure (float) – Vapor pressure.
P_units (str) – Units of vapor pressure.
system_pressure (float) – System pressure.
P_units_system (str) – Units of system pressure.
- Returns:
Reactant volumetric mixing ratio (mol mol-1).
- Return type:
float
- flowtube.tools.T_in_K(T: float) float[source]
Convert Celsius to Kelvin.
- Parameters:
T (float) – Temperature in Celsius.
- Returns:
Temperature in Kelvin.
- Return type:
float
- flowtube.tools.P_in_Pa(P: float, units: str) float[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: float) float[source]
Calculate cross sectional area.
- Parameters:
diameter (float) – Diameter.
- Returns:
Cross sectional area.
- Return type:
float
- flowtube.tools.partial_cylinder_area(height: float, width: float) tuple[float, float][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: str, var_names: list[str], var: list[float], var_fmts: list[str], units: list[str]) None[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.
- Returns:
None