flowtube.viscosity_density ========================== .. py:module:: flowtube.viscosity_density .. autoapi-nested-parse:: Handles the calculation of the viscosity and density of a variety of pure gases. Citations “A8: Van Der Waal’s Constants for Real Gases.” Chemistry LibreTexts, November 14, 2024. Accessed August 6, 2025. https://chem.libretexts.org/Ancillary_Materials/Reference/Reference_Tables/Atomic_and_Molecular_Properties/A8%3A_van_der_Waal’s_Constants_for_Real_Gases. “NIST Chemistry Webbook, SRD 69.” Thermophysical Properties of Fluid Systems. Accessed August 6, 2025. https://webbook.nist.gov/chemistry/fluid/. Reid, R.C., Prausnitz, J.M., Poling, B.E., 1987. The Properties of Gases and Liquids, 4th ed. McGraw-Hill, New York. Attributes ---------- .. autoapisummary:: flowtube.viscosity_density.a flowtube.viscosity_density.b flowtube.viscosity_density.T_c flowtube.viscosity_density.P_c flowtube.viscosity_density.mu Classes ------- .. autoapisummary:: flowtube.viscosity_density.basic_attrs Functions --------- .. autoapisummary:: flowtube.viscosity_density.real_density flowtube.viscosity_density.dynamic_viscosity 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:data:: a .. py:data:: b .. py:data:: T_c .. py:data:: P_c .. py:data:: mu .. py:function:: real_density(obj: basic_attrs, gas: str) -> float Calculates the real density of a gas using van der Waal's equation of state. :param obj: Object with basic attributes (P in Pa, T in K). :type obj: basic_attrs :param gas: Molecular formula of gas (supported: Ar, He, N2, O2). :type gas: str :returns: Real density of gas in kg m-3. :rtype: float .. py:function:: dynamic_viscosity(obj: basic_attrs, gas: str) -> float Estimate absolute/dynamic viscosity of pure gases using the corresponding states method from Reid et al., 1987. :param obj: Object with basic attributes (P in Pa, T in K). :type obj: basic_attrs :param gas: Molecular formula of gas (supported: Ar, He, N2, O2). :type gas: str :returns: Gas viscosity (kg m-1 s-1). :rtype: float