model.addAircraftParts([wing1]) model.plotRigidModel(numXSects=10) # Apply the constraint for the model model.applyConstraints(0, 'fix') # CASE 1: # Apply the case load tipLoad = np.array([-10000., 100000., -300000., 35000., 60000., 10000.]) F = {40: tipLoad} model.applyLoads(1, F=F) # Run the analysis model.staticAnalysis(1) model.plotDeformedModel(figName='V8 Case 1',numXSects=10,contLim=[0,293000],\ warpScale=10,displScale=2,contour='sig_33') # Write the beam displacements and rotations to a file sbeam1.writeDisplacements(fileName='V8_Case_1.csv') # CASE 2: # Apply the case load def f(x): vx = -0.1 * (-1.0e3 * x[2]**2 + 6e7 * x[2] + 1.0e6) vy = (-1.0e3 * x[2]**2 + 6e7 * x[2] + 1.0e6) pz = 0 tz = .2 * c * (-1.0e3 * x[2]**2 + 6e7 * x[2] + 1.0e6) return np.array([vx, vy, pz, 0, 0, tz]) / 1.0e4 model.resetPointLoads()
nchord = 10 wing1.addLiftingSurface(1,x1,x2,x3,x4,nspan,nchord) # Make a FEM model model = Model() model.addAircraftParts([wing1]) # Apply the constraint for the model model.applyConstraints(0,'fix') model.plotRigidModel(numXSects=10) model.normalModesAnalysis() freqs = model.freqs ''' model.plotDeformedModel(mode=1,figName='mode 1',numXSects=10,displScale=2) model.plotDeformedModel(mode=2,figName='mode 2',numXSects=10,displScale=2) model.plotDeformedModel(mode=3,figName='mode 3',numXSects=10,displScale=2) model.plotDeformedModel(mode=4,figName='mode 4',numXSects=10,displScale=2) model.plotDeformedModel(mode=5,figName='mode 5',numXSects=10,displScale=2) model.plotDeformedModel(mode=6,figName='mode 6',numXSects=10,displScale=2) model.plotDeformedModel(mode=7,figName='mode 7',numXSects=10,displScale=2) ''' ''' model.plotDeformedModel(mode=1,figName='mode 1',numXSects=10,displScale=2) model.plotDeformedModel(mode=2,figName='mode 2',numXSects=10,displScale=2) model.plotDeformedModel(mode=3,figName='mode 3',numXSects=10,displScale=2) model.plotDeformedModel(mode=4,figName='mode 4',numXSects=10,displScale=2) model.plotDeformedModel(mode=5,figName='mode 5',numXSects=10,displScale=2)
model.addElements([sbeam1]) # Now that our beam is loaded into the FEM, let's visualize it! model.plotRigidModel(numXSects=8) # First let's constrain the beam at it's root. Since we only added one # superbeam and we never specified a starting node ID, we know that the first # node ID is actually 1! So when we constrain the model, we can just select: model.applyConstraints(1, "fix") model.normalModesAnalysis(analysis_name="normal modes") # For now, the frequencies can be accessed via the model attribute 'freqs' Frequencies = model.freqs # Let's plot the first mode: model.plotDeformedModel( analysis_name="normal modes", figName="Normal Modes 1", numXSects=10, contour="none", warpScale=1, displScale=50, mode=1, ) # How about the second? model.plotDeformedModel( analysis_name="normal modes", figName="Normal Modes 2", numXSects=10, contour="none", warpScale=1, displScale=50, mode=2, ) # How about the third? It happens to be the torsional mode.
vy = 10*x[2]**2-7*x[2] pz = 0 mx = 0 my = 0 tz = (10*x[2]**2-7*x[2])/10+3*x[0]**2 return np.array([vx,vy,pz,mx,my,tz]) # Ok now let's add these loads to the model: model.applyLoads(1,F=load1) # Notice that when I applied a tip load, I did it using the argument 'F'. When # we apply a distributed load function, we use the argument 'f' instead. model.applyLoads(2,f=load2,allElems=True) # Now with constraints and loads, we can run a static analysis! Let's run the # first load case. model.staticAnalysis(1,analysis_name='tip load') # Let's see what results we get: model.plotDeformedModel(analysis_name='tip load',figName='Tip Load Analysis',\ numXSects=8,contour='VonMis',contLim=[0,1e5],warpScale=50,displScale=10) # Now let's try analyzing the distributed load: model.staticAnalysis(2,analysis_name='distributed load') # Let's see what results we get for the distributed load: model.plotDeformedModel(analysis_name='distributed load',\ figName='Distributed Load Analysis',numXSects=8,contour='VonMis',\ contLim=[0,1e5],warpScale=50,displScale=10) # Really quickly, let's discuss some of the keywords used in the analysis and # plotting. The analysis_name designates the name where the results should be # stored for the beam. Therefore if you want to keep multiple results stored # at once you can give it a name. Otherwise this will always result to the # default name. figName is just the name of the MayaVi figure, and numXSects # designates how many cross-sections should be plotted. Note that the more # cross-sections are plotted, the slower the plotting process will be. Both # contour, contLim and warpScale were discussed in Tutorial 3. displScale is # the scalling factor applied to the beam displacements and rotations.
# Make a FEM model model = Model() model.addAircraftParts([wing1]) model.plotRigidModel(numXSects=10) # Apply the constraint for the model model.applyConstraints(0, 'fix') #cProfile.run('model.normalModesAnalysis()',sort='tottime') # Composite Normal Mode Analysis model.normalModesAnalysis() freqs = model.freqs ''' model.plotDeformedModel(figName='Normal Mode 1',numXSects=10,contLim=[0,293000],\ warpScale=25,displScale=10,contour='none',mode=1) model.plotDeformedModel(figName='normalMode 2',numXSects=10,contLim=[0,293000],\ warpScale=25,displScale=10,contour='none',mode=2) model.plotDeformedModel(figName='normalMode 3',numXSects=10,contLim=[0,293000],\ warpScale=25,displScale=10,contour='none',mode=3) model.plotDeformedModel(figName='normalMode 4',numXSects=10,contLim=[0,293000],\ warpScale=25,displScale=10,contour='none',mode=4) model.plotDeformedModel(figName='normalMode 5',numXSects=10,contLim=[0,293000],\ warpScale=25,displScale=10,contour='none',mode=5) ''' # Flutter Analysis # Note units are inches, seconds, and pounds U_vec = np.linspace(1, 100, 100)
noe = 40 # Now let's make the superbeam sbeam1 = SuperBeam(SBID, x1, x2, xsect_Lay3, noe) model = Model() # Easy right? Now let's add the superbeam to the model. model.addElements([sbeam1]) # Now that our beam is loaded into the FEM, let's visualize it! model.plotRigidModel(numXSects=8) # First let's constrain the beam at it's root. Since we only added one # superbeam and we never specified a starting node ID, we know that the first # node ID is actually 1! So when we constrain the model, we can just select: model.applyConstraints(1, 'fix') model.normalModesAnalysis(analysis_name='normal modes') # For now, the frequencies can be accessed via the model attribute 'freqs' Frequencies = model.freqs # Let's plot the first mode: model.plotDeformedModel(analysis_name='normal modes',\ figName='Normal Modes 1',numXSects=10,contour='none',\ warpScale=1,displScale=50,mode=1) # How about the second? model.plotDeformedModel(analysis_name='normal modes',\ figName='Normal Modes 2',numXSects=10,contour='none',\ warpScale=1,displScale=50,mode=2) # How about the third? It happens to be the torsional mode. model.plotDeformedModel(analysis_name='normal modes',\ figName='Normal Modes 3',numXSects=10,contour='none',\ warpScale=1,displScale=25,mode=3) model.plotDeformedModel(analysis_name='normal modes',\ figName='Normal Modes 3',numXSects=10,contour='none',\ warpScale=1,displScale=25,mode=3)
model.addAircraftParts([wing1]) model.plotRigidModel(numXSects=10) # Apply the constraint for the model model.applyConstraints(0,'fix') # CASE 1: # Apply the case load tipLoad = np.array([-10000.,100000.,-300000.,35000.,60000.,10000.]) F = {40:tipLoad} model.applyLoads(1,F=F) # Run the analysis model.staticAnalysis(1) model.plotDeformedModel(figName='V8 Case 1',numXSects=10,contLim=[0,293000],\ warpScale=10,displScale=2,contour='sig_33') # Write the beam displacements and rotations to a file sbeam1.writeDisplacements(fileName = 'V8_Case_1.csv') # CASE 2: # Apply the case load def f(x): vx = -0.1*(-1.0e3*x[2]**2+6e7*x[2]+1.0e6) vy = (-1.0e3*x[2]**2+6e7*x[2]+1.0e6) pz = 0 tz = .2*c*(-1.0e3*x[2]**2+6e7*x[2]+1.0e6) return np.array([vx,vy,pz,0,0,tz])/1.0e4 model.resetPointLoads() model.applyLoads(1,f=f,allElems=True) # Run the analysis model.staticAnalysis(1)