flowtube.tools ============== .. py:module:: flowtube.tools .. autoapi-nested-parse:: 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 ---------- .. autoapisummary:: flowtube.tools.STANDARD_TEMPERATURE_K flowtube.tools.STANDARD_PRESSURE_Pa flowtube.tools.UNIVERSAL_GAS_CONSTANT flowtube.tools.BOLTZMANN_CONSTANT flowtube.tools.AVOGADROS_NUMBER flowtube.tools.MOLES_PER_SCCM flowtube.tools.P_CF Functions --------- .. autoapisummary:: flowtube.tools.permeation_rate_to_MR flowtube.tools.vapor_pressure_to_MR flowtube.tools.T_in_K flowtube.tools.P_in_Pa flowtube.tools.cross_sectional_area flowtube.tools.partial_cylinder_area flowtube.tools.table Module Contents --------------- .. py:data:: STANDARD_TEMPERATURE_K :value: 273.15 .. py:data:: STANDARD_PRESSURE_Pa :value: 101325 .. py:data:: UNIVERSAL_GAS_CONSTANT :value: 8.3145 .. py:data:: BOLTZMANN_CONSTANT :value: 1.380649e-23 .. py:data:: AVOGADROS_NUMBER :value: 6.0221408e+23 .. py:data:: MOLES_PER_SCCM :value: 4.461483281705948e-05 .. py:data:: P_CF .. py:function:: permeation_rate_to_MR(flow_rate: float, permeation_rate: float, reactant_gas: str) -> float Convert permeation rate to mixing ratio. :param flow_rate: Flow rate through permeation in sccm. :type flow_rate: float :param permeation_rate: Permeation rate in ng/min. :type permeation_rate: float :param reactant_gas: Molecular formula of reactant gas. :type reactant_gas: str :returns: Reactant volumetric mixing ratio (mol mol-1). :rtype: float .. py:function:: vapor_pressure_to_MR(vapor_pressure: float, P_units: str, system_pressure: float, P_units_system: str) -> float Convert vapor pressure to mixing ratio. Assumes the carrier gas becomes fully saturated with the volatile substance. :param vapor_pressure: Vapor pressure. :type vapor_pressure: float :param P_units: Units of vapor pressure. :type P_units: str :param system_pressure: System pressure. :type system_pressure: float :param P_units_system: Units of system pressure. :type P_units_system: str :returns: Reactant volumetric mixing ratio (mol mol-1). :rtype: float .. py:function:: T_in_K(T: float) -> float Convert Celsius to Kelvin. :param T: Temperature in Celsius. :type T: float :returns: Temperature in Kelvin. :rtype: float .. py:function:: P_in_Pa(P: float, units: str) -> float Convert pressure to Pa. :param P: Pressure. :type P: float :param units: Supported pressure units: Torr, bar, mbar, or hPa. :type units: float :returns: Pressure in Pa. :rtype: float .. py:function:: cross_sectional_area(diameter: float) -> float Calculate cross sectional area. :param diameter: Diameter. :type diameter: float :returns: Cross sectional area. :rtype: float .. py:function:: partial_cylinder_area(height: float, width: float) -> tuple[float, float] 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. :param height: Height of the segment (cm). :type height: float :param width: Chord length of the segment (cm). :type width: float :returns: Outer perimeter (cm). float: Cross-sectional area (cm^2). :rtype: float .. py:function:: table(title: str, var_names: list[str], var: list[float], var_fmts: list[str], units: list[str]) -> None Print a formatted table of variables. :param title: Title of the table. :type title: str :param var_names: List of variable names. :type var_names: list :param var: Variable values. :type var: list :param var_fmts: List of formats for each variable. :type var_fmts: list :param units: List of units for each variable. :type units: list :returns: None