CompAero/FannoFlowRelations.py
def calc_mach_from_4FLSt_D(
        f4lSt_d: float, gamma: float, flowType: FlowState = FlowState.SUPER_SONIC
    ) -> float:
        """ Calculates the mach number from the friction parameter

        Args:
            f4lSt_d (float): friction parameter 4FL*/D
            gamma (float): ratio of specific heats
            flowType (FlowState, optional):  Type of flow whether it is super sonic of subsonic. Defaults to FlowState.SUPER_SONIC.

        Raises:
            ValueError: Raised if Flow State is not supersonic of subsonic  

        Returns:
            float: mach number
        """
        if f4lSt_d == 0.0:
            return 1
        elif flowType == FlowState.SUPER_SONIC:
            return brenth(FannoFlowRelations.calc_4FLSt_D, 1.00001, 50, args=(gamma, f4lSt_d,),)
        elif flowType == FlowState.SUB_SONIC:
            return brenth(FannoFlowRelations.calc_4FLSt_D, 1e-5, 0.9999, args=(gamma, f4lSt_d,),)
        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 from the friction parameter

        Args:
            f4lSt_d (float): friction parameter 4FL*/D
            gamma (float): ratio of specific heats
            flowType (FlowState, optional):  Type of flow whether it is super sonic of subsonic. Defaults to FlowState.SUPER_SONIC.

        Raises:
            ValueError: Raised if Flow State is not supersonic of subsonic  

        Returns:
            float: mach number
        
Calculates the mach number from the friction parameter
Calculates the mach number from the friction parameter
def calc_mach_from_4FLSt_D(
        f4lSt_d: float, gamma: float, flowType: FlowState = FlowState.SUPER_SONIC
    ) -> float:
        if f4lSt_d == 0.0:
            return 1
        elif flowType == FlowState.SUPER_SONIC:
            return brenth(FannoFlowRelations.calc_4FLSt_D, 1.00001, 50, args=(gamma, f4lSt_d,),)
        elif flowType == FlowState.SUB_SONIC:
            return brenth(FannoFlowRelations.calc_4FLSt_D, 1e-5, 0.9999, args=(gamma, f4lSt_d,),)
        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_4FLSt_D ( f4lSt_d : float , gamma : float , flowType : FlowState = FlowState . SUPER_SONIC ) -> float : if f4lSt_d == 0.0 : return 1 elif flowType == FlowState . SUPER_SONIC : return brenth ( FannoFlowRelations . calc_4FLSt_D , 1.00001 , 50 , args = ( gamma , f4lSt_d , ) , ) elif flowType == FlowState . SUB_SONIC : return brenth ( FannoFlowRelations . calc_4FLSt_D , 1e-5 , 0.9999 , args = ( gamma , f4lSt_d , ) , ) 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 from the friction parameter
Calculates the mach number from the friction parameter
""" Calculates the mach number from the friction parameter

        Args:
            f4lSt_d (float): friction parameter 4FL*/D
            gamma (float): ratio of specific heats
            flowType (FlowState, optional):  Type of flow whether it is super sonic of subsonic. Defaults to FlowState.SUPER_SONIC.

        Raises:
            ValueError: Raised if Flow State is not supersonic of subsonic  

        Returns:
            float: mach number
        """
None
float
Raised if Flow State is not supersonic of subsonic
Raised if Flow State is not supersonic of subsonic
ValueError
f4lSt_d
float
friction parameter 4FL*/D
friction parameter 4FL * / D
gamma
float
ratio of specific heats
ratio of specific heats
flowType
FlowState
Type of flow whether it is super sonic of subsonic. Defaults to FlowState.SUPER_SONIC.
Type of flow whether it is super sonic of subsonic . Defaults to FlowState . SUPER_SONIC .
FlowState.SUPER_SONIC