# If the user wanted to apply a different constraint, they can just enter the # degrees of freedom to constrain on the model. This can be done by supplying # an array such as: [1,2,3,5]. Now let's apply a load. We will make two load # cases. In the first case, we are going to apply a simple tip load: load1 = {21:np.array([100.,100.,0.,0.,0.,100.])} # We can also create a function for a distributed load: 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)
xsect = sbeam1.xsect 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)
xsect = sbeam1.xsect 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