flowtube.flow_calc ================== .. py:module:: flowtube.flow_calc .. autoapi-nested-parse:: Conversion functions for flow rates and concentrations in flowtube package. Citations: Bird, R.B., Stewart, W.E., Lightfoot, E.N., 2002. Transport phenomena, 2nd, Wiley international ed ed. J. Wiley, New York. Knopf, D.A., Pöschl, U., Shiraiwa, M., 2015. Radial Diffusion and Penetration of Gas Molecules and Aerosol Particles through Laminar Flow Reactors, Denuders, and Sampling Tubes. Anal. Chem. 87, 3746-3754. https://doi.org/10.1021/ac5042395 Keyser, L.F., 1984. High-pressure flow kinetics. A study of the hydroxyl + hydrogen chloride reaction from 2 to 100 torr. J. Phys. Chem. 88, 4750-4758. https://doi.org/10.1021/j150664a061 Hanson, D.R., Lovejoy, E.R., 1994. The uptake of N2O5 onto small sulfuric acid particles. Geophys. Res. Lett. 21, 2401-2404. https://doi.org/10.1029/94GL02288 Holman, J. P., & Bhattacharyya, S. (2011). Heat transfer in SI units (10th ed.). McGraw-Hill. p. 284 Moore, J.H., Davis, C.C., Coplan, M.A., 2009. Building Scientific Apparatus, 4th ed. ed. Cambridge University Press, Leiden. Incropera, F.P., DeWitt, D.P., Bergman, T.L., Lavine, A.S. (Eds.), 2007. Fundamentals of heat and mass transfer, 6. ed. ed. Wiley, Hoboken, NJ. Classes ------- .. autoapisummary:: flowtube.flow_calc.basic_attrs flowtube.flow_calc.carrier_attrs flowtube.flow_calc.full_attrs Functions --------- .. autoapisummary:: flowtube.flow_calc.sccm_to_ccm flowtube.flow_calc.ccm_to_sccm flowtube.flow_calc.sccm_to_velocity flowtube.flow_calc.MR_to_molec flowtube.flow_calc.molec_velocity flowtube.flow_calc.reynolds_number flowtube.flow_calc.reynolds_number_irregular flowtube.flow_calc.conductance flowtube.flow_calc.pressure_gradient flowtube.flow_calc.buoyancy_parameters flowtube.flow_calc.length_to_laminar flowtube.flow_calc.mixing_time flowtube.flow_calc.N_eff_Shw flowtube.flow_calc.Kn Module Contents --------------- .. py:class:: basic_attrs Bases: :py:obj:`Protocol` Base class for protocol classes. Protocol classes are defined as:: class Proto(Protocol): def meth(self) -> int: ... Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing). For example:: class C: def meth(self) -> int: return 0 def func(x: Proto) -> int: return x.meth() func(C()) # Passes static type check See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:: class GenProto[T](Protocol): def meth(self) -> T: ... .. py:attribute:: P :type: float .. py:attribute:: T :type: float .. py:class:: carrier_attrs Bases: :py:obj:`basic_attrs`, :py:obj:`Protocol` Base class for protocol classes. Protocol classes are defined as:: class Proto(Protocol): def meth(self) -> int: ... Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing). For example:: class C: def meth(self) -> int: return 0 def func(x: Proto) -> int: return x.meth() func(C()) # Passes static type check See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:: class GenProto[T](Protocol): def meth(self) -> T: ... .. py:attribute:: carrier_dynamic_viscosity :type: float .. py:attribute:: carrier_density :type: float .. py:class:: full_attrs Bases: :py:obj:`carrier_attrs`, :py:obj:`Protocol` Base class for protocol classes. Protocol classes are defined as:: class Proto(Protocol): def meth(self) -> int: ... Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing). For example:: class C: def meth(self) -> int: return 0 def func(x: Proto) -> int: return x.meth() func(C()) # Passes static type check See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:: class GenProto[T](Protocol): def meth(self) -> T: ... .. py:attribute:: reactant_diffusion_rate :type: float .. py:attribute:: reactant_molec_velocity :type: float .. py:function:: sccm_to_ccm(obj: basic_attrs, FR: float) -> float Convert sccm to cm3 per min. :param obj: Object with basic attributes (P in Pa, T in K). :type obj: basic_attrs :param FR: Flow rate in sccm. :type FR: float :returns: Flow rate in cm3 min-1 :rtype: float .. py:function:: ccm_to_sccm(obj: basic_attrs, FR: float) -> float Convert cm3 per min to sccm :param obj: Object with basic attributes (P in Pa, T in K). :type obj: basic_attrs :param FR: Flow rate in cm3 min-1. :type FR: float :returns: Flow rate to sccm. :rtype: float .. py:function:: sccm_to_velocity(obj: basic_attrs, FR: float, diameter: float) -> float Calculate flow velocity. :param obj: Object with basic attributes (P in Pa, T in K). :type obj: basic_attrs :param FR: Flow rate in sccm. :type FR: float :param diameter: Diameter in cm. :type diameter: float :returns: Flow velocity in cm s-1. :rtype: float .. py:function:: MR_to_molec(obj: basic_attrs, conc: float) -> float Convert mixing ratio in ppb to molecules cm-3. :param obj: Object with basic attributes (P in Pa, T in K). :type obj: basic_attrs :param conc: Mixing ratio (ppb - mol mol-1). :type conc: float :returns: Concentration in molec. cm-3. :rtype: float .. py:function:: molec_velocity(obj: basic_attrs, molar_mass: float) -> float Calculate thermal molecular velocity. Formula matched to values from Knopf et al., Anal. Chem., 2015 :param obj: Object with basic attributes (P in Pa, T in K). :type obj: basic_attrs :param molar_mass: Molar mass of the gas (g mol-1). :type molar_mass: float :returns: Thermal molecular velocity in cm s-1. :rtype: float .. py:function:: reynolds_number(obj: carrier_attrs, FR: float, diameter: float) -> float Calculate Reynolds number for a gas flowing through a cylinder. :param obj: Object with full attributes (P in Pa, T in K, carrier_dynamic_viscosity in kg m-1 s-1, carrier_density in kg m-3). :type obj: carrier_attrs :param FR: Total flow rate in sccm. :type FR: float :param diameter: Diameter of the cylinder (cm). :type diameter: float :returns: Reynolds number. :rtype: float .. py:function:: reynolds_number_irregular(obj: carrier_attrs, cross_sectional_area: float, wetted_perimeter: float, FR: float) -> float Calculate Reynolds number for a gas flowing through a cylinder. Formula 6-14 from Holman and Bhattacharyya 2011. :param obj: Object with full attributes (P in Pa, T in K, carrier_dynamic_viscosity in kg m-1 s-1, carrier_density in kg m-3). :type obj: carrier_attrs :param cross_sectional_area: Cross sectional area of the flow passage (cm2). :type cross_sectional_area: float :param wetted_perimeter: Wetted perimeter of the flow passage (cm). :type wetted_perimeter: float :param FR: Total flow rate in sccm. :type FR: float :returns: Reynolds number. :rtype: float .. py:function:: conductance(obj: carrier_attrs, diameter: float, length: float) -> float Calculate conductance through cylinder - eq. 3.17 from Moore et al., 2009. :param obj: Object with full attributes (P in Pa, T in K, carrier_dynamic_viscosity in kg m-1 s-1, carrier_density in kg m-3). :type obj: carrier_attrs :param diameter: Inner diameter (cm). :type diameter: float :param length: Length (cm). :type length: float :returns: Conductance in L s-1. :rtype: float .. py:function:: pressure_gradient(obj: basic_attrs, conductance: float, FR: float) -> float Calculate pressure gradient - eqs. 3.9 & 3.10 from Moore et al., 2009. :param obj: Object with basic attributes (P in Pa, T in K). :type obj: basic_attrs :param conductance: Conductance in L s-1. :type conductance: float :param flow_rate: Flow rate in sccm. :type flow_rate: float :returns: Pressure gradient ratio. :rtype: float .. py:function:: buoyancy_parameters(obj: carrier_attrs, delta_T: float, distance: float, Re: float) -> float Calculate buoyancy parameters. :param obj: Object with full attributes (P in Pa, T in K, carrier_dynamic_viscosity in kg m-1 s-1, carrier_density in kg m-3). :type obj: carrier_attrs :param delta_T: Temperature difference (K). :type delta_T: float :param distance: Distance over which the temperature difference is measured (cm) (typically axial or radial). :type distance: float :param Re: Reynolds number of the flow tube. :type Re: float :returns: Buoyancy parameter (>1 indicates the flow being driven by buoyancy). :rtype: float .. py:function:: length_to_laminar(diameter: float, Re: float) -> float Entrance length (cm) - length to achieve laminar profile - Bird et al., 2002, page 52. Note that the scalar term can vary depending on the source. Keyser, 1994 gives a value of 0.0565 for 99% attainment of parabolic profile while Hanson and Kosciuch, 2003 provide a value of 0.05 for 95% attainment. Using an exponential fit of the values, it seems that the 0.035 figure that Bird et al., 2002 gives is for a 85% attainment. Choose whichever value is most appropriate for your purposes. :param diameter: Diameter of the cylinder (cm). :type diameter: float :param Re: Reynolds number of the flow tube. :type Re: float :returns: Length to laminar profile (cm). :rtype: float .. py:function:: mixing_time(obj: full_attrs, diameter: float) -> float Calculate mixing time (s) - Hanson and Lovejoy, Geophys. Res. Lett., 1994. :param obj: Object with full attributes (P in Pa, T in K, reactant_diffusion_rate in cm2 s-1, carrier_dynamic_viscosity in kg m-1 s-1, carrier_density in kg m-3). :type obj: full_attrs :param diameter: Diameter of the cylinder (cm). :type diameter: float :returns: Mixing time in seconds. :rtype: float .. py:function:: N_eff_Shw(obj: full_attrs, length: float, FR: float) -> float Calculate the effective Sherwood number - eq. 11 from Knopf et al., 2015. :param obj: Object with full attributes (P in Pa, T in K, reactant_diffusion_rate in cm2 s-1, carrier_dynamic_viscosity in kg m-1 s-1, carrier_density in kg m-3). :type obj: full_attrs :param length: Length of the flow tube (cm). :type length: float :param FR: Total flow rate in cm3 min-1. :type FR: float :returns: Effective Sherwood number. :rtype: float .. py:function:: Kn(mean_free_path: float, char_length: float) -> float Calculate Knudsen number - eq. 8 from Knopf et al., 2015. :param mean_free_path: Mean free path of the reactant (cm). :type mean_free_path: float :param char_length: Characteristic length: diameter of cylinder for a coated wall reactor (cm). :type char_length: float :returns: Knudsen number. :rtype: float