def load2(x): vx = (1/10)*10*x[2]**2-7*x[2]-2.1 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
model = Model() 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 = Model() 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)