def compute(self): self._compute_nominal() if self.p2 > self.p2_nom: # Режим перерасширения self.lam2 = newton( lambda lam: ( self.G - gdf.m(self.k) * self.area2 / (self.R * self.T_stag)**0.5 * gdf.q(lam, self.k) * self.p2 / gdf.pi_lam(lam, self.k) ), x0=0.6 ) if self.lam2 < 1: self.p2_stag = self.p2 / gdf.pi_lam(self.lam2, self.k) self.lam_pre = newton( lambda lam: self.p1_stag * gdf.q(lam, self.k) - self.p2_stag * gdf.q(1 / lam, self.k), x0=self.lam_pre_init ) self.lam_post = 1 / self.lam_pre self.area_shock = self.area_cr * gdf.q(1, self.k) / gdf.q(self.lam_pre, self.k) for i in range(self.i_cr, self.num): if self.area_arr[i] > self.area_shock: # Скачок уплотнения внутри сопла self.p_stag_arr[i] = self.p2_stag self.q_arr[i] = self.G * (self.R * self.T_stag) ** 0.5 / \ (self.p_stag_arr[i] * self.area_arr[i] * gdf.m(self.k)) self.lam_arr[i] = gdf.lam(self.k, q=self.q_arr[i], kind='subs') self.c_arr[i] = self.a_cr * self.lam_arr[i] self.T_arr[i] = self.T_stag * gdf.tau_lam(self.lam_arr[i], self.k) self.p_arr[i] = self.p_stag_arr[i] * gdf.pi_lam(self.lam_arr[i], self.k) self.T_rel_arr = self.T_arr / self.T_arr[0] self.c_rel_arr = self.c_arr / self.c_arr[0] self.lam_rel_arr = self.lam_arr / self.lam_arr[0] self.p_stag_rel_arr = self.p_stag_arr / self.p_stag_arr[0] self.p_rel_arr = self.p_arr / self.p_arr[0]
def _get_outlet_geom_parameters(self, alpha_3): c_a_rel_3 = self.stage_model.triangle_3.c_a_rel u_out_1 = self.stage_model.u_out_1 a_crit_3 = self.stage_model.thermal_info.a_crit_3 lambda_3 = self._lambda(c_a_rel_3, u_out_1, alpha_3, a_crit_3) lambda_1 = self._get_lambda_1() F_1 = self._get_F_1() q_relation = gdf.q(lambda_1, self.stage_model.k, self.stage_model.R) / \ gdf.q(lambda_3, self.stage_model.k, self.stage_model.R) p_stag_relation = self.stage_model.thermal_info.p_stag_1 / self.stage_model.thermal_info.p_stag_3 T_stag_relation = self.stage_model.thermal_info.T_stag_1 / self.stage_model.thermal_info.T_stag_3 F_3 = F_1 * q_relation * p_stag_relation / T_stag_relation**0.5 D_3, d_rel_3 = self.stage_model.stage_geometry.get_outlet_parameters(F_3) return D_3, d_rel_3
def _get_F_1(self): T_stag_1 = self.stage_model.thermal_info.T_stag_1 p_stag_1 = self.stage_model.thermal_info.p_stag_1 alpha_1 = self.stage_model.triangle_1.alpha lambda_1 = self._get_lambda_1() G = self.stage_model.G F_1 = (G * T_stag_1**0.5 / p_stag_1) * \ (1 / (gdf.q(lambda_1, self.stage_model.k, self.stage_model.R) * np.sin(alpha_1))) return F_1