abaaqus非線性屈曲分析自動(dòng)后處理腳本輸出應(yīng)力位移云圖、LPD曲線和最大應(yīng)力值
以下是針對(duì)abaaqus非線性屈曲分析后處理的代碼,其中輸出應(yīng)力位移云圖、LPD曲線和最大應(yīng)力值。
#```python
import numpy as np
import matplotlib.pyplot as plt
from abaqus import *
from abaqusConstants import *
from visualize import *
# 獲取ODB文件
odb = openOdb('job_name.odb')
# 獲取應(yīng)力和位移歷程數(shù)據(jù)
stressStrain = odb.steps['Step-1'].historyRegions['ElementSet 1'].historyOutputs['LE22'].data
# 獲取元素歷程數(shù)據(jù)
instance = odb.rootAssembly.instances['PART-1-1']
elemData = odb.steps['Step-1'].historyRegions['ElementSet 1'].historyOutputs['LE'].data
elemLabels = elemData[0][4:]
# 獲取最大應(yīng)力和LPD曲線
maxStress = np.max(stressStrain[:,1])
lpdData = odb.steps['Step-1'].historyRegions['ElementSet 1'].historyOutputs['LPD'].data
lpdTime = lpdData[:,0]
lpdValues = lpdData[:,1]
# 繪制應(yīng)力-位移曲線
plt.plot(stressStrain[:,0], stressStrain[:,1])
plt.xlabel('Strain')
plt.ylabel('Stress')
plt.title('Stress-Strain Curve')
plt.grid()
plt.show()
# 繪制應(yīng)力-位移云圖
plot = plotXYData(odb=odb, xyData=(('LE22',('E','EV')),),
? ? ? ? ? ? ? ? ?position=(25,'MIDDLE'))
plot.viewportAnnotationOptions.setValues(coordinates=(0.05,0.05))
plot.setValues(renderStyle=UNFILLED)
plot.setValues(lineWidth=1)
plot.setValues(markerSize=2)
plot.setValues(axisTitles=('', 'Stress'))
plot.setValues(legend=OFF)
plot.show()
# 繪制LPD曲線
plt.plot(lpdTime, lpdValues)
plt.xlabel('Time')
plt.ylabel('LPD')
plt.title('LPD Curve')
plt.grid()
plt.show()
# 輸出最大應(yīng)力值
print('The maximum stress is:', maxStress)
需要注意的是,其中的'job_name.odb'需要替換成實(shí)際的ODB文件名,另外需要根據(jù)自己的具體情況修改其他參數(shù)。

鏈接:https://pan.baidu.com/s/1zst2QwmMq604fnIYX3PWJw?
提取碼:hwc2?
--來自百度網(wǎng)盤超級(jí)會(huì)員V6的分享