Beispiel #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)
Beispiel #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])
Beispiel #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])
Beispiel #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
Beispiel #5
0
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

# compute total condtions
# thr.T0, thr.P0 = f.relative_temperature_pressure(thr.T, thr.P, thr.vel.M, gamma)
# thr.T0 = thr.T*(1+(gamma-1)/2*thr.vel.M**2)
# thr.P0 = thr.P*(1+(gamma-1)/2*thr.vel.M**2)**(gamma/(gamma-1))

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

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)
Beispiel #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
Beispiel #7
0
V3u = W3u + U3
V3u_euler = -DeltaH_prod / U2 + V2u

# assume axial speed constant
V3x = W3x
V3 = f.mag(V3x, V3u)  # = np.sqrt(V3x**2 + V3u**2)
alpha3 = np.arctan(V3u / V3x)
Mach3c = V3 / a3
DeltaH_T1 = U3 * (V2u - V3u)  # euler formulation

# compute total condtions
# T03, P03 = f.relative_temperature_pressure(T3, P3, Mach3, gamma)
# T03 = T3*(1+(gamma-1)/2*Mach3**2)
# P03 = P3*(1+(gamma-1)/2*Mach3**2)**(gamma/(gamma-1))

T03, P03 = f.total_conditions(T3, V3, P3, cp, gamma)

DeltaH_T2 = cp * (T01 - T03)

# blade geometry at 2
R2tip, R2hub, h2, R2mean, D2mean, A2 = f.blade_geometry(mdot, rho2, V2x, RHT)

# rotational velocity
Omega2 = U2 / R2mean
RPM = f.RPM(Omega2)

# massflow and characteristics at inlet
rho01 = f.static_density(P01, T01, R)  # = P01/T01/R
rho1 = f.rhox_converge(0.9999 * rho01, rho01, T01, mdot, A2, gamma,
                       cp)  # iteraciones hasta converger
V1 = np.sqrt(2 * cp * T01 * (1 - (rho1 / rho01)**(gamma - 1)))