def test_outlet(self): for T_stag_in in self.T_stag_in_outlet: for G_in in self.G_in_outlet: for dif in self.dif_outlet: print('T_stag_in = %.1f, G_in = %.3f, dif = %.3f' % (T_stag_in, G_in, dif)) p_stag_in = 1.2e5 work_fluid = NaturalGasCombustionProducts() G_fuel = 0.1 alpha = 1 / (work_fluid.l0 * G_fuel / (G_in - G_fuel)) c_p = work_fluid.c_p_real_func(T_stag_in, alpha=alpha) k = work_fluid.k_func(c_p) F_in = 0.25 q = G_in * np.sqrt(work_fluid.R * T_stag_in) / ( F_in * p_stag_in * gd.m(k)) lam = gd.lam(k, q=q) a_cr = gd.a_cr(T_stag_in, k, work_fluid.R) c_in = a_cr * lam outlet = OutletModel(T_stag_in=T_stag_in, p_stag_in=1.2e5, G_in=G_in, G_fuel_in=G_fuel, c_in=c_in, F_in=F_in, F_out=F_in * dif, sigma=0.99) outlet.compute() G_in = outlet.rho_in * outlet.F_in * outlet.c_in G_out = outlet.rho_out * outlet.F_out * outlet.c_out G_res = abs(G_out - G_in) / G_in self.assertAlmostEqual(G_res, 0, places=3)
def test_integrate_work_balance_power_turbine_ngas_wcool(self): """Соврадение работы, определенной на разности входной и выходной энтальпий, заданной величине.""" work_fluid = NaturalGasCombustionProducts() T_g_stag = self.power_turbine_ngas_wcool.T_g_stag T_t_stag = self.power_turbine_ngas_wcool.last.T_st_stag work_fluid.T1 = T_g_stag work_fluid.T2 = T_t_stag work_fluid.alpha = self.power_turbine_ngas_wcool.first.alpha_air_in L_t = work_fluid.c_p_av_int * (T_g_stag - T_t_stag) L_t_res = abs(L_t - self.power_turbine_ngas_wcool.L_t_cycle) / self.power_turbine_ngas_wcool.L_t_cycle self.assertAlmostEqual(L_t_res, 0, places=2)
def __init__(self, T_stag_in, p_stag_in, G_in, G_fuel_in, c_in, F_in, F_out, sigma, work_fluid: IdealGas = NaturalGasCombustionProducts()): ModelSingleWorkFluid.__init__(self) ModelStaticPar.__init__(self) self.T_stag_in = T_stag_in self.p_stag_in = p_stag_in self.G_in = G_in self.G_fuel_in = G_fuel_in self.c_in = c_in self.F_in = F_in self.F_out = F_out self.sigma = sigma self.work_fluid = work_fluid self.fuel_content = None self.alpha = None self.c_p = None self.k = None self.static_out = None
def __init__(self, T_stag_in, p_stag_in, G_in, G_fuel_in, pi_t_stag, T_stag_in_nom, p_stag_in_nom, G_in_nom, pi_t_stag_nom, eta_t_stag_nom, F_out, eta_m=0.9, work_fluid: IdealGas = NaturalGasCombustionProducts(), precision=0.001): TurbineModel.__init__(self, T_stag_in, p_stag_in, G_in, G_fuel_in, pi_t_stag, T_stag_in_nom, p_stag_in_nom, G_in_nom, pi_t_stag_nom, eta_t_stag_nom, eta_m, work_fluid, precision) self.F_out = F_out self.c_p_out = None self.k_out = None self.q_out = None self.lam_out = None self.a_cr_out = None self.c_out = None
def __init__(self, T_stag_in, p_stag_in, G_in, G_fuel_in, g_cool, G_c1_in, T_cool, cool_fluid: IdealGas = Air(), work_fluid: IdealGas = NaturalGasCombustionProducts(), precision=0.0001): ModelSingleWorkFluid.__init__(self) self.T_stag_in = T_stag_in self.p_stag_in = p_stag_in self.G_in = G_in self.G_fuel_in = G_fuel_in self.g_cool = g_cool self.G_c1_in = G_c1_in self.T_cool = T_cool self.cool_fluid = cool_fluid self.work_fluid = work_fluid self.precision = precision self.G_cool = None self.fuel_content_in = None self.fuel_content_out = None self.alpha_in = None self.alpha_out = None
def test_integrate_work_balance_comp_turbine_ngas_cool(self): """Соврадение работы, определенной на разности входной и выходной энтальпий, заданной величине.""" work_fluid = NaturalGasCombustionProducts() T_g_stag = self.comp_turbine_ngas_cool.T_g_stag T_t_stag = self.comp_turbine_ngas_cool.last.T_st_stag g_outlet = self.comp_turbine_ngas_cool.last.G_stage_in / self.comp_turbine_ngas_cool.G_turbine i_stag_in = work_fluid.get_specific_enthalpy(T_g_stag, alpha=self.comp_turbine_ngas_cool.first.alpha_air_in) i_stag_out = work_fluid.get_specific_enthalpy( T_t_stag, alpha=self.comp_turbine_ngas_cool.last.alpha_air_in ) * g_outlet i_cool = 0 for n, stage in enumerate(self.comp_turbine_ngas_cool): if n != self.comp_turbine_ngas_cool.stage_number - 1: i_cool += stage.i_cool L_t = i_stag_in - i_stag_out + i_cool L_t_res = abs(L_t - self.comp_turbine_ngas_cool.L_t_cycle) / self.comp_turbine_ngas_cool.L_t_cycle self.assertAlmostEqual(L_t_res, 0, places=3)
def compute_cycle(eta_stag_p_c=0.88, eta_stag_p_ct=9.9, eta_stag_p_pt=0.9): precision = 0.0001 atm = Atmosphere() inlet = Inlet() comp = Compressor(pi_c=17, eta_stag_p=eta_stag_p_c, precision=precision) sink = Sink(g_cooling=0, g_outflow=0.03) comb_chamber = CombustionChamber(T_gas=1523, precision=precision, alpha_out_init=2, fuel=NaturalGas(), T_fuel=320, delta_p_fuel=5e5) comp_turbine = Turbine(eta_stag_p=eta_stag_p_ct, eta_m=0.99, precision=precision) source = Source(g_return=0) power_turbine = Turbine(eta_stag_p=eta_stag_p_pt, eta_m=0.99, eta_r=0.99, precision=precision, p_stag_out_init=1e5) outlet = Outlet() load = Load(power=16e6) comp_turb_zero_load = Load(power=0) power_turb_zero_load = Load(power=0) solver = NetworkSolver(unit_arr=[ atm, inlet, comp, sink, comb_chamber, comp_turbine, source, power_turbine, outlet, load, comp_turb_zero_load, power_turb_zero_load ], relax_coef=1, precision=precision, max_iter_number=100, cold_work_fluid=Air(), hot_work_fluid=NaturalGasCombustionProducts()) solver.create_gas_dynamic_connection(atm, inlet) solver.create_gas_dynamic_connection(inlet, comp) solver.create_gas_dynamic_connection(comp, sink) solver.create_gas_dynamic_connection(sink, comb_chamber) solver.create_gas_dynamic_connection(comb_chamber, comp_turbine) solver.create_gas_dynamic_connection(comp_turbine, source) solver.create_gas_dynamic_connection(source, power_turbine) solver.create_gas_dynamic_connection(power_turbine, outlet) solver.create_static_gas_dynamic_connection(outlet, atm) solver.create_mechanical_connection(comp_turbine, comp, comp_turb_zero_load) solver.create_mechanical_connection(power_turbine, load, power_turb_zero_load) solver.solve() G_air = load.power / power_turbine.gen_labour1 G_comp_turb = G_air * comp_turbine.g_in G_power_turb = G_air * power_turbine.g_in G_fuel = G_air * comb_chamber.g_fuel_prime * comb_chamber.g_in eta_e = power_turbine.gen_labour1 / (comb_chamber.work_fluid_out.Q_n * comb_chamber.g_fuel_prime * comb_chamber.g_in) return solver, G_air, G_comp_turb, G_power_turb, G_fuel, eta_e
def test_setting_data_from_input_file(self): turbine_input = TurbineInput(TurbineType.Compressor, 1500, 12e5, 25, 1, NaturalGasCombustionProducts(), 1200, 0.91) self.form.set_data_from_turbine_input(turbine_input) self.assertEqual(self.form.turbine_type.currentIndex(), 1) self.assertEqual(self.form.fuel.currentIndex(), 1) self.assertAlmostEqual(self.form.T_g_stag.value(), turbine_input.T_g_stag, 2) self.assertAlmostEqual(self.form.p_g_stag.value(), turbine_input.p_g_stag / 1e6, places=3) self.assertAlmostEqual(self.form.G_t.value(), turbine_input.G_turbine, places=2) self.assertAlmostEqual(self.form.G_fuel.value(), turbine_input.G_fuel, places=2) self.assertAlmostEqual(self.form.T_t_stag_cycle.value(), turbine_input.T_t_stag_cycle, places=0) self.assertAlmostEqual(self.form.eta_t_stag_cycle.value(), turbine_input.eta_t_stag_cycle, places=2)
def test_separate_stages_averaging_comp_turbine_ngas_cool(self): """Равенство работы ступеней разности энатльпий на входе и на выходе ступеней.""" for i in range(len(self.comp_turbine_ngas_cool)): logging.info('Stage %s' % (i + 1)) stage = self.comp_turbine_ngas_cool[i] work_fluid_in = NaturalGasCombustionProducts() work_fluid_out = NaturalGasCombustionProducts() work_fluid_in.T = stage.T0_stag work_fluid_in.alpha = stage.alpha_air_in work_fluid_out.T = stage.T_st_stag work_fluid_out.alpha = stage.alpha_air_in enthalpy_in = work_fluid_in.c_p_av * (stage.T0_stag - work_fluid_in.T0) enthalpy_out = work_fluid_out.c_p_av * (stage.T_st_stag - work_fluid_out.T0) L_st = enthalpy_in - enthalpy_out L_res = abs(L_st - stage.L_t) / stage.L_t self.assertAlmostEqual(L_res, 0, places=3) self.assertEqual(stage.work_fluid.T2, stage.T_st_stag)
def __init__( self, T_stag_in, p_stag_in, G_in, G_fuel_in, pi_t_stag, T_stag_in_nom, p_stag_in_nom, G_in_nom, pi_t_stag_nom, eta_t_stag_nom, eta_m=0.9, work_fluid: IdealGas = NaturalGasCombustionProducts(), precision=0.001, ): ModelSingleWorkFluid.__init__(self) self.T_stag_in = T_stag_in self.p_stag_in = p_stag_in self.G_in = G_in self.G_fuel_in = G_fuel_in self.pi_t_stag = pi_t_stag self.T_stag_in_nom = T_stag_in_nom self.p_stag_in_nom = p_stag_in_nom self.G_in_nom = G_in_nom self.pi_t_stag_nom = pi_t_stag_nom self.eta_t_stag_nom = eta_t_stag_nom self.eta_m = eta_m self.work_fluid = work_fluid self.precision = precision self.pi_t_stag_rel = None self.eta_t_stag_rel = None self.eta_t_stag = None self.fuel_content = None self.alpha = None self.ad_proc_res = None self.T_stag_out_ad = None self.H_stag = None self.L = None self.G_in_char = None self.N = None
def __init__(self, g_fuel, G_c1_in, T_stag_in, p_stag_in, G_in, G_fuel_in, eta_comb, sigma_comb, T_fuel=300, fuel: Fuel = NaturalGas(), delta_p_fuel=5e5, work_fluid_in: IdealGas = Air(), work_fluid_out: IdealGas = NaturalGasCombustionProducts(), precision=0.0001): ModelMultipleWorkFluid.__init__(self) self.g_fuel = g_fuel self.G_c1_in = G_c1_in self.G_fuel_in = G_fuel_in self.G_in = G_in self.T_stag_in = T_stag_in self.p_stag_in = p_stag_in self.eta_comb = eta_comb self.sigma_comb = sigma_comb self.T_fuel = T_fuel self.fuel = fuel self.delta_p_fuel = delta_p_fuel self.work_fluid_in = work_fluid_in self.work_fluid_out = work_fluid_out self.precision = precision self.G_fuel = None self.fuel_content_out = None self.fuel_content_in = None self.alpha_in = None self.alpha_out = None self.i_stag_in = None self.i_stag_out = None self.p_fuel = None self.i_fuel = None
def compute_cycle_and_nodes( pi_c_stag=17, stage_num_arr=[int(i) for i in np.linspace(9, 15, 7)], H_t_rel1_arr=np.linspace(0.2, 0.35, 10), H_t_rel_delta=-0.06, c1_a_rel1_arr=np.linspace(0.45, 0.55, 10), c1_a_rel_delta=0.1): eta_stag_p_c = 0.87 eta_stag_p_ct = 0.89 eta_stag_p_pt = 0.89 res = 1 iter_num = 1 while res >= 0.001: print('Iter %s' % iter_num) iter_num += 1 solver, G_air, G_comp_turb, G_power_turb, G_fuel, eta_e = compute_cycle( eta_stag_p_c, eta_stag_p_ct, eta_stag_p_pt) n_ct = 11e3 n_pt = 7.8e3 inlet: Inlet = solver.get_sorted_unit_list()[1] comp_cycle: Compressor = solver.get_sorted_unit_list()[2] comp_turbine_cycle: Turbine = solver.get_sorted_unit_list()[5] power_turbine_cycle: Turbine = solver.get_sorted_unit_list()[7] sink: Sink = solver.get_sorted_unit_list()[3] comb_chamber: CombustionChamber = solver.get_sorted_unit_list()[4] outlet: Outlet = solver.get_sorted_unit_list()[8] load: Load = solver.get_sorted_unit_list()[9] comp = get_optimize_compressor(comp_cycle.p_stag_in, comp_cycle.T_stag_in, G_air, n_ct, pi_c_stag, stage_num_arr, H_t_rel1_arr, H_t_rel_delta, c1_a_rel1_arr, c1_a_rel_delta) comp_turbine = TurbAvLine(turbine_type=TurbineType.WORK, stage_number=2, T_g_stag=comp_turbine_cycle.T_stag_in, p_g_stag=comp_turbine_cycle.p_stag_in, G_turbine=G_comp_turb, G_fuel=G_fuel, work_fluid=NaturalGasCombustionProducts(), l1_D1_ratio=0.15, n=n_ct, T_t_stag_cycle=comp_turbine_cycle.T_stag_out, eta_t_stag_cycle=comp_turbine_cycle.eta_stag, alpha11=np.radians(14), precision=0.0001, eta_m=comp_turbine_cycle.eta_m, gamma_in=np.radians(0), gamma_out=np.radians(10), H01_init=200e3, c21_init=250) comp_turbine.compute_geometry() comp_turbine.compute_stages_gas_dynamics() comp_turbine.compute_integrate_turbine_parameters() power_turbine = TurbAvLine( turbine_type=TurbineType.WORK, stage_number=2, T_g_stag=power_turbine_cycle.T_stag_in, p_g_stag=power_turbine_cycle.p_stag_in, G_turbine=G_power_turb, G_fuel=G_fuel, work_fluid=NaturalGasCombustionProducts(), l1_D1_ratio=0.15, n=n_pt, eta_m=power_turbine_cycle.eta_m, T_t_stag_cycle=power_turbine_cycle.T_stag_out, eta_t_stag_cycle=power_turbine_cycle.eta_stag, alpha11=np.radians(14), precision=0.0001, gamma_in=np.radians(0), gamma_out=np.radians(15), H01_init=200e3, c21_init=250) power_turbine.compute_geometry() power_turbine.compute_stages_gas_dynamics() power_turbine.compute_integrate_turbine_parameters() eta_stag_p_c_res = abs(comp.eta_c_stag_p - eta_stag_p_c) / eta_stag_p_c eta_stag_p_ct_res = abs(comp_turbine.eta_t_stag_p - eta_stag_p_ct) / eta_stag_p_ct eta_stag_p_pt_res = abs(power_turbine.eta_t_stag_p - eta_stag_p_pt) / eta_stag_p_pt eta_stag_p_c = comp.eta_c_stag_p eta_stag_p_ct = comp_turbine.eta_t_stag_p eta_stag_p_pt = power_turbine.eta_t_stag_p res = max(eta_stag_p_c_res, eta_stag_p_pt_res, eta_stag_p_ct_res) return solver, inlet, comp, sink, comb_chamber, comp_turbine, power_turbine, outlet, load, comp_cycle
def test_setting_input_data_from_turbine(self): turbine = Turbine(turbine_type=TurbineType.Compressor, stage_number=2, T_g_stag=1450, p_g_stag=400e3, G_turbine=25, G_fuel=1, work_fluid=NaturalGasCombustionProducts(), alpha_air=2.6, l1_D1_ratio=0.20, n=15e3, T_t_stag_cycle=1050, eta_t_stag_cycle=0.91, alpha11=np.radians([17])[0], auto_set_rho=False, rho_list=[0.35, 0.45], auto_compute_heat_drop=True, H01_init=220e3, c21_init=250, gamma_in=np.radians([7])[0], gamma_out=np.radians([8])[0], precise_heat_drop=False) turbine.geom[0].l1_b_sa_ratio = 2.1 turbine.geom[0].l2_b_rk_ratio = 2.5 turbine.geom[0].delta_a_b_sa_ratio = 0.4 turbine.geom[0].delta_a_b_rk_ratio = 0.35 turbine.geom[0].p_r_out_l1_ratio = 0.045 turbine.geom[0].p_r_in_l1_ratio = 0.055 turbine.geom[0].p_a_out_rel = 0.35 turbine.geom[0].p_a_in_rel = 0.25 turbine.geom[0].delta_r_rk_l2_ratio = 0.02 turbine.geom[0].phi = 0.95 turbine.geom[0].psi = 0.95 turbine.geom[0].g_lb = 0.01 turbine.geom[0].g_ld = 0.02 turbine.geom[0].g_lk = 0.015 turbine.geom[0].g_cool = 0.07 self.form.set_input_from_turbine(turbine) self.assertEqual(turbine.stage_number, self.form.stage_number.value()) self.assertEqual(self.form.turbine_type.currentIndex(), 1) self.assertEqual(self.form.fuel.currentIndex(), 1) self.assertTrue(self.form.gamma_in_out.isChecked()) self.assertAlmostEqual(self.form.gamma1.value(), np.degrees(turbine.gamma_out), places=1) self.assertAlmostEqual(self.form.gamma2.value(), np.degrees(turbine.gamma_in), places=1) self.assertFalse(self.form.checkBox_rho_auto.isChecked()) self.assertTrue(self.form.checkBox_h0_auto.isChecked()) self.assertFalse(self.form.checkBox_precise_h0.isChecked()) self.assertAlmostEqual(self.form.H01_init.value(), turbine.H01_init / 1e3, places=1) self.assertAlmostEqual(self.form.c21.value(), turbine.c21_init, places=1) self.assertAlmostEqual(self.form.T_g_stag.value(), turbine.T_g_stag, 2) self.assertAlmostEqual(self.form.p_g_stag.value(), turbine.p_g_stag / 1e6, places=3) self.assertAlmostEqual(self.form.G_t.value(), turbine.G_turbine, places=2) self.assertAlmostEqual(self.form.G_fuel.value(), turbine.G_fuel, places=2) self.assertAlmostEqual(self.form.alpha11.value(), np.degrees(turbine.alpha11), places=1) self.assertAlmostEqual(self.form.l1_D1_ratio.value(), turbine.l1_D1_ratio, places=2) self.assertAlmostEqual(self.form.n.value(), turbine.n, places=0) self.assertAlmostEqual(self.form.T_t_stag_cycle.value(), turbine.T_t_stag_cycle, places=0) self.assertAlmostEqual(self.form.eta_t_stag_cycle.value(), turbine.eta_t_stag_cycle, places=2) for i in range(turbine.stage_number): stage_data: StageDataWidget = self.form.stackedWidget.widget(i) geom = turbine.geom[i] self.assertAlmostEqual(stage_data.l1_b_sa_ratio.value(), geom.l1_b_sa_ratio, places=2) self.assertAlmostEqual(stage_data.l2_b_rk_ratio.value(), geom.l2_b_rk_ratio, places=2) self.assertAlmostEqual(stage_data.delta_a_b_sa_ratio.value(), geom.delta_a_b_sa_ratio, places=2) self.assertAlmostEqual(stage_data.delta_a_b_rk_ratio.value(), geom.delta_a_b_rk_ratio, places=2) self.assertAlmostEqual(stage_data.p_r_out_l1_ratio.value(), geom.p_r_out_l1_ratio, places=2) self.assertAlmostEqual(stage_data.p_r_in_l1_ratio.value(), geom.p_r_in_l1_ratio, places=2) self.assertAlmostEqual(stage_data.p_a_out_rel.value(), geom.p_a_out_rel, places=2) self.assertAlmostEqual(stage_data.p_a_in_rel.value(), geom.p_a_in_rel, places=2) self.assertAlmostEqual(stage_data.delta_r_rel.value(), geom.delta_r_rk_l2_ratio, places=2) self.assertAlmostEqual(stage_data.phi.value(), geom.phi, places=2) self.assertAlmostEqual(stage_data.psi.value(), geom.psi, places=2) self.assertAlmostEqual(stage_data.g_lb.value(), geom.g_lb, places=2) self.assertAlmostEqual(stage_data.g_ld.value(), geom.g_ld, places=2) self.assertAlmostEqual(stage_data.g_lk.value(), geom.g_lk, places=2) self.assertAlmostEqual(stage_data.g_cool.value(), geom.g_cool, places=2) self.assertAlmostEqual(stage_data.T_cool.value(), geom.T_cool, places=1)
def setUp(self): self.comb_chamber = CombustionChamberModel( g_fuel=0.02, G_c1_in=30, T_stag_in=800, p_stag_in=13e5, G_in=29, G_fuel_in=0, eta_comb=0.99, sigma_comb=0.99, ) self.turbine = Turbine(turbine_type=TurbineType.WORK, stage_number=2, T_g_stag=1400, p_g_stag=15e5, G_turbine=34, G_fuel=0.9, work_fluid=NaturalGasCombustionProducts(), l1_D1_ratio=0.15, n=10e3, T_t_stag_cycle=1150, eta_t_stag_cycle=0.9, alpha11=np.radians(14), precision=0.0001, gamma_in=np.radians(0), gamma_out=np.radians(10), H01_init=200e3, c21_init=250) self.turbine.compute_geometry() self.turbine.compute_stages_gas_dynamics() self.turbine.compute_integrate_turbine_parameters() self.turb_model = OutletTurbineModel( T_stag_in=self.turbine.T_g_stag, p_stag_in=self.turbine.p_g_stag, G_in=self.turbine.G_turbine, G_fuel_in=self.turbine.G_fuel, pi_t_stag=self.turbine.pi_t_stag, T_stag_in_nom=self.turbine.T_g_stag, p_stag_in_nom=self.turbine.p_g_stag, G_in_nom=self.turbine.G_turbine, pi_t_stag_nom=self.turbine.pi_t_stag, eta_t_stag_nom=self.turbine.eta_t_stag, F_out=self.turbine.geom.last.A2, eta_m=self.turbine.eta_m, precision=self.turbine.precision) comp_stage_num = 10 H_t_rel_dist = QuadraticBezier(0.3, 0.25, stage_num=comp_stage_num, angle1=np.radians(10), angle2=np.radians(10)) eta_rel_dist = QuadraticBezier(0.84, 0.84, stage_num=comp_stage_num, angle1=np.radians(3), angle2=np.radians(3)) c1_a_rel_dist = QuadraticBezier(0.4, 0.4, stage_num=comp_stage_num, angle1=np.radians(10), angle2=np.radians(10)) self.comp = Compressor( work_fluid=Air(), stage_num=comp_stage_num, const_diam_par_arr=[0.5 for _ in range(comp_stage_num)], p0_stag=1e5, T0_stag=288, G=28, n=9e3, H_t_rel_arr=H_t_rel_dist.get_array(), eta_ad_stag_arr=eta_rel_dist.get_array(), R_av_arr=[0.5 for _ in range(comp_stage_num)], k_h_arr=[1.0 for _ in range(comp_stage_num)], c1_a_rel_arr=c1_a_rel_dist.get_array(), h_rk_rel_arr=[3.5 for _ in range(comp_stage_num)], h_na_rel_arr=[3.5 for _ in range(comp_stage_num)], delta_a_rk_rel_arr=[0.4 for _ in range(comp_stage_num)], delta_a_na_rel_arr=[0.4 for _ in range(comp_stage_num)], d1_in_rel1=0.5, zeta_inlet=0.04, zeta_outlet=0.03, c11_init=200, precision=0.0001) self.comp.compute() self.comp_model = CompressorModel(characteristics=From16To18Pi(), T_stag_in=self.comp.T0_stag, p_stag_in=self.comp.p0_stag, pi_c_stag_rel=1, n_norm_rel=1, T_stag_in_nom=self.comp.T0_stag, p_stag_in_nom=self.comp.p0_stag, G_in_nom=self.comp.G, eta_c_stag_nom=self.comp.eta_c_stag, n_nom=self.comp.n, pi_c_stag_nom=self.comp.pi_c_stag, precision=0.0001) self.T_stag_in_outlet = np.linspace(300, 1000, 5) self.G_in_outlet = np.linspace(2, 40, 5) self.dif_outlet = np.linspace(1.1, 10.5, 5)
def setUp(self): self.precision = 0.00001 self.comp_turbine_ker_wcool = Turbine( TurbineType.WORK, T_g_stag=1523, p_g_stag=16e5, G_turbine=40, G_fuel=0.8, work_fluid=KeroseneCombustionProducts(), l1_D1_ratio=0.25, n=13e3, T_t_stag_cycle=1000, stage_number=3, eta_t_stag_cycle=0.90, k_n=6.8, eta_m=0.99, auto_compute_heat_drop=False, auto_set_rho=True, precise_heat_drop=True, precision=self.precision, H0_list=[290e3, 290e3, 290e3], alpha11=np.radians([17])[0], gamma_av=np.radians([4])[0], gamma_sum=np.radians([10])[0] ) self.comp_turbine_ker_wcool.compute_geometry() self.comp_turbine_ker_wcool.compute_stages_gas_dynamics() self.comp_turbine_ker_wcool.compute_integrate_turbine_parameters() self.comp_turbine_ngas_wcool = Turbine( TurbineType.WORK, T_g_stag=1523, p_g_stag=16e5, G_turbine=40, G_fuel=0.8, work_fluid=NaturalGasCombustionProducts(), l1_D1_ratio=0.25, n=13e3, T_t_stag_cycle=1000, stage_number=3, eta_t_stag_cycle=0.90, k_n=6.8, eta_m=0.99, auto_compute_heat_drop=False, auto_set_rho=True, precise_heat_drop=True, precision=self.precision, H0_list=[290e3, 290e3, 290e3], alpha11=np.radians([17])[0], gamma_av=np.radians([4])[0], gamma_sum=np.radians([10])[0] ) self.comp_turbine_ngas_wcool.compute_geometry() self.comp_turbine_ngas_wcool.compute_stages_gas_dynamics() self.comp_turbine_ngas_wcool.compute_integrate_turbine_parameters() self.power_turbine_ngas_wcool = Turbine( TurbineType.PRESSURE, T_g_stag=1523, p_g_stag=16e5, G_turbine=40, G_fuel=0.8, work_fluid=NaturalGasCombustionProducts(), l1_D1_ratio=0.25, n=13e3, T_t_stag_cycle=1000, stage_number=3, eta_t_stag_cycle=0.90, k_n=6.8, eta_m=0.99, auto_compute_heat_drop=False, auto_set_rho=True, precise_heat_drop=True, precision=self.precision, H0_list=[290e3, 290e3, 290e3], alpha11=np.radians([17])[0], gamma_av=np.radians([4])[0], gamma_sum=np.radians([10])[0] ) eta_t_res = 1 eta_t_stag_new = self.power_turbine_ngas_wcool.eta_t_stag_cycle self.precision_eta_t = 0.0001 while eta_t_res >= self.precision_eta_t: self.power_turbine_ngas_wcool.eta_t_stag_cycle = eta_t_stag_new self.power_turbine_ngas_wcool.compute_geometry() self.power_turbine_ngas_wcool.compute_stages_gas_dynamics() self.power_turbine_ngas_wcool.compute_integrate_turbine_parameters() eta_t_stag_new = self.power_turbine_ngas_wcool.eta_t_stag eta_t_stag_old = self.power_turbine_ngas_wcool.eta_t_stag_cycle eta_t_res = abs(eta_t_stag_old - eta_t_stag_new) / eta_t_stag_old self.comp_turbine_ngas_cool = Turbine( TurbineType.WORK, T_g_stag=1523, p_g_stag=16e5, G_turbine=40, G_fuel=0.8, work_fluid=NaturalGasCombustionProducts(), l1_D1_ratio=0.25, n=13e3, T_t_stag_cycle=1000, stage_number=3, eta_t_stag_cycle=0.90, k_n=6.8, eta_m=0.99, auto_compute_heat_drop=False, auto_set_rho=True, precise_heat_drop=True, precision=self.precision, H0_list=[290e3, 290e3, 290e3], alpha11=np.radians([17])[0], gamma_av=np.radians([4])[0], gamma_sum=np.radians([10])[0] ) self.comp_turbine_ngas_cool.geom[0].g_cool = 0.05 self.comp_turbine_ngas_cool.geom[1].g_cool = 0.05 self.comp_turbine_ngas_cool.geom[2].g_cool = 0.01 self.comp_turbine_ngas_cool.compute_geometry() self.comp_turbine_ngas_cool.compute_stages_gas_dynamics() self.comp_turbine_ngas_cool.compute_integrate_turbine_parameters()
def setUp(self): self.atmosphere = Atmosphere() self.inlet = Inlet() self.compressor = Compressor(17, precision=0.001) self.sink = Sink(g_cooling=0.05, g_outflow=0.01) self.comb_chamber = CombustionChamber(1450, alpha_out_init=2.7, precision=0.001) self.comb_chamber_inter_up = CombustionChamber(1300, alpha_out_init=2.7, precision=0.001) self.comb_chamber_inter_down = CombustionChamber(1300, alpha_out_init=2.7, precision=0.001, p_stag_out_init=4e5) self.source = Source(g_return=0.05) self.turbine_low_pres_power = Turbine(p_stag_out_init=1e5) self.turbine_comp_up = Turbine() self.outlet = Outlet() self.N_gen = 10e6 self.eta_gen = 0.97 self.load = Load(self.N_gen / self.eta_gen) self.zero_load1 = Load(0) self.zero_load2 = Load(0) self.solver = NetworkSolver( [ self.atmosphere, self.outlet, self.turbine_comp_up, self.sink, self.turbine_low_pres_power, self.source, self.inlet, self.comb_chamber, self.compressor, self.load, self.zero_load1, self.zero_load2 ], cold_work_fluid=Air(), hot_work_fluid=NaturalGasCombustionProducts()) self.solver.create_gas_dynamic_connection(self.atmosphere, self.inlet) self.solver.create_gas_dynamic_connection(self.inlet, self.compressor) self.solver.create_gas_dynamic_connection(self.compressor, self.sink) self.solver.create_gas_dynamic_connection(self.sink, self.comb_chamber) self.solver.create_gas_dynamic_connection(self.comb_chamber, self.turbine_comp_up) self.solver.create_gas_dynamic_connection(self.turbine_comp_up, self.source) self.solver.create_gas_dynamic_connection(self.source, self.turbine_low_pres_power) self.solver.create_gas_dynamic_connection(self.turbine_low_pres_power, self.outlet) self.solver.create_static_gas_dynamic_connection( self.outlet, self.atmosphere) self.solver.create_mechanical_connection(self.turbine_low_pres_power, self.load, self.zero_load1) self.solver.create_mechanical_connection(self.turbine_comp_up, self.compressor, self.zero_load2) self.solver.solve() self.N_e_specific = self.load.consumable_labour self.G_air = self.load.power / self.N_e_specific self.G_fuel = self.comb_chamber.g_fuel_prime * self.comb_chamber.g_in * self.G_air self.c_p_nat_gas_av = 2.3e3 self.k_nat_gas_av = 1.31 self.press_in_gas_comp = 1.3e6 self.T_in_gas_comp = 288 self.eta_ad_gas_comp = 0.82 self.eta_el_eng = 0.95 self.mass_rate_gas_comp = self.G_fuel self.press_out_gas_comp = self.compressor.p_stag_out + 0.5e6 self.pi_gas_comp = self.press_out_gas_comp / self.press_in_gas_comp self.rho_gas_comp = 6.9867 + (10.587 - 6.9867) / (1.5e6 - 1e6) * ( self.press_in_gas_comp - 1e6) self.vol_rate_gas_comp = self.mass_rate_gas_comp / self.rho_gas_comp * 60 self.T_out_gas_comp = self.T_in_gas_comp * (1 + (self.pi_gas_comp**( (self.k_nat_gas_av - 1) / self.k_nat_gas_av) - 1) / self.eta_ad_gas_comp) self.L_e_gas_comp = self.c_p_nat_gas_av * (self.T_out_gas_comp - self.T_in_gas_comp) self.N_gas_comp = self.L_e_gas_comp / (self.mass_rate_gas_comp * self.eta_el_eng)
def setUp(self): self.precision = 0.0005 self.comp_turb_h0_auto = Turbine(TurbineType.WORK, T_g_stag=1523, p_g_stag=16e5, G_turbine=40, G_fuel=0.8, work_fluid=KeroseneCombustionProducts(), l1_D1_ratio=0.25, n=13e3, T_t_stag_cycle=1100, stage_number=2, eta_t_stag_cycle=0.91, k_n=6.8, eta_m=0.99, auto_compute_heat_drop=True, auto_set_rho=True, precise_heat_drop=False, precision=self.precision, H01_init=150e3, c21_init=250, alpha11=np.radians([17])[0], gamma_av=np.radians([4])[0], gamma_sum=np.radians([10])[0]) self.comp_turb_h0_auto.geom[0].g_cool = 0.03 self.comp_turb_h0_auto.geom[0].g_lb = 0.00 self.comp_turb_h0_auto.geom[0].g_lk = 0.00 self.comp_turb_h0_auto.geom[0].g_ld = 0.00 self.comp_turb_h0_auto.geom[0].T_cool = 750 self.comp_turb_h0_auto.geom[1].g_cool = 0.03 self.comp_turb_h0_auto.compute_geometry() self.comp_turb_h0_auto.compute_stages_gas_dynamics() self.comp_turb_h0_auto.compute_integrate_turbine_parameters() self.comp_turb_h0_hand = Turbine(TurbineType.WORK, T_g_stag=1523, p_g_stag=16e5, G_turbine=40, G_fuel=0.8, work_fluid=NaturalGasCombustionProducts(), l1_D1_ratio=0.12, n=13e3, T_t_stag_cycle=1100, stage_number=2, eta_t_stag_cycle=0.91, k_n=6.8, eta_m=0.99, auto_compute_heat_drop=False, auto_set_rho=True, precise_heat_drop=False, H0_list=[160e3, 140e3], alpha11=np.radians([17])[0], gamma_av=np.radians([4])[0], gamma_sum=np.radians([10])[0]) self.comp_turb_h0_hand.compute_geometry() self.comp_turb_h0_hand.compute_stages_gas_dynamics() self.comp_turb_h0_hand.compute_integrate_turbine_parameters() self.comp_turb_rho_hand = Turbine(TurbineType.WORK, T_g_stag=1400, p_g_stag=5.5e5, G_turbine=25, G_fuel=1, work_fluid=KeroseneCombustionProducts(), l1_D1_ratio=0.25, n=15e3, T_t_stag_cycle=1200, stage_number=2, eta_t_stag_cycle=0.91, k_n=6.8, eta_m=0.99, auto_compute_heat_drop=True, auto_set_rho=False, precise_heat_drop=False, rho_list=[0.45, 0.4], H01_init=150e3, c21_init=250, alpha11=np.radians([17])[0], gamma_av=np.radians([4])[0], gamma_sum=np.radians([10])[0]) self.comp_turb_rho_hand.compute_geometry() self.comp_turb_rho_hand.compute_stages_gas_dynamics() self.comp_turb_rho_hand.compute_integrate_turbine_parameters() self.power_turb_h0_auto = Turbine(TurbineType.PRESSURE, T_g_stag=1400, p_g_stag=5.5e5, G_turbine=25, G_fuel=1, work_fluid=NaturalGasCombustionProducts(), l1_D1_ratio=0.25, n=15e3, T_t_stag_cycle=1200, stage_number=3, eta_t_stag_cycle=0.91, k_n=6.8, eta_m=0.99, auto_compute_heat_drop=True, auto_set_rho=True, precise_heat_drop=False, H01_init=150e3, c21_init=250, alpha11=np.radians([17])[0], gamma_in=np.radians([0])[0], gamma_out=np.radians([10])[0]) self.power_turb_h0_auto.compute_geometry() self.power_turb_h0_auto.compute_stages_gas_dynamics() self.power_turb_h0_auto.compute_integrate_turbine_parameters()