matLib = MaterialLib() matLib.addMat(1, 'AS43501-6', 'trans_iso', [20.6e6, 1.42e6, .34, .34, .87e6, 0.], 0.004826) matLib.addMat(2, 'AS43501-6*', 'trans_iso', [20.6e6, 1.42e6, .34, .42, .87e6, 0.], .005) # Box Configuration 2 c2 = 0.53 xdim2 = [-0.8990566037735849, 0.8990566037735849] af2 = Airfoil(c2, name='box') # B1 Box beam (0.5 x 0.923 in^2 box with laminate schedule [15]_6) n_i_B1 = [6] m_i_B1 = [2] th_B1 = [-15] lam1_B1 = Laminate(n_i_B1, m_i_B1, matLib, th=th_B1) lam2_B1 = Laminate(n_i_B1, m_i_B1, matLib, th=th_B1) lam3_B1 = Laminate(n_i_B1, m_i_B1, matLib, th=th_B1) lam4_B1 = Laminate(n_i_B1, m_i_B1, matLib, th=th_B1) lam1_B1.printPlies() laminates_B1 = [lam1_B1, lam2_B1, lam3_B1, lam4_B1] xsect_B1 = XSect(af2, xdim2, laminates_B1, matLib, typeXsect='box', meshSize=2) import time t1 = time.time() # With lu factorization xsect_B1.xSectionAnalysis() xsect_B1.printStiffMat() t2 = time.time() # With linalg.solve xsect_B1.xSectionAnalysis(linalgSolve=True)
def __init__(self, PID, p1, p2, croot, ctip, x0_spar, xf_spar, Y_rib, n_ply, m_ply, mat_lib, **kwargs): """Creates a wing object. This object represents a wing and contains both structural and aerodynamic models. :Args: - `PID (int)`: The integer ID linked to this part. - `p1 (1x3 np.array[float])`: The initial x,y,z coordinates of the wing. - `p2 (1x3 np.array[float]`: The final x,y,z coordinates of the wing. - `croot (float)`: The root chord length. - `ctip (float)`: The tip chord length. - `x0_spar (float)`: The non-dimensional starting location of the cross section. - `xf_spar (float)`: The non-dimensional ending location of the cross section. - `Y_rib (1xN Array[float])`: The non-dimensional rib locations within the wing. This dimension is primarily used to create wing-sections which primarily define the buckling span's for laminate objects. - `n_ply (1xM Array[int])`: An array of integers specifying the number plies to be used in the model. Each integer refers to the number of plies to be used for at a given orientation. - `m_ply (1xM Array[int])`: An array of integers specifying the material ID to be used for the corresponding number of plies in n_ply at a given orientation. - `th_ply (1xM Array[int])`: An array of floats specifying the degree orientations of the plies used by the lamiantes in the model. - `mat_lib (obj)`: A material library containing all of the material objets to be used in the model. - `name (str)`: The name of the airfoil section to be used for cross section generation. - `wing_SNID (int)`: The first node ID associated with the wing. - `wing_SEID (int)`: The first beam element ID associated with the wing. - `wing_SSBID (int)`: The first superbeam ID associated with the wing. - `SXID (int)`: The starting cross-section ID used by the wing. - `noe (float)`: The number of beam elements to be used in the wing per unit length. - `n_orients (int)`: The number of fiber orientations to be used in each laminate. - `n_lams (int)`: The number of laminates required to mesh the desired cross-section. - `meshSize (float)`: The maximum aspect ratio a 2D element may have in the cross-section. - `ref_ax (str)`: The reference axis to be loaded in the wing. - `chordVec (1x3 np.array[float])`: This numpy array is used to orient the cross-section in 3D space. It corresponds to the local unit x- vector in the cross-section, expressed in the global frame. - `typeXSect (str)`: The type of cross-section to be used by the wing structure. Currently the suported typed are 'boxbeam', 'laminate', and 'rectBoxBeam'. See the meshing class in the structures module for more details. :Returns: - None """ #The type of the object self.type = 'wing' # Initialize the array holding wing sections self.wingSects = [] # Initialize the wing ID self.PID = PID # Initialize Lifting surface Array self.liftingSurfaces = {} # Name of the airfoil section (used to generate the OML shape of the x-section) name = kwargs.pop('name', 'NACA0012') # The initial starting node ID for the structural generation of the wing tmp_SB_SNID = kwargs.pop('wing_SNID', 0) # The initial beam element EID for the first superbeam ID tmp_SB_SEID = kwargs.pop('wing_SEID', 0) # The initial starting superbeam ID tmp_SB_SBID = kwargs.pop('wing_SSBID', 0) # The starting cross-section ID SXID = kwargs.pop('SXID', 0) # The number of beam elements to be used per unit length noe = kwargs.pop('noe', 10) # The number of fiber orientations to be used in each laminate n_orients = kwargs.pop('n_orients', 4) # The number of laminates required to mesh the desired cross-section n_lams = kwargs.pop('n_lams', 4) # Laminate symmetry lam_sym = kwargs.pop('lam_sym', False) # The maximum aspect ratio a 2D element may have in the cross-section meshSize = kwargs.pop('meshSize', 4) # The reference axis to be loaded in the wing ref_ax = kwargs.pop('ref_ax', 'shearCntr') # Chord vector for wing chordVec = kwargs.pop('chordVec', np.array([1., 0., 0.])) # Orientations of each ply in the lamiante th_ply = kwargs.pop('th_ply', [0] * len(n_ply)) # Type of cross-section typeXSect = kwargs.pop('typeXSect', 'box') # Calculate the wing span: b_s = np.linalg.norm(p2 - p1) # Lambda function to calculate average panel chord length on on the fly. chord = lambda y: (ctip - croot) * y / b_s + croot # Create wing sections between each rib: for i in range(0, len(Y_rib) - 1): # Create a wing panel object based on the average chord length # Determine the laminate schedule beam section section_lams = [] for j in range(0, n_lams): # Select vectors of thicknesses and MID's: n_i_tmp = n_ply[i * n_lams + n_orients * j:i * n_lams + n_orients * j + n_orients] m_i_tmp = m_ply[i * n_lams + n_orients * j:i * n_lams + n_orients * j + n_orients] th_i_tmp = th_ply[i * n_lams + n_orients * j:i * n_lams + n_orients * j + n_orients] section_lams += [ Laminate(n_i_tmp, m_i_tmp, mat_lib, sym=lam_sym, th=th_i_tmp) ] # Compile all information needed to create xsection and beams # Starting coordiante of super beam tmp_x1 = p1 + Y_rib[i] * (p2 - p1) # Ending coordiante of super beam tmp_x2 = p1 + Y_rib[i + 1] * (p2 - p1) tmpWingSect = WingSection(tmp_x1,tmp_x2,chord,name,x0_spar,xf_spar,\ section_lams,mat_lib,noe,SSBID=tmp_SB_SBID,SNID=tmp_SB_SNID,\ SEID=tmp_SB_SEID,meshSize=meshSize,SXID=SXID,ref_ax=ref_ax,\ chordVec=chordVec,typeXSect=typeXSect) # Prepare ID values for next iteration tmp_SB_SNID = tmpWingSect.SuperBeams[-1].enid tmp_SB_SEID = max(tmpWingSect.SuperBeams[-1].elems.keys()) + 1 tmp_SB_SBID = tmpWingSect.SuperBeams[-1].SBID + 1 self.wingSects += [tmpWingSect] SXID = max(self.wingSects[i].XIDs) + 1
matLib.addMat(1,'AS43501-6','trans_iso',[20.6e6,1.42e6,.34,.34,.87e6,0.],0.004826) matLib.addMat(2,'AS43501-6*','trans_iso',[20.6e6,1.42e6,.34,.42,.87e6,0.],.005) # Box Configuration 2 c = 1.5 xdim = [-0.8990566037735849,0.8990566037735849] strn = np.array([0.,0.,0.,0.,0.,1.0]) num_data_points = 50 cs = np.linspace(0.1,1,num_data_points) # Layup 2 Box beam (0.5 x 0.923 in^2 box with laminate schedule [30,0]_3) n_i_1 = [1,1,1,1,1,1] m_i_1 = [1,1,1,1,1,1] th_1 = [-15,-15,-15,-15,-15,-15] lam1 = Laminate(n_i_1, m_i_1, matLib, th=th_1) n_i_2 = [1,1,1,1,1,1] m_i_2 = [1,1,1,1,1,1] th_2 = [-15,15,-15,15,-15,15] lam2 = Laminate(n_i_2, m_i_2, matLib, th=th_2) n_i_3 = [1,1,1,1,1,1] m_i_3 = [1,1,1,1,1,1] th_3 = [15,15,15,15,15,15] lam3 = Laminate(n_i_3, m_i_3, matLib, th=th_3) n_i_4 = [1,1,1,1,1,1] m_i_4 = [1,1,1,1,1,1] th_4 = [-15,15,-15,15,-15,15] lam4 = Laminate(n_i_4, m_i_4, matLib, th=th_4) lam1.printPlies() lam2.printPlies() lam3.printPlies()
matLib.addMat(2, 'AS43501-6*', 'trans_iso', [20.6e6, 1.42e6, .34, .42, .87e6, 0.], .005) # Box Configuration 2 c = 1.5 xdim = [-0.8990566037735849, 0.8990566037735849] strn = np.array([0., 0., 0., 0., 0., 1.0]) num_data_points = 50 cs = np.linspace(0.1, 1, num_data_points) # Layup 2 Box beam (0.5 x 0.923 in^2 box with laminate schedule [30,0]_3) n_i_1 = [1, 1, 1, 1, 1, 1] m_i_1 = [1, 1, 1, 1, 1, 1] th_1 = [-15, -15, -15, -15, -15, -15] lam1 = Laminate(n_i_1, m_i_1, matLib, th=th_1) n_i_2 = [1, 1, 1, 1, 1, 1] m_i_2 = [1, 1, 1, 1, 1, 1] th_2 = [-15, 15, -15, 15, -15, 15] lam2 = Laminate(n_i_2, m_i_2, matLib, th=th_2) n_i_3 = [1, 1, 1, 1, 1, 1] m_i_3 = [1, 1, 1, 1, 1, 1] th_3 = [15, 15, 15, 15, 15, 15] lam3 = Laminate(n_i_3, m_i_3, matLib, th=th_3) n_i_4 = [1, 1, 1, 1, 1, 1] m_i_4 = [1, 1, 1, 1, 1, 1] th_4 = [-15, 15, -15, 15, -15, 15] lam4 = Laminate(n_i_4, m_i_4, matLib, th=th_4) lam1.printPlies() lam2.printPlies() lam3.printPlies()
matLib = MaterialLib() matLib.addMat(1,'AS43501-6','trans_iso',[20.6e6,1.42e6,.34,.34,.87e6,0.],0.004826) matLib.addMat(2,'AS43501-6*','trans_iso',[20.6e6,1.42e6,.34,.42,.87e6,0.],.005) # Box Configuration 2 c2 = 0.53 xdim2 = [-0.8990566037735849,0.8990566037735849] af2 = Airfoil(c2,name='box') # B1 Box beam (0.5 x 0.923 in^2 box with laminate schedule [15]_6) n_i_B1 = [6] m_i_B1 = [2] th_B1 = [-15] lam1_B1 = Laminate(n_i_B1, m_i_B1, matLib, th=th_B1) lam2_B1 = Laminate(n_i_B1, m_i_B1, matLib, th=th_B1) lam3_B1 = Laminate(n_i_B1, m_i_B1, matLib, th=th_B1) lam4_B1 = Laminate(n_i_B1, m_i_B1, matLib, th=th_B1) lam1_B1.printPlies() laminates_B1 = [lam1_B1,lam2_B1,lam3_B1,lam4_B1] xsect_B1 = XSect(af2,xdim2,laminates_B1,matLib,typeXsect='box',meshSize=2) import time t1 = time.time() # With lu factorization xsect_B1.xSectionAnalysis() xsect_B1.printStiffMat() t2 = time.time() # With linalg.solve xsect_B1.xSectionAnalysis(linalgSolve=True)
lam3_B1 = Laminate(n_i_B1, m_i_B1, matLib, th=th_B1) lam4_B1 = Laminate(n_i_B1, m_i_B1, matLib, th=th_B1) lam1_B1.printPlies() laminates_B1 = [lam1_B1,lam2_B1,lam3_B1,lam4_B1] xsect_B1 = XSect(af2,xdim2,laminates_B1,matLib,typeXsect='box',meshSize=2) xsect_B1.xSectionAnalysis() xsect_B1.printStiffMat() strn = np.array([0.,0.,0.,0.,0.,1.0]) xsect_B1.strn2dspl(strn,figName='Validation Case B1',contour_Total_T=True) ''' # Layup 1 Box beam (0.5 x 0.923 in^2 box with laminate schedule [0]_6) n_i_Lay1 = [6] m_i_Lay1 = [2] th_Lay1 = [0] lam1_Lay1 = Laminate(n_i_Lay1, m_i_Lay1, matLib, th=th_Lay1) lam2_Lay1 = Laminate(n_i_Lay1, m_i_Lay1, matLib, th=th_Lay1) lam3_Lay1 = Laminate(n_i_Lay1, m_i_Lay1, matLib, th=th_Lay1) lam4_Lay1 = Laminate(n_i_Lay1, m_i_Lay1, matLib, th=th_Lay1) lam1_Lay1.printPlies() laminates_Lay1 = [lam1_Lay1,lam2_Lay1,lam3_Lay1,lam4_Lay1] xsect_Lay1 = XSect(af2,xdim2,laminates_Lay1,matLib,typeXsect='box',meshSize=2) xsect_Lay1.xSectionAnalysis() xsect_Lay1.printStiffMat() #xsect_Lay1.strn2dspl(strn,figName='Validation Case Layup 1',contour_Total_T=True) xsect_Lay1_off = XSect(af2,xdim2_off,laminates_Lay1,matLib,typeXsect='box',meshSize=2) xsect_Lay1_off.xSectionAnalysis() Ktmp = xsect_Lay1_off.K