1.利用abaqus与python制作常用材料插件Material。
学习abaqus中自带的rsg与录制功能,获取输入材料代码格式,利用python进行修改,达到可以通过插件添加常用材料的功能,减少手动输入材料性能的时间。
为了实现在不同model与filed下的材料输入,添加了选择model与field的选项。
具体代码如下:
# -*- coding: mbcs -*-
# Do not delete the following import lines
from abaqus import *
from abaqusConstants import *
import __main__
#The name of model,material,field
def defined(Model,Name,Field):
import material
import part
model=str(Model)
#Supporting material
if Name == "SM400A" or "S303" or "A7N01":
if Name == "SM400A":
mdb.models[model].Material(name="SM400A")
# Using TEMP material
if Field == "TEMP":
mdb.models[model].materials['SM400A'].Density(temperatureDependency=ON,
table=(
(7.8e-09, 0.0), (7.73e-09, 300.0), (7.69e-09, 600.0),
(7.68e-09,
700.0), (7.67e-09, 750.0), (7.66e-09, 800.0),
(7.63e-09, 900.0), (
7.63e-09, 1200.0), (7.62e-09, 1400.0),
(7.61e-09, 1450.0), (7.6e-09,
1500.0)))
mdb.models[model].materials['SM400A'].Conductivity(
temperatureDependency=ON, table=((51.0, 0.0), (47.0, 300.0), (38.0,
600.0), (33.0, 700.0), (31.0, 750.0),
(29.0, 800.0), (30.0, 900.0), (
31.0, 1200.0), (32.0, 1400.0), (33.0, 1450.0),
(111.0, 1500.0)))
mdb.models[model].materials['SM400A'].SpecificHeat(
temperatureDependency=ON, table=((420000000.0, 0.0), (600000000.0,
300.0), (820000000.0, 600.0),
(900000000.0, 700.0), (1200000000.0,
750.0), (710000000.0, 800.0),
(720000000.0, 900.0), (760000000.0,
1200.0), (790000000.0, 1400.0),
(1110000000.0, 1450.0), (822000000.0,
1500.0)))
# Using MECH material
elif Field == "MECH":
mdb.models[model].materials['SM400A'].Density(temperatureDependency=ON,
table=(
(7.8e-09, 0.0), (7.73e-09, 300.0), (7.69e-09, 600.0),
(7.68e-09,
700.0), (7.67e-09, 750.0), (7.66e-09, 800.0),
(7.63e-09, 900.0), (
7.63e-09, 1200.0), (7.62e-09, 1400.0),
(7.61e-09, 1450.0), (7.6e-09,
1500.0)))
mdb.models[model].materials['SM400A'].Conductivity(
temperatureDependency=ON, table=((51.0, 0.0), (47.0, 300.0), (38.0,
600.0), (33