public static double A_a6_calc(double a0, double ar, double lamda) { double a = WingPlane.Calc_cla_subsonic(a0, 0.0D, ar, lamda); double a6 = WingPlane.Calc_cla_subsonic(a0, 0.0D, 6D, lamda); return(a / a6); }
public ControlPlane() { type = 0; actuate_type = 0; flap_type = 0; baseWingBlock = new WingPlane(); t_move = 0.0D; d_fv = new Vector3D(); d_tv = new Vector3D(); }
internal void Calc_dynamics(AirPlane ap, Vector3D[] dv, double[] k_q, double[] k_S) { fv.SetVec(0.0D, 0.0D, 0.0D); tv.SetVec(0.0D, 0.0D, 0.0D); for (int lr = 0; lr < n_lr; lr++) { for (int i = 0; i < n_wing_block; i++) { WingPlane wpi = wp[i, lr]; if (wpi.flag != 0) { wpi.Calc_dynamics(lr, null, ap, dv[lr], k_q[lr], k_S[lr]); fv = fv.Add(wpi.fv); tv = tv.Add(wpi.tv); } } } }
public double Get_max_k_stall_htail() { double ret = 0.0D; int i; for (i = 0; i < n_htail; i++) { Wing wg = htail[i]; for (int lr = 0; lr < wg.n_lr; lr++) { for (int j = 0; j < wg.n_wing_block; j++) { WingPlane wp = wg.wp[j, lr]; if (wp.k_stall <= ret) { continue; } ret = wp.k_stall; } } } for (i = 0; i < n_elevator; i++) { for (int lr_0 = 0; lr_0 <= 1; lr_0++) { ControlPlane cp = elevator[i, lr_0]; if (cp.type != 0) { WingPlane wp_1 = cp.baseWingBlock; if (wp_1.k_stall <= ret) { continue; } ret = wp_1.k_stall; } } } return(ret); }
private void ReadWing(Wing wg, int hv_arrangement, bool flagMessage) { double[] b2f_beta = { -90.0D, -80.0D, -70.0D, -60.0D, -50.0D, -40.0D, -30.0D, -20.0D, -10.0D, 0, 10.0D, 20.0D, 30.0D, 40.0D, 50.0D, 60.0D, 70.0D, 80.0D, 90.0D }; double[] b2f_b = new double[19]; int i; for (i = 0; i < b2f_beta.Length; i++) { b2f_beta[i] = MathTool.DegToRad(b2f_beta[i]); } wg.flag = 1; wg.name = ReadString("name", flagMessage); wg.n_lr = ReadIntValue("n", flagMessage); wg.hv_arrangement = hv_arrangement; wg.s2 = ReadDblValue("S/n", flagMessage); Pass("b/n = "); for (i = 0; i < 19; i++) { b2f_b[i] = ReadDouble(); } wg.b2_func = new Function2D(b2f_beta, b2f_b); wg.k_ar = ReadDblValue("k_Ar", flagMessage); wg.n_wing_block = ReadIntValue("wing_block", flagMessage); wg.wp = new WingPlane[wg.n_wing_block, 2]; for (i = 0; i < wg.n_wing_block; i++) { wg.wp[i, 0] = new WingPlane(); wg.wp[i, 1] = new WingPlane(); WingPlane wpR = wg.wp[i, 0]; WingPlane wpL = wg.wp[i, 1]; ReadWingPlane(wg, wpR, wpL, flagMessage); } }
private void ReadWingPlane(Wing wg, WingPlane wpR, WingPlane wpL, bool flagMessage) { wpR.flag = 0; wpL.flag = 0; wpR.block_name = ReadString("block_name", flagMessage); if (wg.n_lr >= 1) { wpR.flag = 1; wpR.wing = wg; if (wg.hv_arrangement == 0) { wpR.arrangement = 1; } else { wpR.arrangement = 3; } wpR.s2 = ReadDblValue("S/n", flagMessage); wpR.ac_base = ReadVector("Ac", flagMessage); wpR.gc = ReadVector("Gc", flagMessage); wpR.gamma = MathTool.DegToRad(ReadDblValue("gamma", flagMessage)); wpR.delta = MathTool.DegToRad(ReadDblValue("delta", flagMessage)); wpR.lamda = MathTool.DegToRad(ReadDblValue("lamda", flagMessage)); wpR.t_c = ReadDblValue("t/c", flagMessage); wpR.a0 = ReadDblValue("a0", flagMessage); wpR.alpha0 = MathTool.DegToRad(ReadDblValue("alpha0", flagMessage)); wpR.clmax = ReadDblValue("CLmax", flagMessage); wpR.delta_clmax = ReadDblValue("delta_CLmax", flagMessage); wpR.delta_alphe_p = MathTool.DegToRad(ReadDblValue("delta_alpha_p", flagMessage)); wpR.clmin = ReadDblValue("CLmin", flagMessage); wpR.delta_clmin = ReadDblValue("delta_CLmin", flagMessage); wpR.delta_alphe_m = MathTool.DegToRad(ReadDblValue("delta_alpha_m", flagMessage)); wpR.alpha_i = MathTool.DegToRad(ReadDblValue("alpha_i", flagMessage)); wpR.cdmin = ReadDblValue("CDmin", flagMessage); wpR.k_cd = ReadDblValue("k_cd", flagMessage); wpR.delta_cdmin = ReadDblValue("delta_CDmin", flagMessage); wpR.alpha_backet = MathTool.DegToRad(ReadDblValue("alpha_backet", flagMessage)); wpR.cmac = ReadDblValue("Cmac", flagMessage); wpR.ew = ReadDblValue("ew", flagMessage); wpR.mc = ReadDblValue("Mc", flagMessage); wpR.Init(); } if (wg.n_lr == 2) { wpL.flag = 1; wpL.wing = wg; wpL.block_name = wpR.block_name; if (wg.hv_arrangement == 0) { wpL.arrangement = 2; } else { wpL.arrangement = 4; } wpL.s2 = wpR.s2; wpL.ac_base = wpR.ac_base; wpL.gc = wpR.gc; wpL.gamma = wpR.gamma; wpL.delta = wpR.delta; wpL.lamda = wpR.lamda; wpL.t_c = wpR.t_c; wpL.a0 = wpR.a0; wpL.alpha0 = wpR.alpha0; wpL.clmax = wpR.clmax; wpL.delta_clmax = wpR.delta_clmax; wpL.delta_alphe_p = wpR.delta_alphe_p; wpL.clmin = wpR.clmin; wpL.delta_clmin = wpR.delta_clmin; wpL.delta_alphe_m = wpR.delta_alphe_m; wpL.alpha_i = wpR.alpha_i; wpL.cdmin = wpR.cdmin; wpL.k_cd = wpR.k_cd; wpL.delta_cdmin = wpR.delta_cdmin; wpL.alpha_backet = wpR.alpha_backet; wpL.cmac = wpR.cmac; wpL.ew = wpR.ew; wpL.mc = wpR.mc; wpL.Init(); } }
public double Get_max_k_stall_wing() { double ret = 0.0D; int i; for (i = 0; i < n_wing; i++) { Wing wg = wing[i]; for (int lr = 0; lr < wg.n_lr; lr++) { for (int j = 0; j < wg.n_wing_block; j++) { WingPlane wp = wg.wp[j, lr]; if (wp.k_stall <= ret) { continue; } ret = wp.k_stall; } } } for (i = 0; i < n_aileron; i++) { for (int lr_0 = 0; lr_0 <= 1; lr_0++) { ControlPlane cp = aileron[i, lr_0]; if (cp.type != 0) { WingPlane wp_1 = cp.baseWingBlock; if (wp_1.k_stall <= ret) { continue; } ret = wp_1.k_stall; } } } for (i = 0; i < n_t_flap; i++) { for (int lr_2 = 0; lr_2 <= 1; lr_2++) { ControlPlane cp_3 = t_flap[i, lr_2]; if (cp_3.type != 0) { WingPlane wp_4 = cp_3.baseWingBlock; if (wp_4.k_stall <= ret) { continue; } ret = wp_4.k_stall; } } } for (i = 0; i < n_l_flap; i++) { for (int lr_5 = 0; lr_5 <= 1; lr_5++) { ControlPlane cp_6 = l_flap[i, lr_5]; if (cp_6.type != 0) { WingPlane wp_7 = cp_6.baseWingBlock; if (wp_7.k_stall <= ret) { continue; } ret = wp_7.k_stall; } } } return(ret); }
public void Calc_w(AirPlane ap, double dt) { Vector3D v = new Vector3D(); Matrix44 ryMat = new Matrix44(); if ((ap.n_wing > 0) && (ap.n_htail > 0) && (ap.wing[0].n_wing_block > 0) && (ap.htail[0].n_wing_block > 0)) { double s_sum; double cl_sum = s_sum = 0.0D; wf_b_epsilon_htail = wf_epsilon_htail; int i; for (i = 0; i < ap.n_wing; i++) { for (int lr = 0; lr < ap.wing[i].n_lr; lr++) { for (int j = 0; j < ap.wing[i].n_wing_block; j++) { WingPlane wpi = ap.wing[i].wp[j, lr]; cl_sum += wpi.cl * wpi.s2; s_sum += wpi.s2; } } } for (i = 0; i < ap.n_aileron; i++) { for (int lr_0 = 0; lr_0 < 2; lr_0++) { if (ap.aileron[i, lr_0].type != 0) { WingPlane wpi_1 = ap.aileron[i, lr_0].baseWingBlock; cl_sum += ap.aileron[i, lr_0].d_cl * wpi_1.s2; s_sum += wpi_1.s2; } } } for (i = 0; i < ap.n_t_flap; i++) { for (int lr_2 = 0; lr_2 < 2; lr_2++) { if (ap.t_flap[i, lr_2].type != 0) { WingPlane wpi_3 = ap.t_flap[i, lr_2].baseWingBlock; cl_sum += ap.t_flap[i, lr_2].d_cl * wpi_3.s2; s_sum += wpi_3.s2; } } } for (i = 0; i < ap.n_l_flap; i++) { for (int lr_4 = 0; lr_4 < 2; lr_4++) { if (ap.l_flap[i, lr_4].type != 0) { WingPlane wpi_5 = ap.l_flap[i, lr_4].baseWingBlock; cl_sum += ap.l_flap[i, lr_4].d_cl * wpi_5.s2; s_sum += wpi_5.s2; } } } wing_cl = (cl_sum / s_sum); wing_ar = (ap.wing[0].AspectRatio(ap.pMotion.beta) * ap.wing[0].K_ground_effect(ap.pMotion.beta, ap.pMotion.wpos.y)); wf_epsilon = (2.0D * wing_cl / Math.PI / wing_ar); double alpha = Math.Abs(ap.pMotion.alpha / 2.0D - angle_t.GetValue()); double beta = Math.Abs(ap.pMotion.beta); wf_epsilon_htail = Jp.Maker1.Sim.Tools.Tool.Hokan2_2D(wf_theta1, wf_beta1, wf_epsilon, wf_theta2, wf_beta2, 0.0D, alpha, beta); wf_d_epsilon_htail = ((wf_epsilon_htail - wf_b_epsilon_htail) / dt); double v0 = ap.pMotion.vc.Length(); if (v0 > 5.0D) { v.SetVec(0.0D, 0.0D, -(v0 * wf_epsilon_htail - wf_d_epsilon_htail * lt / v0)); } else { v.SetVec(0.0D, 0.0D, -(v0 * wf_epsilon_htail)); } ryMat.SetRyMat(-(wf_epsilon_htail + ap.pMotion.alpha)); v = v.MultMat(ryMat); htail_dv[1] = htail_dv[1].Add(v); htail_dv[0] = htail_dv[0].Add(v); } }