예제 #1
0
def no_losses(stator, rotor, one, two, thr, gamma, cp, R, GR, psi, DeltaH_prod, bounds_angles, RHT, mdot):

        # 1.
    # mach 3 converge until calculated value meets the initial guess
    # inside of this function, alpha2 and beta 3 are also set so that the DeltaH is met
    one, two, thr, stator, rotor = converge_mach3(one, two, thr, stator, rotor, gamma, cp, R, GR, psi, DeltaH_prod, bounds_angles)

    # 1.2
    # calculate loss coefficients
    stator = f.losses(two.vel.V, two.vel.Vs, one.P0, two.P0, two.P, stator)
    rotor = f.losses(thr.vel.W, thr.vel.Ws, two.P0r, thr.P0r, thr.P, rotor)

    # 1.4
    # compute total condtions
    thr.T0, thr.P0 = f.total_conditions(thr.T, thr.vel.V, thr.P, cp, gamma)


    # 2.
    # establish geometry after assuming RHT
    f.geometry(RHT, one, two, thr, mdot, R, gamma, cp)

    # 2.2
    # check limits
    pass_limits = check_limits(two, thr)

    stator.eta = (one.T0 - thr.T0)/(one.T0 - (thr.Ts+thr.vel.V**2/2/cp))
    rotor.eta = (one.T0 - thr.T0)/(one.T0 - thr.Ts)
예제 #2
0
    def f_etas(etas, stator, rotor, one, two, thr, gamma, cp, R, GR, psi,
               DeltaH_prod, bounds_angles, RHT, mdot):
        stator.eta = etas[0]
        rotor.eta = etas[1]

        # 1.
        # mach 3 converge until calculated value meets the initial guess
        # inside of this function, alpha2 and beta 3 are also set so that the DeltaH is met
        one, two, thr, stator, rotor = converge_mach3(one, two, thr, stator,
                                                      rotor, gamma, cp, R, GR,
                                                      psi, DeltaH_prod,
                                                      bounds_angles)

        # 1.2
        # calculate loss coefficients
        stator = f.losses(two.vel.V, two.vel.Vs, one.P0, two.P0, two.P, stator)
        rotor = f.losses(thr.vel.W, thr.vel.Ws, two.P0r, thr.P0r, thr.P, rotor)

        # 1.4
        # compute total condtions
        thr.T0, thr.P0 = f.total_conditions(thr.T, thr.vel.V, thr.P, cp, gamma)

        # 2.
        # establish geometry after assuming RHT
        solve_geometry(RHT, one, two, thr, mdot, R, gamma, cp)

        # efficiency calculations
        stator.eta = (one.T0 - thr.T0) / (one.T0 -
                                          (thr.Ts + thr.vel.V**2 / 2 / cp))
        rotor.eta = (one.T0 - thr.T0) / (one.T0 - thr.Ts)

        diff1 = abs(stator.eta - etas[0])
        diff2 = abs(rotor.eta - etas[1])

        return np.array([diff1, diff2])
예제 #3
0
    def f_etas(etas, stator, rotor, one, two, thr, gamma, cp, R, GR, psi,
               DeltaH_prod, bounds_angles, RHT, mdot):
        stator.eta = etas[0]
        rotor.eta = etas[1]

        # 1.
        # mach 3 converge until calculated value meets the initial guess
        # inside of this function, alpha2 and beta 3 are also set so that the DeltaH is met
        one, two, thr, stator, rotor = converge_mach3(one, two, thr, stator,
                                                      rotor, gamma, cp, R, GR,
                                                      psi, DeltaH_prod,
                                                      bounds_angles)

        # 1.2
        # calculate loss coefficients
        stator = f.losses(two.vel.V, two.vel.Vs, one.P0, two.P0, two.P, stator)
        rotor = f.losses(thr.vel.W, thr.vel.Ws, two.P0r, thr.P0r, thr.P, rotor)

        # 1.4
        # compute total condtions
        thr.T0, thr.P0 = f.total_conditions(thr.T, thr.vel.V, thr.P, cp, gamma)

        # 2.
        # establish geometry after assuming RHT
        solve_geometry(RHT, one, two, thr, mdot, R, gamma, cp)

        # efficiency calculations
        stator.eta = (one.T0 - thr.T0) / (one.T0 -
                                          (thr.Ts + thr.vel.V**2 / 2 / cp))
        rotor.eta = (one.T0 - thr.T0) / (one.T0 - thr.Ts)

        # calculate reynolds numbers
        f.reynolds(two, thr)
        f.trailing_throat(two, thr)

        # use kacker-okapuu to calculate losses in stator and rotor
        stator.omegaKC = kackerokapuu('stator', two.geo.s, abs(one.alpha),
                                      abs(two.beta), two.geo.c, two.geo.bx,
                                      two.geo.h, one.vel.M, two.vel.M, one.P,
                                      two.P, gamma, RHT, two.Re, two.geo.to)
        rotor.omegaKC = kackerokapuu('rotor', thr.geo.s, abs(two.alpha),
                                     abs(thr.beta), thr.geo.c, thr.geo.bx,
                                     thr.geo.h, two.vel.M, thr.vel.M, two.P,
                                     thr.P, gamma, RHT, thr.Re, thr.geo.to)

        diff1 = abs(stator.omega - stator.omegaKC)
        diff2 = abs(rotor.omega - rotor.omegaKC)

        print(diff1, diff2)

        return np.array([diff1, diff2])
예제 #4
0
    def f_etas(etas, stator, rotor, one, two, thr, gamma, cp, R, GR, psi,
               DeltaH_prod, bounds_angles, RHT, mdot):
        stator.eta = etas[0]
        rotor.eta = etas[1]

        # 1.
        # mach 3 converge until calculated value meets the initial guess
        # inside of this function, alpha2 and beta 3 are also set so that the DeltaH is met
        one, two, thr, stator, rotor = converge_mach3(one, two, thr, stator,
                                                      rotor, gamma, cp, R, GR,
                                                      psi, DeltaH_prod,
                                                      bounds_angles)

        # 1.2
        # calculate loss coefficients
        stator = f.losses(two.vel.V, two.vel.Vs, one.P0, two.P0, two.P, stator)
        rotor = f.losses(thr.vel.W, thr.vel.Ws, two.P0r, thr.P0r, thr.P, rotor)

        # 1.4
        # compute total condtions
        thr.T0, thr.P0 = f.total_conditions(thr.T, thr.vel.V, thr.P, cp, gamma)

        # 2.
        # establish geometry after assuming RHT
        f.geometry(RHT, one, two, thr, mdot, R, gamma, cp)

        # calculate reynolds numbers
        f.reynolds(two, thr)

        # use kacker-okapuu to calculate losses in stator and rotor
        kackerokapuu(one, two, thr, stator, rotor, gamma, RHT)

        diff1 = abs(stator.omega - stator.omegaKO)
        diff2 = abs(rotor.omega - rotor.omegaKO)

        return diff1 + diff2
예제 #5
0
파일: main.py 프로젝트: alosola/tfg
thr.beta = np.radians(-65)      # rotor angle [deg->rad]

RHT = 0.9                       # ratio hub/tip radius
mdot = 0.777482308              # total mass flow [kg/s]
one.rho = 0.98317               # inlet density [kg/m^3]
thr.geo.Rh = 0.106              # radius of hub at rotor exit [m]
one.alpha = 0                   # stator inlet angle (0 if asusmed axial) [rad]

bounds_angles = ([np.radians(70),np.radians(-65)], [np.radians(75), np.radians(-60)])

one, two, thr, stator, rotor = converge_mach3(Mach3_init, one, two, thr, stator, rotor, gamma, cp, R, GR, phi, DeltaH_prod, bounds_angles)



# 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(two.vel.V, two.vel.Vs, one.P0, two.P0, two.P)
# = (two.vel.Vs**2 - two.vel.V**2)/two.vel.Vs**2,   = two.vel.V**2/two.vel.Vs**2,    = (one.P0 - two.P0)/(one.P0 - two.P),     = (one.P0 - two.P0)/(two.P0 - two.P)
### equation for xi is different in report and excel sheet (corregir)


# rotor kinetic loss coefficient   # check loss inpose ??? ###   # Total pressure loss   # rotor pressure loss coefficient, Total pressure loss down 02
xi_rotor, loss_rotor, tpl_rotor, omega_rotor = f.losses(thr.vel.W, thr.vel.Ws, two.P0r, thr.P0r, thr.P)
# = (two.vel.Vs**2 - two.vel.V**2)/two.vel.Vs**2,   = two.vel.V**2/two.vel.Vs**2,    = (one.P0 - two.P0)/(one.P0 - two.P),     = (one.P0 - two.P0)/(two.P0 - two.P)
### equation for xi is different in report and excel sheet (corregir)
### denominator no coincide entre excel and JS report




DeltaH_T1 = thr.vel.U*(two.vel.Vu-thr.vel.Vu)    # euler formulation
예제 #6
0
def converge_efficiencies_limits(etas, stator, rotor, one, two, thr, gamma, cp, R, GR, psi, DeltaH_prod, RHT, mdot, list_lb, list_ub):

    def f_etas(etas, stator, rotor, one, two, thr, gamma, cp, R, GR, psi, DeltaH_prod, RHT, mdot):
        stator.eta = etas[0]
        rotor.eta = etas[1]
        two.alpha = etas[2]
        thr.beta = etas[3]


        # 1.
        # mach 3 converge until calculated value meets the initial guess
        # inside of this function, alpha2 and beta 3 are also set so that the DeltaH is met
        converge_mach3(one, two, thr, stator, rotor, gamma, cp, R, GR, psi, DeltaH_prod)

        # 1.2
        # calculate loss coefficients
        stator = f.losses(two.vel.V, two.vel.Vs, one.P0, two.P0, two.P, stator)
        rotor = f.losses(thr.vel.W, thr.vel.Ws, two.P0r, thr.P0r, thr.P, rotor)

        # 1.4
        # compute total condtions
        thr.T0, thr.P0 = f.total_conditions(thr.T, thr.vel.V, thr.P, cp, gamma)


        # 2.
        # establish geometry after assuming RHT
        f.geometry(RHT, one, two, thr, mdot, R, gamma, cp)

        # efficiency calculations
        stator.eta = (one.T0 - thr.T0)/(one.T0 - (thr.Ts+thr.vel.V**2/2/cp))
        rotor.eta = (one.T0 - thr.T0)/(one.T0 - thr.Ts)

        # calculate reynolds numbers
        f.reynolds(two, thr)

        # use kacker-okapuu to calculate losses in stator and rotor
        stator.omegaKC = kackerokapuu('stator', two.geo.s, abs(one.alpha), abs(two.beta), two.geo.c, two.geo.bx, two.geo.h, one.vel.M, two.vel.M, one.P, two.P, gamma, RHT, two.Re, two.geo.to)
        rotor.omegaKC  = kackerokapuu('rotor',  thr.geo.s, abs(two.alpha), abs(thr.beta), thr.geo.c, thr.geo.bx, thr.geo.h, two.vel.Mr, thr.vel.Mr, two.P, thr.P, gamma, RHT, thr.Re, thr.geo.to)

        DeltaH_calculated = two.vel.U*(two.vel.Vu - thr.vel.Vu)

        diff0 = abs(DeltaH_calculated - DeltaH_prod)
        diff1 = abs(stator.omega - stator.omegaKC)
        diff2 = abs(rotor.omega  - rotor.omegaKC)

        return np.amax(np.array([diff1, diff2, diff0]))



    # def nlc_values(etas, stator, rotor, one, two, thr, gamma, cp, R, GR, psi, DeltaH_prod, bounds_angles, RHT, mdot):
    def nlc_values(etas):

        values = np.ones((1,8))

        values[0,0] = np.degrees(abs(two.alpha - thr.alpha))
        values[0,1] = np.degrees(abs(two.beta - thr.beta))
        values[0,2] = thr.geo.A/two.geo.A
        values[0,3] = two.vel.M
        values[0,4] = two.vel.Mr
        values[0,5] = thr.vel.M
        values[0,6] = thr.vel.Mr
        values[0,7] = np.degrees(two.beta)

        arr = values.tolist()

        # arr = [np.degrees(abs(two.alpha - thr.alpha)), np.degrees(abs(two.beta - thr.beta)), thr.geo.A/two.geo.A]

        return arr[0]



    def nlc_limits():

        limits = np.ones((2,8))

        limits[0:2,0] = [0,120]        # turning alpha (alpha 2 - alpha 3)  [deg]
        limits[0:2,1] = [0,120]        # turning beta  (beta 2 - beta 3)    [deg]
        limits[0:2,2] = [1,1.36]        # height ratio  (h3 / h2)            [-]
        limits[0:2,3] = [0.85,1.2]     # absolute mach at 2                 [-]
        limits[0:2,4] = [0,0.50]        # relative mach at 2                 [-]
        limits[0:2,5] = [0,0.60]       # absolute mach at 3                 [-]
        limits[0:2,6] = [0.85,1.2]     # relative mach at 3                 [-]
        limits[0:2,7] = [45,50]        # relative rotor inlet angle beta2   [-]

        lb = limits[0,:].tolist()
        ub = limits[1,:].tolist()

        # lb = [0,0,1]
        # ub = [120, 120,1.34]

        return lb, ub


    f_etas(etas, stator, rotor, one, two, thr, gamma, cp, R, GR, psi, DeltaH_prod, RHT, mdot)

    lb, ub = nlc_limits()

    # con = lambda x: [np.degrees(abs(two.alpha - thr.alpha)), np.degrees(abs(two.beta - thr.beta)), thr.geo.A/two.geo.A, two.vel.M, two.vel.Mr, thr.vel.M, thr.vel.Mr, np.degrees(two.beta) ]


    constraints = NonlinearConstraint(nlc_values, lb, ub)

    bounds = Bounds(list_lb, list_ub)

    res = minimize(f_etas, etas, bounds=bounds, constraints=constraints, args=(stator, rotor, one, two, thr, gamma, cp, R, GR, psi, DeltaH_prod, RHT, mdot), options={'disp': True})
    etas = res.x

    stator.eta = etas[0]
    rotor.eta = etas[1]
    two.alpha = etas[2]
    thr.beta = etas[3]

    # 1.
    # mach 3 converge until calculated value meets the initial guess
    # inside of this function, alpha2 and beta 3 are also set so that the DeltaH is met
    converge_mach3(one, two, thr, stator, rotor, gamma, cp, R, GR, psi, DeltaH_prod)

    # 1.2
    # calculate loss coefficients
    stator = f.losses(two.vel.V, two.vel.Vs, one.P0, two.P0, two.P, stator)
    rotor = f.losses(thr.vel.W, thr.vel.Ws, two.P0r, thr.P0r, thr.P, rotor)

    # 1.4
    # compute total condtions
    thr.T0, thr.P0 = f.total_conditions(thr.T, thr.vel.V, thr.P, cp, gamma)


    # 2.
    # establish geometry after assuming RHT
    f.geometry(RHT, one, two, thr, mdot, R, gamma, cp)

    # 2.2
    # check limits
    lim_checks, lim_lb, lim_ub, lim_values = check_limits(two, thr)

    stator.eta = (one.T0 - thr.T0)/(one.T0 - (thr.Ts+thr.vel.V**2/2/cp))
    rotor.eta = (one.T0 - thr.T0)/(one.T0 - thr.Ts)

    return res
예제 #7
0
# use initial values to begin study
thr.vel.M = Mach3_init
two.alpha = alpha2_init
thr.beta = beta3_init

stator.eta = eta_stator_init
rotor.eta = eta_rotor_init


# mach 3 converge until calculated value meets the initial guess
# inside of this function, alpha2 and beta 3 are also set so that the DeltaH is met
one, two, thr, stator, rotor = converge_mach3(one, two, thr, stator, rotor, gamma, cp, R, GR, psi, DeltaH_prod, bounds_angles)


# loss coefficients (stator)
stator = f.losses(two.vel.V, two.vel.Vs, one.P0, two.P0, two.P, stator)

# loss coefficients (rotor)
rotor = f.losses(thr.vel.W, thr.vel.Ws, two.P0r, thr.P0r, thr.P, rotor)

# DeltaH_calculations
DeltaH_calc = thr.vel.U*(two.vel.Vu-thr.vel.Vu)    # euler formulation
DeltaH_T = cp*(one.T0-thr.T0)                      # total temperatur formulation


# compute total condtions
thr.T0, thr.P0 = f.total_conditions(thr.T, thr.vel.V, thr.P, cp, gamma)


# establish geometry after assuming RHT
converge_geometry(RHT, one, two, thr, mdot, R, gamma, cp)
예제 #8
0

# 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)

# assume an alpha2 and project velocities
V2x, V2u = f.velocity_projections(V2, alpha2)

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

# velocity triangle (pithagoras)
W2u = V2u - U2
W2x = V2x
W2 = f.mag(W2u, W2x)

# relative inlet angle and relative Mach number