예제 #1
0
def solve_geometry(RHT, one, two, thr, mdot, R, gamma, cp):

    # def f_geometry(geometry, one, two, thr, mdot, R, gamma, cp):


    # blade geometry at 2
    f.blade_geometry(mdot, two.rho, two.vel.Vx, RHT, two)

    # rotational velocity
    two.vel.Omega = two.vel.U/two.geo.Rm
    two.vel.RPM = f.RPM(two.vel.Omega)

    # massflow and characteristics at inlet
    one.rho0 = f.static_density(one.P0, one.T0, R)                                  # = one.P0/one.T0/R
    one.rho, one.vel.V, one.geo.A = solve_rhox(0.9999*one.rho0, one.rho0, one.T0, mdot,  two.geo.A, gamma, cp)  # iteraciones hasta converger
    one.vel.Vx = one.vel.V
    one.T = one.T0 - one.vel.V**2/2/cp
    one.P = f.T2P(one.P0, one.T, one.T0, gamma)                     # = one.P0*(one.T/one.T0)**(gamma/(gamma-1)) # isentropic
    one.vel.a, one.vel.M = f.sonic(gamma, R, one.T, one.vel.V)

    # blade geometry at 1
    f.blade_geometry(mdot, one.rho, one.vel.V, RHT, one)

    # blade geometry at 3
    # what
    thr.geo.A = mdot/thr.vel.Vx/thr.rho
    thr.geo.h = thr.geo.A/np.pi/2/two.geo.Rm
    thr.geo.Rt = two.geo.Rm+thr.geo.h/2
    thr.geo.Dm = thr.geo.Rt*2 - thr.geo.h
    thr.geo.Rm = thr.geo.Dm/2

    thr.vel.Omega = thr.vel.U/thr.geo.Rm
    thr.vel.RPM = f.RPM(thr.vel.Omega)
예제 #2
0
파일: main.py 프로젝트: alosola/tfg
DeltaH_T2 = cp*(one.T0-thr.T0)






# blade geometry at 2
two.geo.Rt, two.geo.Rh, two.geo.h, two.geo.Rm, two.geo.Dm, A2 = f.blade_geometry(mdot, two.rho, two.vel.Vx, RHT)

# rotational velocity
two.vel.Omega = two.vel.U/two.geo.Rm
two.vel.RPM = f.RPM(two.vel.Omega)

# massflow and characteristics at inlet
one.rho0 = f.static_density(one.P0, one.T0, R)                                  # = one.P0/one.T0/R
one.rho = solve_rhox(0.9999*one.rho0, one.rho0, one.T0, mdot, A2, gamma, cp)  # iteraciones hasta converger
one.vel.V = np.sqrt(2*cp*one.T0*(1-(one.rho/one.rho0)**(gamma-1)))
one.T = one.T0 - one.vel.V**2/2/cp
one.P = f.T2P(one.P0, one.T, one.T0, gamma)                     # = one.P0*(one.T/one.T0)**(gamma/(gamma-1)) # isentropic
one.vel.a, one.vel.M = f.sonic(gamma, R, one.T, one.vel.V)
one.geo.A = mdot/one.rho/one.vel.V

# blade geometry at 1
one.geo.Rt, one.geo.Rh, one.geo.h, one.geo.Rm, one.geo.Dm, one.geo.A = f.blade_geometry(mdot, one.rho, one.vel.V, RHT)

# blade geometry at 3
########## NO ENTIENDO NADAAAAA
thr.geo.A = mdot/thr.vel.Vx/thr.rho
thr.geo.h = thr.geo.A/np.pi/2/two.geo.Rm
thr.geo.Rt = two.geo.Rm+thr.geo.h/2
예제 #3
0
    def f_mach3(Mach3, one, two, thr, stator, rotor, gamma, cp, R, GR, phi,
                DeltaH_prod, bounds_angles):

        thr.vel.M = Mach3

        # using mach, find static pressure
        thr.P = f.static_pressure(
            thr.P0, gamma, thr.vel.M
        )  # = thr.P0/(1+(gamma-1)/2*thr.vel.M**2)**(gamma/(gamma-1))
        thr.Ts = f.P2T(thr.T0, thr.P, thr.P0,
                       gamma)  # = thr.T0*(thr.P/thr.P0)**((gamma-1)/gamma)

        # find intermediate static pressure
        two.P = one.P0 * ((GR - 1) * (1 - (thr.P / one.P0)**(
            (gamma - 1) / gamma)) + 1)**(gamma /
                                         (gamma - 1))  # GP rp definition
        ### where does that definition come from? doublecheck GR definition

        # isentropic evolution in stator: absolute total temperature is same
        two.T0 = one.T0
        two.Ts = f.P2T(one.T0, two.P, one.P0,
                       gamma)  # =  one.T0*(two.P/one.P0)**((gamma-1)/gamma)
        two.vel.Vs = f.isen_velocity(
            cp, two.T0, two.Ts)  # = np.sqrt(2*cp*(two.T0 - two.Ts))

        # assume rotor efficiency
        two.T = f.stage_efficiency(
            stator.eta, two.T0,
            two.Ts)  # = two.T0 - stator.eta*(two.T0-two.Ts)
        two.vel.V = f.isen_velocity(cp, two.T0,
                                    two.T)  # = np.sqrt(2*cp*(two.T0 - two.T))

        # density (from static quantities)
        two.rho = f.static_density(two.P, two.T, R)  # = two.P/two.T/R

        # speed of sound and Mach
        two.vel.a, two.vel.M = f.sonic(
            gamma, R, two.T,
            two.vel.V)  # = np.sqrt(gamma*R*two.T),    = two.vel.V/two.vel.a

        # get initial guess for angles
        angles_init = np.array([two.alpha, thr.beta])

        angles = solve_angles(angles_init, one, two, thr, stator, rotor, gamma,
                              cp, R, GR, phi, DeltaH_prod, bounds_angles)

        two.alpha = angles[0]
        thr.beta = angles[1]

        two.vel.Vx, two.vel.Vu = f.velocity_projections(two.vel.V, two.alpha)

        # assume a loading factor and calculate peripheral speed
        two.vel.U = np.sqrt(DeltaH_prod / phi)

        # velocity triangle (pithagoras)
        two.vel.Wu = two.vel.Vu - two.vel.U
        two.vel.Wx = two.vel.Vx
        two.vel.W = f.mag(two.vel.Wu, two.vel.Wx)

        # relative inlet angle and relative Mach number
        two.vel.Mr = two.vel.W / two.vel.a

        # relative total quantities at rotor inlet
        two.T0r, two.P0r = f.relative_temperature_pressure(
            two.T, two.P, two.vel.Mr, gamma)

        ############ ROTOR #############
        # in the rotor, the relative total temperature is constant (se conservan rotalpías)
        thr.T0r = two.T0r

        # ideal outlet temperature, real outlet temperature
        # assuming the expanse to thr.P, calculated with the assumed M3
        thr.Ts = f.P2T(thr.T0r, thr.P, two.P0r,
                       gamma)  # = thr.T0r*(thr.P/two.P0r)**((gamma-1)/gamma)
        thr.T = f.stage_efficiency(
            rotor.eta, thr.T0r,
            thr.Ts)  # = thr.T0r - rotor.eta*(thr.T0r - thr.Ts)

        # velocities
        thr.vel.W = f.isen_velocity(cp, thr.T0r,
                                    thr.T)  # = np.sqrt(2*cp*(thr.T0r - thr.T))

        # speed of sound and relative mach number
        thr.vel.a, thr.vel.Mr = f.sonic(gamma, R, thr.T,
                                        thr.vel.W)  # = np.sqrt(gamma*R*thr.T)

        # velocity projections, axial and tangential
        thr.vel.Wx, thr.vel.Wu = f.velocity_projections(thr.vel.W, thr.beta)

        # constant radius, constant peripheral speed
        thr.vel.U = two.vel.U

        # tangential outlet speed
        thr.vel.Vu = thr.vel.Wu + thr.vel.U
        # V3u_euler = -DeltaH_prod/two.vel.U + two.vel.Vu

        # assume axial speed constant
        thr.vel.Vx = thr.vel.Wx
        thr.vel.V = f.mag(
            thr.vel.Vx, thr.vel.Vu)  # = np.sqrt(thr.vel.Vx**2 + thr.vel.Vu**2)

        Mach3_calculated = thr.vel.V / thr.vel.a

        return Mach3_calculated - Mach3
예제 #4
0
P2 = GR*(P01-P3)+P3 # Siverding rp definition
P2 = P01*((GR-1)*(1-(P3/P01)**((gamma-1)/gamma) ) +1)**(gamma/(gamma-1))  # GP rp definition
### where does that definition come from? doublecheck GR definition

# isentropic evolution in stator: absolute total temperature is same
T02 = T01
T2s = f.P2T(T01, P2, P01, gamma)             # =  T01*(P2/P01)**((gamma-1)/gamma)
V2s = f.isen_velocity(cp, T02, T2s)          # = np.sqrt(2*cp*(T02 - T2s))

# assume rotor efficiency
T2 = f.stage_efficiency(eta_stator, T02, T2s)    # = T02 - eta_stator*(T02-T2s)
V2 = f.isen_velocity(cp, T02, T2)                # = np.sqrt(2*cp*(T02 - T2))


# density (from static quantities)
rho2 = f.static_density(P2,T2,R)                 # = P2/T2/R

# speed of sound and Mach
a2, Mach2 = f.sonic(gamma, R, T2, V2)            # = np.sqrt(gamma*R*T2),    = V2/a2

# check if pressure calculated meets the restriction
T02b = T2+V2**2/2/cp
### include this in the check loop

P02 = f.T2P(P2, T02, T2, gamma)                  # = P2*(T02/T2)**(gamma/(gamma-1))

# stator kinetic loss coefficient   # check loss inpose ??? ###   # Total pressure loss   # stator pressure loss coefficient, Total pressure loss down 02
xi_stator, loss_stator, tpl_stator, omega_stator = f.losses(V2, V2s, P01, P02, P2)
# = (V2s**2 - V2**2)/V2s**2,   = V2**2/V2s**2,    = (P01 - P02)/(P01 - P2),     = (P01 - P02)/(P02 - P2)
### equation for xi is different in report and excel sheet (corregir)
예제 #5
0
def converge_mach3(one, two, thr, stator, rotor, gamma, cp, R, GR, psi,
                   DeltaH_prod):
    def f_mach3(Mach3, one, two, thr, stator, rotor, gamma, cp, R, GR, psi,
                DeltaH_prod):

        thr.vel.M = Mach3

        # using mach, find static pressure
        thr.P = f.static_pressure(
            thr.P0, gamma, thr.vel.M
        )  # = thr.P0/(1+(gamma-1)/2*thr.vel.M**2)**(gamma/(gamma-1))
        thr.Ts = f.P2T(thr.T0, thr.P, thr.P0,
                       gamma)  # = thr.T0*(thr.P/thr.P0)**((gamma-1)/gamma)

        # find intermediate static pressure
        two.P = one.P0 * ((GR - 1) * (1 - (thr.P / one.P0)**(
            (gamma - 1) / gamma)) + 1)**(gamma /
                                         (gamma - 1))  # GP rp definition
        ### where does that definition come from? doublecheck GR definition

        # isentropic evolution in stator: absolute total temperature is same
        two.T0 = one.T0
        two.Ts = f.P2T(one.T0, two.P, one.P0,
                       gamma)  # =  one.T0*(two.P/one.P0)**((gamma-1)/gamma)
        two.vel.Vs = f.isen_velocity(
            cp, two.T0, two.Ts)  # = np.sqrt(2*cp*(two.T0 - two.Ts))

        # assume rotor efficiency
        two.T = f.stage_efficiency(
            stator.eta, two.T0,
            two.Ts)  # = two.T0 - stator.eta*(two.T0-two.Ts)
        two.vel.V = f.isen_velocity(cp, two.T0,
                                    two.T)  # = np.sqrt(2*cp*(two.T0 - two.T))

        # density (from static quantities)
        two.rho = f.static_density(two.P, two.T, R)  # = two.P/two.T/R

        # speed of sound and Mach
        two.vel.a, two.vel.M = f.sonic(
            gamma, R, two.T,
            two.vel.V)  # = np.sqrt(gamma*R*two.T),    = two.vel.V/two.vel.a

        ## ANGLE CONVERGENCE FOR ALPHA2 AND BETA3
        solve_angles(one, two, thr, stator, rotor, gamma, cp, R, GR, psi,
                     DeltaH_prod)

        two.vel.Vx, two.vel.Vu = f.velocity_projections(two.vel.V, two.alpha)

        # assume a loading factor and calculate peripheral speed
        two.vel.U = np.sqrt(DeltaH_prod / psi)

        # velocity triangle (pithagoras)
        two.vel.Wu = two.vel.Vu - two.vel.U
        two.vel.Wx = two.vel.Vx
        two.vel.W = f.mag(two.vel.Wu, two.vel.Wx)

        # relative inlet angle and relative Mach number
        two.vel.Mr = two.vel.W / two.vel.a

        # relative total quantities at rotor inlet
        two.T0r, two.P0r = f.relative_temperature_pressure(
            two.T, two.P, two.vel.Mr, gamma)

        ############ ROTOR #############
        # in the rotor, the relative total temperature is constant (se conservan rotalpías)
        thr.T0r = two.T0r

        # ideal outlet temperature, real outlet temperature
        # assuming the expanse to thr.P, calculated with the assumed M3
        thr.Ts = f.P2T(thr.T0r, thr.P, two.P0r,
                       gamma)  # = thr.T0r*(thr.P/two.P0r)**((gamma-1)/gamma)
        thr.T = f.stage_efficiency(
            rotor.eta, thr.T0r,
            thr.Ts)  # = thr.T0r - rotor.eta*(thr.T0r - thr.Ts)

        # velocities
        thr.vel.W = f.isen_velocity(cp, thr.T0r,
                                    thr.T)  # = np.sqrt(2*cp*(thr.T0r - thr.T))

        # speed of sound and relative mach number
        thr.vel.a, thr.vel.Mr = f.sonic(gamma, R, thr.T,
                                        thr.vel.W)  # = np.sqrt(gamma*R*thr.T)

        # velocity projections, axial and tangential
        thr.vel.Wx, thr.vel.Wu = f.velocity_projections(thr.vel.W, thr.beta)

        # constant radius, constant peripheral speed
        thr.vel.U = two.vel.U

        # tangential outlet speed
        thr.vel.Vu = thr.vel.Wu + thr.vel.U
        # V3u_euler = -DeltaH_prod/two.vel.U + two.vel.Vu

        # assume axial speed constant
        thr.vel.Vx = thr.vel.Wx
        thr.vel.V = f.mag(
            thr.vel.Vx, thr.vel.Vu)  # = np.sqrt(thr.vel.Vx**2 + thr.vel.Vu**2)

        Mach3_calculated = thr.vel.V / thr.vel.a

        return Mach3_calculated - Mach3

    thr.vel.M = fsolve(f_mach3,
                       thr.vel.M,
                       args=(one, two, thr, stator, rotor, gamma, cp, R, GR,
                             psi, DeltaH_prod))[0]

    # speed of sound and relative mach number AT 3
    thr.vel.a, thr.vel.Mr = f.sonic(gamma, R, thr.T,
                                    thr.vel.W)  # = np.sqrt(gamma*R*thr.T)

    # using mach, find static pressure
    thr.P = f.static_pressure(
        thr.P0, gamma,
        thr.vel.M)  # = thr.P0/(1+(gamma-1)/2*thr.vel.M**2)**(gamma/(gamma-1))
    thr.Ts = f.P2T(thr.T0, thr.P, thr.P0,
                   gamma)  # = thr.T0*(thr.P/thr.P0)**((gamma-1)/gamma)

    # find intermediate static pressure
    two.P = one.P0 * ((GR - 1) * (1 - (thr.P / one.P0)**(
        (gamma - 1) / gamma)) + 1)**(gamma / (gamma - 1))  # GP rp definition

    # isentropic evolution in stator: absolute total temperature is same
    two.T0 = one.T0
    two.Ts = f.P2T(one.T0, two.P, one.P0,
                   gamma)  # =  one.T0*(two.P/one.P0)**((gamma-1)/gamma)
    two.vel.Vs = f.isen_velocity(cp, two.T0,
                                 two.Ts)  # = np.sqrt(2*cp*(two.T0 - two.Ts))

    # assume rotor efficiency
    two.T = f.stage_efficiency(stator.eta, two.T0,
                               two.Ts)  # = two.T0 - stator.eta*(two.T0-two.Ts)
    two.vel.V = f.isen_velocity(cp, two.T0,
                                two.T)  # = np.sqrt(2*cp*(two.T0 - two.T))

    # density (from static quantities)
    two.rho = f.static_density(two.P, two.T, R)  # = two.P/two.T/R

    # speed of sound and Mach
    two.vel.a, two.vel.M = f.sonic(
        gamma, R, two.T,
        two.vel.V)  # = np.sqrt(gamma*R*two.T),    = two.vel.V/two.vel.a

    two.P0 = f.T2P(two.P, two.T0, two.T,
                   gamma)  # = two.P*(two.T0/two.T)**(gamma/(gamma-1))

    # assume an two.alpha and project velocities
    two.vel.Vx, two.vel.Vu = f.velocity_projections(two.vel.V, two.alpha)

    if two.vel.Vx == 0:
        two.vel.Vx = 0.00000001

    # assume a loading factor and calculate peripheral speed
    two.vel.U = np.sqrt(DeltaH_prod / psi)

    # velocity triangle (pithagoras)
    two.vel.Wu = two.vel.Vu - two.vel.U
    two.vel.Wx = two.vel.Vx
    two.vel.W = f.mag(two.vel.Wu, two.vel.Wx)

    # relative inlet angle and relative Mach number
    two.beta = np.arctan(two.vel.Wu / two.vel.Vx)
    two.vel.Mr = two.vel.W / two.vel.a

    # relative total quantities at rotor inlet
    # (add relative speed to static conditions)
    # two.T0r = two.T*(1 + two.vel.Mr**2*(gamma-1)/2)              # total temperature is conserved
    # two.P0r = two.P*(1 + (gamma-1)/2*two.vel.Mr**2)**(gamma/(gamma-1))
    two.T0r, two.P0r = f.relative_temperature_pressure(two.T, two.P,
                                                       two.vel.Mr, gamma)

    ############ ROTOR #############
    # in the rotor, the relative total temperature is constant (se conservan rotalpías)
    thr.T0r = two.T0r

    # ideal outlet temperature, real outlet temperature
    # assuming the expanse to thr.P, calculated with the assumed M3
    thr.Ts = f.P2T(thr.T0r, thr.P, two.P0r,
                   gamma)  # = thr.T0r*(thr.P/two.P0r)**((gamma-1)/gamma)
    thr.T = f.stage_efficiency(
        rotor.eta, thr.T0r, thr.Ts)  # = thr.T0r - rotor.eta*(thr.T0r - thr.Ts)

    # velocities
    thr.vel.W = f.isen_velocity(cp, thr.T0r,
                                thr.T)  # = np.sqrt(2*cp*(thr.T0r - thr.T))
    thr.vel.Ws = f.isen_velocity(cp, thr.T0r,
                                 thr.Ts)  # = np.sqrt(2*cp*(thr.T0r - thr.Ts))

    # density
    thr.rho = f.static_density(thr.P, thr.T, R)  # = thr.P/thr.T/R

    # speed of sound and relative mach number
    thr.vel.a, thr.vel.Mr = f.sonic(gamma, R, thr.T,
                                    thr.vel.W)  # = np.sqrt(gamma*R*thr.T)

    # total absolute pressure
    thr.P0r = f.T2P(thr.P, thr.T0r, thr.T,
                    gamma)  # = thr.P*(thr.T0r/thr.T)**(gamma/(gamma-1))

    # assume a value for thr.beta

    # velocity projections, axial and tangential
    thr.vel.Wx, thr.vel.Wu = f.velocity_projections(thr.vel.W, thr.beta)

    # constant radius, constant peripheral speed
    thr.vel.U = two.vel.U

    # tangential outlet speed
    thr.vel.Vu = thr.vel.Wu + thr.vel.U
    # V3u_euler = -DeltaH_prod/two.vel.U + two.vel.Vu

    # assume axial speed constant
    thr.vel.Vx = thr.vel.Wx
    thr.vel.V = f.mag(thr.vel.Vx,
                      thr.vel.Vu)  # = np.sqrt(thr.vel.Vx**2 + thr.vel.Vu**2)
    thr.alpha = np.arctan(thr.vel.Vu / thr.vel.Vx)