CompAero/RayleighFlowRelations.py
def calc_mach_from_Po_PoStar(
        po_poSt: float, gamma: float, flowType: FlowState = FlowState.SUPER_SONIC
    ) -> float:
        """Calculates the mach number based of the ratio of total pressure to sonic total pressure P0/P0*

        Args:
            po_poSt (float): Ratio of total pressure to sonic total pressure P0/P0*
            gamma (float): ratio of specific heats
            flowType (FlowState, optional): States whether the flow is currently supersonic or subsonic. Defaults to FlowState.SUPER_SONIC.

        Returns:
            float: mach number
        """
        tolerance = 1e-5
        if po_poSt == 1.0:
            return 1
        elif flowType == FlowState.SUPER_SONIC:
            return brenth(RayleighFlowRelations.calc_Po_PoStar, 1 + tolerance, 40, args=(gamma, po_poSt,))
        elif flowType == FlowState.SUB_SONIC:
            return brenth(
                RayleighFlowRelations.calc_Po_PoStar, tolerance, 1 - tolerance, args=(gamma, po_poSt,)
            )
        else:
            raise ValueError(
                Back.RED + Fore.BLACK + "Flow Type [{}] not supported for Fanno"
                " Flow! Accepted Types: 'Supersonic' & 'Subsonic'".format(flowType.name)
                + Back.RESET
                + Fore.RESET
            )
Calculates the mach number based of the ratio of total pressure to sonic total pressure P0/P0*

        Args:
            po_poSt (float): Ratio of total pressure to sonic total pressure P0/P0*
            gamma (float): ratio of specific heats
            flowType (FlowState, optional): States whether the flow is currently supersonic or subsonic. Defaults to FlowState.SUPER_SONIC.

        Returns:
            float: mach number
        
Calculates the mach number based of the ratio of total pressure to sonic total pressure P0/P0
Calculates the mach number based of the ratio of total pressure to sonic total pressure P0 / P0
def calc_mach_from_Po_PoStar(
        po_poSt: float, gamma: float, flowType: FlowState = FlowState.SUPER_SONIC
    ) -> float:
        tolerance = 1e-5
        if po_poSt == 1.0:
            return 1
        elif flowType == FlowState.SUPER_SONIC:
            return brenth(RayleighFlowRelations.calc_Po_PoStar, 1 + tolerance, 40, args=(gamma, po_poSt,))
        elif flowType == FlowState.SUB_SONIC:
            return brenth(
                RayleighFlowRelations.calc_Po_PoStar, tolerance, 1 - tolerance, args=(gamma, po_poSt,)
            )
        else:
            raise ValueError(
                Back.RED + Fore.BLACK + "Flow Type [{}] not supported for Fanno"
                " Flow! Accepted Types: 'Supersonic' & 'Subsonic'".format(flowType.name)
                + Back.RESET
                + Fore.RESET
            )
def calc_mach_from_Po_PoStar ( po_poSt : float , gamma : float , flowType : FlowState = FlowState . SUPER_SONIC ) -> float : tolerance = 1e-5 if po_poSt == 1.0 : return 1 elif flowType == FlowState . SUPER_SONIC : return brenth ( RayleighFlowRelations . calc_Po_PoStar , 1 + tolerance , 40 , args = ( gamma , po_poSt , ) ) elif flowType == FlowState . SUB_SONIC : return brenth ( RayleighFlowRelations . calc_Po_PoStar , tolerance , 1 - tolerance , args = ( gamma , po_poSt , ) ) else : raise ValueError ( Back . RED + Fore . BLACK + "Flow Type [{}] not supported for Fanno" " Flow! Accepted Types: 'Supersonic' & 'Subsonic'" . format ( flowType . name ) + Back . RESET + Fore . RESET )
Calculates the mach number based of the ratio of total pressure to sonic total pressure P0/P0
Calculates the mach number based of the ratio of total pressure to sonic total pressure P0 / P0
"""Calculates the mach number based of the ratio of total pressure to sonic total pressure P0/P0*

        Args:
            po_poSt (float): Ratio of total pressure to sonic total pressure P0/P0*
            gamma (float): ratio of specific heats
            flowType (FlowState, optional): States whether the flow is currently supersonic or subsonic. Defaults to FlowState.SUPER_SONIC.

        Returns:
            float: mach number
        """
None
float
po_poSt
float
Ratio of total pressure to sonic total pressure P0/P0
Ratio of total pressure to sonic total pressure P0 / P0
gamma
float
ratio of specific heats
ratio of specific heats
flowType
FlowState
States whether the flow is currently supersonic or subsonic. Defaults to FlowState.SUPER_SONIC.
States whether the flow is currently supersonic or subsonic . Defaults to FlowState . SUPER_SONIC .
FlowState.SUPER_SONIC