- 积分
- 0
- 注册时间
- 2010-10-2
- 仿真币
-
- 最后登录
- 1970-1-1
|
发表于 2014-2-21 16:30:47
|
显示全部楼层
来自 美国
好吧,完整代码贴出来大家参考一下。
说明:1. 代码主要基于楼主代码稍作修改,不用GUI干预操作,可以完全自动完成建模、求解以及结果查看;
2. 新手,结果不知道准确与否,不对之处还望各位大神指正
finish
/clear, nostart
/filname, Acoustics_Plate_v01
/title, Acoustics Analysis Example
! ---------------------------------------
! define element type and material parameters
! ---------------------------------------
/prep7
et, 1, solid45 ! used for shell modeling
et, 2, fluid30 ! 3D acoustic fluid element
et, 3, fluid130 ! 3D infinite acoustic element
r, 3, 0.3, 0, 0
et, 4, fluid30, , 1, 0 ! acoustic fluid element with pres degrees of freedom
mp, ex, 1, 2.1e11 ! material 1 - steel, elastic modulus
mp, dens, 1, 7800 ! density
mp, nuxy, 1, 0.3 ! poission ratio, or "mp, prxy, 1, 0.3"
mp, dens, 2, 1.21 ! material 2 - air
mp, sonc, 2, 344
! create the model
wprota, 0, -90, 0 ! rotate workplane
sphere, , 0.3, 0, 180 ! SPHERE, RAD1, RAD2, THETA1, THETA2
wprota, 0, 90, 0
block, 0, 0.1, -0.002, 0.002, -0.1, 0 ! BLOCK, X1, X2, Y1, Y2, Z1, Z2
block, -0.1, 0, -0.002, 0.002, -0.1, 0
vglue, 2, 3
vovlap, 1, 2 ! overlaps volumes
vovlap, 3, 4
! mesh volume 2
lesize, 9, , , 20, 1
lesize, 19, , , 20, 1
lesize, 14, , , 20, 1
lesize, 18, , , 20, 1
lesize, 11, , , 20, 1
lesize, 16, , , 20, 1
lesize, 12, , , 20, 1
lesize, 17, , , 20, 1
lesize, 8, , , 4, 1
lesize, 15, , , 4, 1
lesize, 13, , , 4, 1
lesize, 10, , , 4, 1
vsel, s, , , 2
vatt, 1, , 1 ! associates element attributes
mshkey, 1 ! use mapped meshing
vmesh, 2
allsel
! mesh volumn 4
lesize, 32, , , 20, 1
lesize, 31, , , 20, 1
lesize, 35, , , 20, 1
lesize, 33, , , 20, 1
lesize, 28, , , 20, 1
lesize, 34, , , 20, 1
lesize, 20, , , 4, 1
lesize, 27, , , 4, 1
vsel, s, , , 4
vatt, 1, , 1
mshape, 0, 3D ! specifies the element shape to be used for meshing, quadrilateral-shaped elements
mshkey, 1 ! use mapped meshing
vmesh, 4
allsel
! mesh volume 1
vsel, s, , , 1
vatt, 2, , 2 ! air medium
smrtsize, 1 ! specifies meshing parameters for automatic (smart) element sizing
mshape, 1, 3D ! specifies the element shape to be used for meshing, triangle-shaped elements
mshkey, 0 ! free mesh
vmesh, 1
allsel
! 修改不与平板(结构)接触单元的材料类型类型为空气介质(不与结构耦合)
esel, s, type, , 1
nsle, s
esln, s, 0
nsle, s
esel, inve
nsle, s
emodif, all, type, 4
allsel
! 在边界生成吸收单元(使用单元fluid130)
asel, s, , , 1, 2
nsla, s, 1
type, 3
real, 3
mat, 2
esurf ! generates elements overlaid on the free faces of existing selected elements
allsel
! 建立流-固接触面
asel, s, , , 8
asel, a, , , 10
asel, a, , , 7
asel, a, , , 5
asel, a, , , 19
asel, a, , , 15
asel, a, , , 17
asel, a, , , 20
nsla, s, 1
esel, s, type, , 2
sf, all, fsi, 1 ! specifies surface loads on nodes, fluid-structure interaction flag
allsel
csys, 0 ! activates cartesian coordinate system
wpcsys, -1, 0 ! defines the working plane location based on a coordinate system
mat, 1
real, 1
type, 1
! ---------------------------------------
! harmonic analysis
! ---------------------------------------
! 第一种后处理方式,得到空气介质的声压分布,单位为分贝
/solu
antype, harmic
hropt, full
f, 131, fY, 1000 ! apply load
nsubst, 10
kbc, 1 ! steped load
harfrq, 337, 337 ! defines the frequency range in the harmonic responese analysis
allsel
solve
! ---------------------------------------
! view result
! ---------------------------------------
! 对与结构耦合的空气单元和未与结构耦合的空气单元进行后处理,得到声压分布
/post1
set, first
esel, s, type, , 2
esel, a, type, , 4
plesol, nmisc, 4, 0, 1.0
|
|