01
案例介紹
這個案例中主要介紹CivilFEM2018高級功能——Python腳步在結構建模、加載、分析與結構後處理各個過程中的應用。
案例分析了由杆件和彈簧組成的簡單結構,杆件一端固定,另一端與一線性彈簧連接,這端可以在垂直方向上移動,並受到30磅的集中荷載P,方向如下圖,加載隨時間變化而變化,最後達到30磅。
02
結構基本參數
03
使用Python構建結構模型
使用Python建模、定義截面屬性、材質、結構元素和劃分網格。
newDocument(&34;,&34;,&34;)
ConfigUnits.System = &34;
import matplotlib.pyplot as pl
import matplotlib.animation as animation
34;1&34;2&34;Truss&34;1&34;2& Materials and sections
createGenericMat(&34;,Double(1e+07),Double(0.3),Double(0),Double(0))
createGenericSection(&34;,&34;,Double(1),Double(1e-10),Double(1e-10),Double(0))
34;Truss&34;Truss_sect&34;Truss_sect&34;Truss&34;Truss&34;Spring&34;ToGround&34;Truss&34;Fit& Mesh
mesh()
04
施加荷載、定義邊界條件和荷載工況
施加時序荷載:
1s: 5lb; 4s: 8lb; 4.8s: 12 lb; 6.6s: 30lb
定義杆件兩端約束;
創建4個荷載工況。
34;Load_1&34;Load_1&34;Load&34;Truss&34;Load_4&34;Load_4&34;Load&34;Truss&34;Load_4_8&34;Load_4_8&34;Load&34;Truss&34;Load_6_6&34;Load_6_6&34;Load&34;Truss&34;BC&34;BC&34;1&34;Truss&34;2&34;Truss& LCs
createLoadCase(&34;)
loadCase1 = LoadCasesContainer.Find(&34;)
addLoadGroupToLoadCase([loadCase1],&34;,Double(1))
addBCGroupToLoadCase([loadCase1],&34;)
createLoadCase(&34;)
loadCase1 = LoadCasesContainer.Find(&34;)
addLoadGroupToLoadCase([loadCase1],&34;,Double(1))
addBCGroupToLoadCase([loadCase1],&34;)
loadCase1.LoadCaseCalculationTime = Double(4.0)
createLoadCase(&34;)
loadCase1 = LoadCasesContainer.Find(&34;)
addLoadGroupToLoadCase([loadCase1],&34;,Double(1))
addBCGroupToLoadCase([loadCase1],&34;)
loadCase1.LoadCaseCalculationTime = Double(4.8)
createLoadCase(&34;)
loadCase1 = LoadCasesContainer.Find(&34;)
addLoadGroupToLoadCase([loadCase1],&34;,Double(1))
addBCGroupToLoadCase([loadCase1],&34;)
loadCase1.LoadCaseCalculationTime = Double(6.6)
05
線性求解分析
solve()
34;LC_1_0s.rcf&34;UTy&34;LC_4_0s.rcf&34;UTy&34;LC_4_8s.rcf&34;UTy&34;LC_6_6s.rcf&34;UTy& Add individual solution controls to the LCs for the non linear case
loadCase1 = LoadCasesContainer.Find(&34;)
loadCase1.SolutionControl.IsParticularControl = True
loadCase1.SolutionControl.InitialTimeStep = Formula(&34;)
loadCase1.SolutionControl.MinimumTimeStep = Formula(&34;)
loadCase1.SolutionControl.MaximumTimeStep = Formula(&34;)
loadCase1 = LoadCasesContainer.Find(&34;)
loadCase1.SolutionControl.IsParticularControl = True
loadCase1.SolutionControl.InitialTimeStep = Formula(&34;)
loadCase1.SolutionControl.MinimumTimeStep = Formula(&34;)
loadCase1.SolutionControl.MaximumTimeStep = Formula(&34;)
loadCase1 = LoadCasesContainer.Find(&34;)
loadCase1.SolutionControl.IsParticularControl = True
loadCase1.SolutionControl.InitialTimeStep = Formula(&34;)
loadCase1.SolutionControl.MinimumTimeStep = Formula(&34;)
loadCase1.SolutionControl.MaximumTimeStep = Formula(&34;)
loadCase1 = LoadCasesContainer.Find(&34;)
loadCase1.SolutionControl.IsParticularControl = True
loadCase1.SolutionControl.InitialTimeStep = Formula(&34;)
loadCase1.SolutionControl.MinimumTimeStep = Formula(&34;)
loadCase1.SolutionControl.MaximumTimeStep = Formula(&34;)
ConfigSolver.CreateIntermediateNonLinearResults = True
ConfigSolver.LargeDeflections = True
solve()
34;LC_1_0s_&34;.rcf&34;UTy&34;LC_4_0s_&34;.rcf&34;UTy&34;LC_4_8s_&34;.rcf&34;UTy&34;LC_6_6s_&34;.rcf&34;UTy& Plot results
fig=pl.figure(figsize=(30, 10), dpi=72)
ax1 = pl.subplot(1, 3, 1)
F_lin=[0, 5, 8, 12, 30]
ax1.plot(D_lin, F_lin, marker=&39;, color=&34;, linewidth=1.0, linestyle=&34;, label=&39;)
F_n_lin=[]
for x in range (0,11):
F_n_lin.append(5.0/10.0*x)
for x in range (1,31):
F_n_lin.append(3.0/30.0*x+5.0)
for x in range (1,9):
F_n_lin.append(4.0/8.0*x+8.0)
for x in range (1,19):
F_n_lin.append(18.0/18.0*x+12.0)
39;.&34;red&34;-&39;Non-linear&39;upper left&39;Force(lbf)&39;Abs displacement (in)&39;Linear VS Non-linear& Animation of second subplot.
ax2 = pl.subplot(1, 3, 2)
ax2.plot([0,100], [0,1], marker=&39;, color=&34;, linewidth=1.0, linestyle=&34;, label=&39;)
line, =ax2.plot([0,100], [0,1-D_n_lin[i]], marker=&39;, color=&34;, linewidth=1.0, linestyle=&34;, label=&39;)
def animate(i):
line.set_data([0,100], [0,1-D_n_lin[i]])
return line,
ax2.set_title(&39;)
ax2.set_ylim(-1.8, 1.1)
ax2.set_xlim(0.0, 101)
ax2.set_ylabel(&39;)
ax2.set_xlabel(&39;)
ax2.grid(True)
line_ani = animation.FuncAnimation(fig, animate, frames=67, interval=5, blit=True)
CivilFEM2018整個分析過程都可以使用Python腳本,對於熟悉Python的用戶,這個功能可以大幅提升工作效率。
CivilFEM 2018 powered by Marc (簡稱CivilFEM)是一款高級非線性土木工程專用有限元商業軟體,由西班牙INGECIBER公司開發,該公司同時開發ANSYS/CIVILFEM土木模塊。獨立的CivilFEM商業軟體採用了Marc非線性求解器,方便易用的建模環境,快速高效的求解過程,豐富的後處理功能,CivilFEM2018正在成為土木工程師必備的卓越軟體工具。上海圖傑信息科技公司是CivilFEM2018在中國地區的銷售和技術支持機構。