flowtube.flow_calc

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

basic_attrs

Base class for protocol classes.

carrier_attrs

Base class for protocol classes.

full_attrs

Base class for protocol classes.

Functions

sccm_to_ccm(→ float)

Convert sccm to cm3 per min.

ccm_to_sccm(→ float)

Convert cm3 per min to sccm

sccm_to_velocity(→ float)

Calculate flow velocity.

MR_to_molec(→ float)

Convert mixing ratio in ppb to molecules cm-3.

molec_velocity(→ float)

Calculate thermal molecular velocity. Formula matched to values from

reynolds_number(→ float)

Calculate Reynolds number for a gas flowing through a cylinder.

reynolds_number_irregular(→ float)

Calculate Reynolds number for a gas flowing through a cylinder.

conductance(→ float)

Calculate conductance through cylinder - eq. 3.17 from Moore et al.,

pressure_gradient(→ float)

Calculate pressure gradient - eqs. 3.9 & 3.10 from Moore et al.,

buoyancy_parameters(→ float)

Calculate buoyancy parameters.

length_to_laminar(→ float)

Entrance length (cm) - length to achieve laminar profile - Bird et

mixing_time(→ float)

Calculate mixing time (s) - Hanson and Lovejoy, Geophys. Res. Lett.,

N_eff_Shw(→ float)

Calculate the effective Sherwood number - eq. 11 from Knopf et al.,

Kn(→ float)

Calculate Knudsen number - eq. 8 from Knopf et al., 2015.

Module Contents

class flowtube.flow_calc.basic_attrs[source]

Bases: 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:
        ...
P: float[source]
T: float[source]
class flowtube.flow_calc.carrier_attrs[source]

Bases: basic_attrs, 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:
        ...
carrier_dynamic_viscosity: float[source]
carrier_density: float[source]
class flowtube.flow_calc.full_attrs[source]

Bases: carrier_attrs, 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:
        ...
reactant_diffusion_rate: float[source]
reactant_molec_velocity: float[source]
flowtube.flow_calc.sccm_to_ccm(obj: basic_attrs, FR: float) float[source]

Convert sccm to cm3 per min.

Parameters:
  • obj (basic_attrs) – Object with basic attributes (P in Pa, T in K).

  • FR (float) – Flow rate in sccm.

Returns:

Flow rate in cm3 min-1

Return type:

float

flowtube.flow_calc.ccm_to_sccm(obj: basic_attrs, FR: float) float[source]

Convert cm3 per min to sccm

Parameters:
  • obj (basic_attrs) – Object with basic attributes (P in Pa, T in K).

  • FR (float) – Flow rate in cm3 min-1.

Returns:

Flow rate to sccm.

Return type:

float

flowtube.flow_calc.sccm_to_velocity(obj: basic_attrs, FR: float, diameter: float) float[source]

Calculate flow velocity.

Parameters:
  • obj (basic_attrs) – Object with basic attributes (P in Pa, T in K).

  • FR (float) – Flow rate in sccm.

  • diameter (float) – Diameter in cm.

Returns:

Flow velocity in cm s-1.

Return type:

float

flowtube.flow_calc.MR_to_molec(obj: basic_attrs, conc: float) float[source]

Convert mixing ratio in ppb to molecules cm-3.

Parameters:
  • obj (basic_attrs) – Object with basic attributes (P in Pa, T in K).

  • conc (float) – Mixing ratio (ppb - mol mol-1).

Returns:

Concentration in molec. cm-3.

Return type:

float

flowtube.flow_calc.molec_velocity(obj: basic_attrs, molar_mass: float) float[source]

Calculate thermal molecular velocity. Formula matched to values from Knopf et al., Anal. Chem., 2015

Parameters:
  • obj (basic_attrs) – Object with basic attributes (P in Pa, T in K).

  • molar_mass (float) – Molar mass of the gas (g mol-1).

Returns:

Thermal molecular velocity in cm s-1.

Return type:

float

flowtube.flow_calc.reynolds_number(obj: carrier_attrs, FR: float, diameter: float) float[source]

Calculate Reynolds number for a gas flowing through a cylinder.

Parameters:
  • obj (carrier_attrs) – 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).

  • FR (float) – Total flow rate in sccm.

  • diameter (float) – Diameter of the cylinder (cm).

Returns:

Reynolds number.

Return type:

float

flowtube.flow_calc.reynolds_number_irregular(obj: carrier_attrs, cross_sectional_area: float, wetted_perimeter: float, FR: float) float[source]

Calculate Reynolds number for a gas flowing through a cylinder. Formula 6-14 from Holman and Bhattacharyya 2011.

Parameters:
  • obj (carrier_attrs) – 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).

  • cross_sectional_area (float) – Cross sectional area of the flow passage (cm2).

  • wetted_perimeter (float) – Wetted perimeter of the flow passage (cm).

  • FR (float) – Total flow rate in sccm.

Returns:

Reynolds number.

Return type:

float

flowtube.flow_calc.conductance(obj: carrier_attrs, diameter: float, length: float) float[source]

Calculate conductance through cylinder - eq. 3.17 from Moore et al., 2009.

Parameters:
  • obj (carrier_attrs) – 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).

  • diameter (float) – Inner diameter (cm).

  • length (float) – Length (cm).

Returns:

Conductance in L s-1.

Return type:

float

flowtube.flow_calc.pressure_gradient(obj: basic_attrs, conductance: float, FR: float) float[source]

Calculate pressure gradient - eqs. 3.9 & 3.10 from Moore et al., 2009.

Parameters:
  • obj (basic_attrs) – Object with basic attributes (P in Pa, T in K).

  • conductance (float) – Conductance in L s-1.

  • flow_rate (float) – Flow rate in sccm.

Returns:

Pressure gradient ratio.

Return type:

float

flowtube.flow_calc.buoyancy_parameters(obj: carrier_attrs, delta_T: float, distance: float, Re: float) float[source]

Calculate buoyancy parameters.

Parameters:
  • obj (carrier_attrs) – 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).

  • delta_T (float) – Temperature difference (K).

  • distance (float) – Distance over which the temperature difference is measured (cm) (typically axial or radial).

  • Re (float) – Reynolds number of the flow tube.

Returns:

Buoyancy parameter (>1 indicates the flow being driven by

buoyancy).

Return type:

float

flowtube.flow_calc.length_to_laminar(diameter: float, Re: float) float[source]

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.

Parameters:
  • diameter (float) – Diameter of the cylinder (cm).

  • Re (float) – Reynolds number of the flow tube.

Returns:

Length to laminar profile (cm).

Return type:

float

flowtube.flow_calc.mixing_time(obj: full_attrs, diameter: float) float[source]

Calculate mixing time (s) - Hanson and Lovejoy, Geophys. Res. Lett., 1994.

Parameters:
  • obj (full_attrs) – 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).

  • diameter (float) – Diameter of the cylinder (cm).

Returns:

Mixing time in seconds.

Return type:

float

flowtube.flow_calc.N_eff_Shw(obj: full_attrs, length: float, FR: float) float[source]

Calculate the effective Sherwood number - eq. 11 from Knopf et al., 2015.

Parameters:
  • obj (full_attrs) – 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).

  • length (float) – Length of the flow tube (cm).

  • FR (float) – Total flow rate in cm3 min-1.

Returns:

Effective Sherwood number.

Return type:

float

flowtube.flow_calc.Kn(mean_free_path: float, char_length: float) float[source]

Calculate Knudsen number - eq. 8 from Knopf et al., 2015.

Parameters:
  • mean_free_path (float) – Mean free path of the reactant (cm).

  • char_length (float) – Characteristic length: diameter of cylinder for a coated wall reactor (cm).

Returns:

Knudsen number.

Return type:

float