! ******************* intake ******************************* ! +++ ! ! Definition of the air intake for the motor ! ! --- ! ! ! Revision history ! _______________ ! ! Copyright 1997-05-06 Gunnar Liden, All Rights Reserved ! ! Released under the MIT License: ! ! Permission is hereby granted, free of charge, to any person ! obtaining a copy of this software and associated documentation ! files (the "Software"), to deal in the Software without ! restriction, including without limitation the rights to use, ! copy, modify, merge, publish, distribute, sublicense, and/or sell ! copies of the Software, and to permit persons to whom the ! Software is furnished to do so, subject to the following ! conditions: ! ! The above copyright notice and this permission notice shall be ! included in all copies or substantial portions of the Software. ! ! THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ! FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ! OTHER DEALINGS IN THE SOFTWARE. ! ! ************************************************************ !sdesce Definition of the air intake for the motor !sdescs Definition av luftintag foer motorn GLOBAL GEOMETRY MODULE intake ( REF eng_id >"@t16384 Select engine"; FLOAT s_r := 0.6 >"Relative start position for intake (0-1)"; FLOAT s_z := 900.00 >"Delta Z value for start position of intake"; FLOAT a_w := 1000.00 >"Width of intake"; FLOAT a_h := 510.00 >"Height of intake"; INT graphic:= 1 >"=0: Show nothing =1: Intake =2: All"); ! Internal variables VECTOR p_is; ! Start position intake VECTOR p_se; ! End position spine (constant section) VECTOR p_ms; ! Start position motor REF air_id; ! Reference to aircraft REF poi_id; ! Reference to start motor point REF mot_id; ! Reference to motor surface ! Attributes for engine: REF pla_id; ! 1 Reference to pla_id FLOAT r_m; ! 2 Radius for the motor FLOAT r_o; ! 3 Radius for the outlet ! Attributes for plashape: FLOAT x_1; ! 1 Forward fuselage nose point X FLOAT pv1; ! 2 P-value forward fuselage FLOAT x_2; ! 3 Forward fuselage end point X FLOAT y_2; ! 4 Forward fuselage end point Y FLOAT x_3; ! 5 Wing leading edge start point X FLOAT y_3; ! 6 Wing Start station value Y FLOAT x_4; ! 7 Wing leading edge outer point X FLOAT y_4; ! 8 Wing end station value Y FLOAT x_5; ! 9 Wing trailing edge outer point X FLOAT x_6; ! 10 Wing trailing edge inner point X FLOAT x_7; ! 11 Rear fuselage end point X FLOAT y_7; ! 12 Rear fuselage end point Y FLOAT z_c; ! 13 Z value for the plane shape ! For GTGRP REF group_id; ! Reference to group STRING group_name*10;! Group name INT n_member; ! Number of members in group REF member_id(3); ! References to the members FLOAT area_i; ! Area of intake FLOAT area_m; ! Area of motor INT b_val_s; ! Blank value for output surfaces INT b_val_a; ! Blank value all other entities BEGINMODULE ! +++ ! Algorithm ! _________ ! --- ! +++ ! 1. Checks and initializations ! --- ! +++ ! Check graphic variable ! --- IF graphic = 0 THEN b_val_s := 1; b_val_a := 1; ELIF graphic = 1 THEN b_val_s := 0; b_val_a := 1; ELIF graphic = 2 THEN b_val_s := 0; b_val_a := 0; ELSE PART(#51, inp_err (VEC(5000,0,1000))); EXIT("intake graphic is not 0, 1 or 2"); ENDIF; ! +++ ! Retrieve data from the engine and the projected shape ! --- air_id := GETREF(eng_id, 1); r_m := GETFLT(eng_id, 2); pla_id := GETREF(air_id, 1); x_1 := GETFLT(pla_id, 1); x_2 := GETFLT(pla_id, 3); x_3 := GETFLT(pla_id, 5); x_4 := GETFLT(pla_id, 7); x_5 := GETFLT(pla_id, 9); x_6 := GETFLT(pla_id,10); x_7 := GETFLT(pla_id,11); z_c := GETFLT(pla_id,13); SET_ROOT_GM(eng_id); group_id := GET_NEXT_GM(0, 4096, "Motor"); IF group_id = #0 THEN PART(#52, inp_err (VEC(5000,0,1000))); EXIT("engine There is no (GROUP) Motor in "+RSTR(eng_id)); ENDIF; GETGRP(group_id, group_name, n_member, member_id); mot_id := member_id(1); SET_ROOT_GM(eng_id); group_id := GET_NEXT_GM(0, 4096, "Mstart"); IF group_id = #0 THEN PART(#53, inp_err (VEC(5000,0,1000))); EXIT("engine There is no (GROUP) Mstart in "+RSTR(eng_id)); ENDIF; GETGRP(group_id, group_name, n_member, member_id); poi_id := member_id(1); p_ms := ON(poi_id); ! +++ ! Check relative X start position ! --- IF s_r < 0.0 + 0.01 OR s_r > 1.0 - 0.01 THEN PART(#58, inp_err (VEC(5000,0,1000))); EXIT("intake Relative X position not between 0 and 1 "); ENDIF; ! +++ ! Compare area of intake and motor ! --- IF a_w < 1.0 THEN PART(#54, inp_err (VEC(5000,0,1000))); EXIT("intake Width of inlet < 1 "); ENDIF; IF a_h < 1.0 THEN PART(#55, inp_err (VEC(5000,0,1000))); EXIT("intake Height of inlet < 1 "); ENDIF; area_i := a_w*a_h; area_m := PI*r_m**2; IF area_i < area_m THEN PART(#56, inp_err (VEC(5000,0,1000))); EXIT("engine Area inlet "+STR(area_i,8,1)+ " < motor "+STR(area_m,-8,1)); ENDIF; IF area_i > 3*area_m THEN PART(#57, inp_err (VEC(5000,0,1000))); EXIT("engine Area inlet "+STR(area_i,8,1)+ " > 3*motor "+STR(3*area_m,-8,1)); ENDIF; ! +++ ! 2. Calculate start position for intake ! --- p_is := VEC(x_1+s_r*(p_ms.x-x_1), 0.0, z_c + s_z); POI_FREE(#20,p_ms:BLANK=b_val_a,PEN=4); POI_FREE(#21,p_is:BLANK=b_val_a,PEN=4); ! +++ ! 3. Definition of profile (section) curve for inlet ! --- ! +++ ! A section curve for SUR_SWEEP shall be defined in the basic ! system. Activate the basic system (function MODE_BASIC). ! --- MODE_BASIC(); ! +++ ! Create four straight lines in X/Y plane (function LIN_FREE) ! --- LIN_FREE(#31, VEC( -a_h/2.0, a_w/2.0, 0.0), VEC( a_h/2.0, a_w/2.0, 0.0) :BLANK=b_val_a,PEN=2); LIN_FREE(#32, VEC( a_h/2.0, a_w/2.0, 0.0), VEC( a_h/2.0,-a_w/2.0, 0.0) :BLANK=b_val_a,PEN=2); LIN_FREE(#33, VEC( a_h/2.0,-a_w/2.0, 0.0), VEC( -a_h/2.0,-a_w/2.0, 0.0) :BLANK=b_val_a,PEN=2); LIN_FREE(#34, VEC( -a_h/2.0,-a_w/2.0, 0.0), VEC( -a_h/2.0, a_w/2.0, 0.0) :BLANK=b_val_a,PEN=2); ! +++ ! Activate the global system (function MODE_GLOBAL) ! Create a composite curve (function CUR_COMP) ! --- CUR_COMP(#35, GLOBAL_REF(#31), GLOBAL_REF(#32), GLOBAL_REF(#33), GLOBAL_REF(#34) :BLANK=b_val_a,PEN=4); ! +++ ! 4. Create the spine ! --- p_se := p_ms - VEC(0.1*(p_ms.x-x_1),0,-r_m*0.9); CUR_CONIC(#10, "FREE", p_is, p_is + VEC(1,0,0), 0.6, p_se, p_ms-VEC(0,0,r_m*0.3) :BLANK=b_val_a,PEN=4); ! +++ ! 4. Create the surfaces ! --- ! +++ ! Create the constant section (function SUR_SWEEP) ! --- SUR_SWEEP(#1, GLOBAL_REF(#35), GLOBAL_REF(#10) :BLANK=b_val_s); ! +++ ! Create surface between constant section and motor (SUR_RULED) ! --- ! +++ ! Create start and end boundary curves (function CUR_ISO) ! --- CUR_ISO(#7, GLOBAL_REF(#1), "U", 1.0, 4.00, 3.50:BLANK=b_val_a,PEN=3); CUR_ISO(#17, GLOBAL_REF(#1), "U", 1.0, 3.50, 0.00:BLANK=b_val_a,PEN=4); CUR_COMP(#9, GLOBAL_REF(#17), GLOBAL_REF(#7):BLANK=b_val_a,PEN=4); CUR_ISO(#8, mot_id, "U", 0.0, 4.0, 0.0:BLANK=b_val_a,PEN=4); CUR_APPROX(#19, GLOBAL_REF(#8), "CUB_SEG", 1, 4:BLANK=b_val_a,PEN=2); ! +++ ! Create outlet surface (function SUR_RULED) ! --- SUR_RULED(#2, GLOBAL_REF(#9), GLOBAL_REF(#19):BLANK=b_val_s); ENDMODULE