コード例 #1
0
def temperature_from_stagnation_temperature(g, T, M):
    """  T = stagnation_temperature(g,Tt,M): compute temperature from stagnation temperature and Mach for a 1D ideal gas
    
         Inputs:    g = ratio of specific heats     (required)  (float)
                    Tt = stagnation temperature     (required)  (floats)    
                    M = Mach number                 (required)  (floats)

         Outputs:   T = absolute temperature                    (floats)

        """

    return Tt / f_of_M(g, M)
コード例 #2
0
def stagnation_temperature(g, T, M):
    """  Tt = stagnation_temperature(g,T,M): compute stagnation temperature for a 1D ideal gas
    
         Inputs:    g = ratio of specific heats     (required)  (float)
                    T = absolute temperature        (required)  (floats)    
                    M = Mach number                 (required)  (floats)

         Outputs:   Tt = stagnation temperature                 (floats)

    """

    return T * f_of_M(g, M)
def temperature_from_stagnation_temperature(g,T,M):

    """  T = stagnation_temperature(g,Tt,M): compute temperature from stagnation temperature and Mach for a 1D ideal gas
    
         Inputs:    g = ratio of specific heats     (required)  (float)
                    Tt = stagnation temperature     (required)  (floats)    
                    M = Mach number                 (required)  (floats)

         Outputs:   T = absolute temperature                    (floats)

        """

    return Tt/f_of_M(g,M)
コード例 #4
0
def stagnation_temperature(g,T,M):

    """  Tt = stagnation_temperature(g,T,M): compute stagnation temperature for a 1D ideal gas
    
         Inputs:    g = ratio of specific heats     (required)  (float)
                    T = absolute temperature        (required)  (floats)    
                    M = Mach number                 (required)  (floats)

         Outputs:   Tt = stagnation temperature                 (floats)

    """

    return T*f_of_M(g,M)
コード例 #5
0
def area_ratio_from_mach(g, M):
    """  M = mach_from_area_ratio(g,area_ratio,branch="supersonic"): get M from A/A* and gamma for a 1D ideal gas flow
    
         Inputs:    g = ratio of specific heats     (required)  (float)    
                    M = Mach number                 (required)  (float)

         Outputs:   area_ratio = A/A*                           (float)

        """

    n = (g + 1) / (2 * (g - 1))
    c = ((g + 1) / 2)**n

    return 1 / (c * M / f_of_M(g, M)**n)
コード例 #6
0
def stagnation_pressure(g, p, M):
    """  pt = stagnation_pressure(g,p,M): compute stagnation pressure for a 1D ideal gas
    
         Inputs:    g = ratio of specific heats     (required)  (float)
                    p = absolute pressure           (required)  (floats)    
                    M = Mach number                 (required)  (floats)

         Outputs:   pt = stagnation pressure                    (floats)

    """

    n = g / (g - 1)

    return p * f_of_M(g, M)**n
コード例 #7
0
def area_ratio_from_mach(g,M):

    """  M = mach_from_area_ratio(g,area_ratio,branch="supersonic"): get M from A/A* and gamma for a 1D ideal gas flow
    
         Inputs:    g = ratio of specific heats     (required)  (float)    
                    M = Mach number                 (required)  (float)

         Outputs:   area_ratio = A/A*                           (float)

        """

    n = (g+1)/(2*(g-1))
    c = ((g+1)/2)**n

    return 1/(c*M/f_of_M(g,M)**n)
コード例 #8
0
def pressure_from_stagnation_pressure(g,pt,M):

    """  p = pressure_from_stagnation_pressure(g,pt,M): compute pressure from stagnation pressure and Mach for a 1D ideal gas
    
         Inputs:    g = ratio of specific heats     (required)  (float)
                    pt = stagnation pressure        (required)  (floats)    
                    M = Mach number                 (required)  (floats)

         Outputs:   p = absolute pressure                       (floats)

        """

    n = g/(g-1)

    return pt/(f_of_M(g,M)**n)
コード例 #9
0
def stagnation_pressure(g,p,M):

    """  pt = stagnation_pressure(g,p,M): compute stagnation pressure for a 1D ideal gas
    
         Inputs:    g = ratio of specific heats     (required)  (float)
                    p = absolute pressure           (required)  (floats)    
                    M = Mach number                 (required)  (floats)

         Outputs:   pt = stagnation pressure                    (floats)

    """

    n = g/(g-1)

    return p*f_of_M(g,M)**n
コード例 #10
0
def dRdM(M, g, area_ratio, c, n):

    f = f_of_M(g, M)

    return -c * (-n * M * (g - 1) * M / (f**(n + 1)) + 1 / f**n)
コード例 #11
0
def R(M, g, area_ratio, c, n):

    return 1 / area_ratio - c * M / f_of_M(g, M)**n
コード例 #12
0
def dRdM(M,g,area_ratio,c,n):

    f = f_of_M(g,M)

    return -c*(-n*M*(g-1)*M/(f**(n+1)) + 1/f**n)
コード例 #13
0
def R(M,g,area_ratio,c,n):

    return 1/area_ratio - c*M/f_of_M(g,M)**n