最新消息: USBMI致力于为网友们分享Windows、安卓、IOS等主流手机系统相关的资讯以及评测、同时提供相关教程、应用、软件下载等服务。

ansys分析五道焊缝

IT圈 admin 27浏览 0评论

2024年10月13日发(作者:袭依波)

!非线性材料求解成功GAUSS分布Z向扫描!

!考虑了和基板对流情况下加载热流密度的热分析

rb=0.15mm

!粉床7.8X3.3mm,烧结区域6X1.5mm

!考虑粉床表面的辐射、对流

!考虑粉末状、熔化状(液态)、凝固态的边界条件

变化

!考虑金属蒸发会带走一部分能量,故效率减半eff

=0.7

!r=0.2mm

FINISH

/CLEAR,START

/BATCH

/CWD,'d:AnsysworkEBM FEM Simulation for

Metals3D Temperture distrbution'

/FILNAME,EBM_db,0

/TITLE,3D Temperture distrbution

!选择分析问题的类型:热

/NOPR

/PMETH,OFF,0

KEYW,PR_SET,1

KEYW,PR_STRUC,0

KEYW,PR_THERM,1

KEYW,PR_FLUID,0

KEYW,PR_ELMAG,0

KEYW,MAGNOD,0

KEYW,MAGEDG,0

KEYW,MAGHFE,0

KEYW,MAGELC,0

KEYW,PR_MULTI,0

KEYW,PR_CFD,0

/GO

/UNITS,SI !Standard Units

!*******************************************

!开始,进入前处理器,定义下列属性-

!0参数定义

!1定义单元类型

!2实常数

!3材料性能

!4几何模型

!5网格划分控制

!6其他

!**************************************!

/PREP7

!0参数定义

!模型参数

!几何模型尺寸me-3=mm

*SET,Block_x,7.8e-3

*SET,Block_x1,0.9e-3

*SET,Block_x2,6.9e-3

*SET,Block_y,3.3e-3

*SET,Block_y1,0.9e-3

*SET,Block_y2,2.4e-3

*SET,Block_z,0.3e-3

*SET,Block_z1,0.9e-3

!划分网格的大小

*SET,LMeshx,3e-4 !line1

*SET,LMeshy,3e-4 !line4

*SET,LMeshz,3e-4 !line9

!边界条件参数

*SET,Tinit,30 !初始温度

!1定义单元类型

ET,1,SOLID70

et,2,surf152 !表面效应单元

r,2

KEYOPT,2,4,1 !表面效应单元设置

KEYOPT,2,8,4

ET,3,SOLID87

!2实常数

!Nothing

!3材料性能

MPTEMP

MPTEMP,1,25,400,1200,1600,2000,2500

MPDATA,DENS,1,1,3983,4688.4,5406.8,5948.8,690

8,6331 !密度

MPDATA,KXX,1,1,1.6278,2.3812,3.6396,29.8,30.6,3

2 !热导率

mpdata,c,1,1,472,535,679,859,945,1034 !比热

MPTEMP,,,,,,,,

MPTEMP,1,0,200,400,800,1200

MPTEMP,6,1400,1454,1800,2000

MPDATA,ENTH,1,1,0,7.9729e+8,1.6400e+9,3.4621e

+9,5.3897e+9

MPDATA,ENTH,1,6,6.3415e+9,8.2595e+9,9.8798e+

9,1.0816e+10 !热焓

MPTEMP,,,,,,,,

MPTEMP,1,20,300,600,900,1200,1500,1800,2000,30

00,4000

MPDATA,HF,1,1,6,50,120,200,250,378,700,850,1746

,3799 !对流系数

MPTEMP,,,,,,,,

MPTEMP,1,20,200,400,600,800,900,1000,1100,1200,

1420,1460

MPDATA,DENS,2,1,7966,7893,7814,7724,7630,758

3,7535,7486,7436,7320,7320

MPDATA,KXX,2,1,13.31,16.33,19.47,22.38,25.07,26

.33,27.53,28.67,29.76,31.95,32 !热导率

mpdata,c,2,1,470,508,550,592,634,655,676,698,719,7

65,765

MPTEMP,,,,,,,,

MPTEMP,1,0,200,400,800,1200

MPTEMP,6,1400,1454,1800,2000

MPDATA,ENTH,2,1,0,7.9729e+8,1.6400e+9,3.4621e

+9,5.3897e+9

MPDATA,ENTH,2,6,6.3415e+9,8.2595e+9,9.8798e+

9,1.0816e+10

!4几何模型

BLOCK,0,Block_x,0,Block_y,0,Block_z,

BLOCK,Block_x1,Block_x2,Block_y1,Block_y2,0,Bl

ock_z,

vsel,all

VOVLAP,all

BLOCK,0,Block_x,0,Block_y,0,-Block_z1,

vglue,all

numcmp,all

!划分网格

lesize,8,LMeshx

lesize,5,LMeshy

lesize,13,LMeshz

vsel,s,,,1

type,1

mat,1

mshkey,1

vmesh,all

allsel

esize,0.3e-3

mshkey,0

mshape,1,3d

vsel,s,,,2

type,3

mat,2

vmesh,all

allsel

esize,0.3e-3

mshkey,0

mshape,1,3d

vsel,s,,,3

type,3

mat,1

vmesh,all

allsel

!成形件轨迹单元质心排序

width=Block_y2-Block_y1

!wpoffs,Block_x1,Block_y1,0

!local,11,1,Block_x1,Block_y1,0

ALLSEL,ALL

*GET,EMAX,ELEM,,COUNT,MAX

VSEL,S, , , 1

ESLV,S

*GET,AEMAX,ELEM,,COUNT1,MAX

*DIM,ANE,ARRAY,AEMAX,

*DIM,ANE1,ARRAY,AEMAX,

*DIM,ANE2,ARRAY,AEMAX,

*DIM,ANE3,ARRAY,AEMAX,

*DIM,ANE4,ARRAY,AEMAX,

*DIM,ANE5,ARRAY,AEMAX,

*DIM,ANEX,ARRAY,AEMAX

*DIM,ANEY,ARRAY,AEMAX

*DIM,ANEZ,ARRAY,AEMAX

*DIM,ANEORDER,ARRAY,AEMAX,,1

!形心排序

VSEL,S, , , 1

ESLV,S

*GET,ANSEL,ELEM,,COUNT1

II=0

*DO,I,1,AEMAX

*IF,ESEL(I),EQ,1,THEN

II=II+1

ANE(II)=I

*ENDIF

b=0

*do,i,1,AEMAX

*if,ANEY(I),ge,width/5+Block_y1,then

*if,ANEY(I),lt,2*width/5+Block_y1,then

*ENDDO

*DO,I,1,ANSEL

*GET,ANEZ(I),ELEM,ANE(I),CENT,Z

*GET,ANEY(I),ELEM,ANE(I),CENT,Y

*GET,ANEX(I),ELEM,ANE(I),CENT,X

*ENDDO

e=0

*do,i,1,AEMAX

*if,ANEY(I),ge,4*width/5+Block_y1,then

e=e+1

ANE5(e)=ANE(i)

*endif

*enddo

d=0

*do,i,1,AEMAX

*if,ANEY(I),ge,3*width/5+Block_y1,then

*if,ANEY(I),lt,4*width/5+Block_y1,then

d=d+1

ANE4(d)=ANE(i)

*endif

*endif

*enddo

c=0

*do,i,1,AEMAX

*if,ANEY(I),ge,2*width/5+Block_y1,then

*if,ANEY(I),lt,3*width/5+Block_y1,then

c=c+1

ANE3(c)=ANE(i)

*endif

*endif

*enddo

b=b+1

ANE2(b)=ANE(i)

*endif

*endif

*enddo

a=0

*do,i,1,AEMAX

*if,ANEY(I),lt,width/5+Block_y1,then

a=a+1

ANE1(a)=ANE(i)

*endif

*enddo

!*******对1道焊缝区的单元按质心X坐标进行从

低到高排序********

esel,none

*do,i,1,a

*if,ANE1(i),NE,0,then

esel,a,elem,,ANE1(i)

*endif

*enddo

MINE=0

*DIM,ANEX1,ARRAY,a

*DIM,ANEY1,ARRAY,a

*DIM,ANEZ1,ARRAY,a

*DO,I1,1, a

esel,u,elem,,mine

*GET,ANSEL1,ELEM,,COUNT1

II=0

*DO,I,1,AEMAX

*IF,ESEL(I),EQ,1,THEN

II=II+1

ANE1(II)=I

*ENDIF

*ENDDO

*DO,I,1,ANSEL1

*GET,ANEZ1(I),ELEM,ANE1(I),CENT,Z

*GET,ANEY1(I),ELEM,ANE1(I),CENT,Y

*GET,ANEX1(I),ELEM,ANE1(I),CENT,X

*ENDDO

MINZ=1E20

MINY=1E20

MINX=1E20

*DO,I,1,ANSEL1

*IF,ANEZ1(I),LT,MINZ,THEN

MINZ=ANEZ1(I)

MINY=ANEY1(I)

MINX=ANEX1(I)

MINE=ANE1(I)

*ELSE

*IF,ANEZ1(I),EQ,MINZ,THEN

*IF,ANEY1(I),LT,MINY,THEN

MINZ=ANEZ1(I)

MINY=ANEY1(I)

MINX=ANEX1(I)

MINE=ANE1(I)

*ELSE

*IF,ANEY1(I),EQ,MINY,THEN

*IF,ANEX1(I),LT,MINX,THEN

MINZ=ANEZ1(I)

MINY=ANEY1(I)

MINX=ANEX1(I)

MINE=ANE1(I)

*ENDIF

*ENDIF

*ENDIF

*ENDIF

*ENDIF

*ENDDO

ANEORDER(I1)=MINE

*ENDDO

!********对2道焊缝区的单元按质心X坐标进行

从高到低排序******

MAXE=1

esel,none

*do,j,1,b

*if,ANE2(j),NE,0,then

esel,a,elem,,ANE2(j)

*endif

*enddo

*DIM,ANEX2,ARRAY,b

*DIM,ANEY2,ARRAY,b

*DIM,ANEZ2,ARRAY,b

*DO,J1,1, b

esel,u,elem,,MAXE

*GET,ANSEL2,ELEM,,COUNT1

JJ=0

*DO,J,1,AEMAX

*IF,ESEL(I),EQ,1,THEN

JJ=JJ+1

ANE2(JJ)=J

*ENDIF

*ENDDO

*DO,J,1,ANSEL2

*GET,ANEZ2(J),ELEM,ANE2(J),CENT,Z

*GET,ANEY2(J),ELEM,ANE2(J),CENT,Y

*GET,ANEX2(J),ELEM,ANE2(J),CENT,X

*ENDDO

MAXZ=1E20

MAXY=1E20

MAXX=-1E20

*DO,J,1,ANSEL2

*IF,ANEZ2(J),LT,MAXZ,THEN

MAXZ=ANEZ2(J)

MAXY=ANEY2(J)

MAXX=ANEX2(J)

MAXE=ANE2(J)

*ELSE

*IF,ANEZ2(J),EQ,MAXZ,THEN

*IF,ANEY2(J),LT,MAXY,THEN

MAXZ=ANEZ2(J)

MAXY=ANEY2(J)

MAXX=ANEX2(J)

MAXE=ANE2(J)

*ELSE

*IF,ANEY2(J),EQ,MAXY,THEN

*IF,ANEX2(J),GT,MAXX,THEN

MAXZ=ANEZ2(J)

MAXY=ANEY2(J)

MAXX=ANEX2(J)

MAXE=ANE2(J)

*ENDIF

*ENDIF

*ENDIF

*ENDIF

*ENDIF

*ENDDO

ANEORDER(J1+a)=MAXE

*ENDDO

!********对3道焊缝区的单元按质心X坐标进行

从低到高排序******

MINE=1

esel,none

*do,k,1,c

*if,ANE3(k),NE,0,then

esel,a,elem,,ANE3(k)

*endif

*enddo

*DIM,ANEX3,ARRAY,c

*DIM,ANEY3,ARRAY,c

*DIM,ANEZ3,ARRAY,c

*DO,K1,1, c

esel,u,elem,,mine

*GET,ANSEL3,ELEM,,COUNT1

KK=0

*DO,K,1,AEMAX

*IF,ESEL(K),EQ,1,THEN

KK=KK+1

ANE3(KK)=K

*ENDIF

*ENDDO

*DO,K,1,ANSEL3

*GET,ANEZ3(K),ELEM,ANE3(K),CENT,Z

*GET,ANEY3(K),ELEM,ANE3(K),CENT,Y

*GET,ANEX3(K),ELEM,ANE3(K),CENT,X

*ENDDO

MINZ=1E20

MINY=1E20

MINX=1E20

*DO,K,1,ANSEL3

*IF,ANEZ3(K),LT,MINZ,THEN

MINZ=ANEZ3(K)

MINY=ANEY3(K)

MINX=ANEX3(K)

MINE=ANE3(K)

*ELSE

*IF,ANEZ3(K),EQ,MINZ,THEN

*IF,ANEY3(K),LT,MINY,THEN

MINZ=ANEZ3(K)

MINY=ANEY3(K)

MINX=ANEX3(K)

MINE=ANE3(K)

*ELSE

*IF,ANEY3(K),EQ,MINY,THEN

*IF,ANEX3(K),LT,MINX,THEN

MINZ=ANEZ3(K)

MINY=ANEY3(K)

MINX=ANEX3(K)

MINE=ANE3(K)

*ENDIF

*ENDIF

*ENDIF

*ENDIF

*ENDIF

*ENDDO

ANEORDER(K1+a+b)=MINE

*ENDDO

!*******对4道焊缝区的单元按质心X坐标进行从

高到低排序******

MAXE=1

esel,none

*do,j,1,d

*if,ANE4(j),NE,0,then

esel,a,elem,,ANE4(j)

*endif

*enddo

*DIM,ANEX4,ARRAY,d

*DIM,ANEY4,ARRAY,d

*DIM,ANEZ4,ARRAY,d

*DO,J1,1, d

esel,u,elem,,MAXE

*GET,ANSEL4,ELEM,,COUNT1

JJ=0

*DO,J,1,AEMAX

*IF,ESEL(I),EQ,1,THEN

JJ=JJ+1

ANE2(JJ)=J

*ENDIF

*ENDDO

*DO,J,1,ANSEL4

*GET,ANEZ4(J),ELEM,ANE4(J),CENT,Z

*GET,ANEY4(J),ELEM,ANE4(J),CENT,Y

*GET,ANEX4(J),ELEM,ANE4(J),CENT,X

*ENDDO

MAXZ=1E20

MAXY=1E20

MAXX=-1E20

*DO,J,1,ANSEL4

*IF,ANEZ4(J),LT,MAXZ,THEN

MAXZ=ANEZ4(J)

MAXY=ANEY4(J)

MAXX=ANEX4(J)

MAXE=ANE4(J)

*ELSE

*IF,ANEZ4(J),EQ,MAXZ,THEN

*IF,ANEY4(J),LT,MAXY,THEN

MAXZ=ANEZ4(J)

MAXY=ANEY4(J)

MAXX=ANEX4(J)

MAXE=ANE4(J)

*ELSE

*IF,ANEY4(J),EQ,MAXY,THEN

*IF,ANEX4(J),GT,MAXX,THEN

MAXZ=ANEZ4(J)

MAXY=ANEY4(J)

MAXX=ANEX4(J)

MAXE=ANE4(J)

*ENDIF

*ENDIF

*ENDIF

*ENDIF

*ENDIF

*ENDDO

ANEORDER(J1+a+b+c)=MAXE

*ENDDO

!********对5道焊缝区的单元按质心X坐标进行

从低到高排序*****

esel,none

*do,i,1,e

*if,ANE5(i),NE,0,then

esel,a,elem,,ANE5(i)

*endif

*enddo

MINE=1

*DIM,ANEX5,ARRAY,e

*DIM,ANEY5,ARRAY,e

*DIM,ANEZ5,ARRAY,e

*DO,I1,1, e

esel,u,elem,,mine

*GET,ANSEL5,ELEM,,COUNT1

II=0

*DO,I,1,AEMAX

*IF,ESEL(I),EQ,1,THEN

II=II+1

ANE5(II)=I

*ENDIF

*ENDDO

*DO,I,1,ANSEL5

*GET,ANEZ5(I),ELEM,ANE5(I),CENT,Z

*GET,ANEY5(I),ELEM,ANE5(I),CENT,Y

*GET,ANEX5(I),ELEM,ANE5(I),CENT,X

*ENDDO

MINZ=1E20

MINY=1E20

MINX=1E20

*DO,I,1,ANSEL1

*IF,ANEZ5(I),LT,MINZ,THEN

MINZ=ANEZ5(I)

MINY=ANEY5(I)

MINX=ANEX5(I)

MINE=ANE5(I)

*ELSE

*IF,ANEZ5(I),EQ,MINZ,THEN

*IF,ANEY5(I),LT,MINY,THEN

MINZ=ANEZ5(I)

MINY=ANEY5(I)

MINX=ANEX5(I)

MINE=ANE5(I)

*ELSE

*IF,ANEY5(I),EQ,MINY,THEN

*IF,ANEX5(I),LT,MINX,THEN

MINZ=ANEZ5(I)

MINY=ANEY5(I)

MINX=ANEX5(I)

MINE=ANE5(I)

*ENDIF

*ENDIF

*ENDIF

*ENDIF

*ENDIF

*ENDDO

ANEORDER(I1+a+b+c+d)=MINE

*ENDDO

!成形件轨迹单元质心排序

FINISH

!*********************体热源加载求解

************

/SOL

ANTYPE,4 !瞬态分析

TRNOPT,FULL !指定瞬态分析选项

eqslv !指定求解器

solcontrol,on !求解控制(用优化求解器)

ESEL,ALL

EPLOT

/AUTO,1

/REPLOT

allsel,all

outres,all,all

TOFFST,273

tunif,24

kbc,1

timint,on

nsub1=2

nsub2=20

asel,s,loc,z,Block_z !加对流条

asel,a,loc,x,0

asel,a,loc,x,Block_x

asel,a,loc,y,0

asel,a,loc,y,Block_y

nsla

sf,all,conv,-1,24

allsel

dt=3e-2 ! 定义每次成形

所需要的时间

tim=0

!生死单元控制

!*DO,I1,1,AEMAX

! ESEL,S,,,ANEORDER(I1)

! EKILL,ALL

! ESEL,S,LIVE

! EPLOT

!*enddo

j=aemax !j小于AEmax

*DO,I1,1,j

nsubst,,,,1

esel,s,,,ANEORDER(I1)

! EALIVE,ANEORDER(I1-1)

! ESEL,S,LIVE

EPLOT

! *ENDIF

esel,all

EPLOT

!***************体载荷加载*********

tim=tim+dt

time,tim

!bfe,ANEORDER(I1),hgen,1,3.91e12

bfe,ANEORDER(I1),hgen,1,4.63e12*0.7!0.6

T_end=300

!*************************************

SOLVE

bfedele,ANEORDER(I1),hgen

*ENDDO

/solu

ANTYPE,,rest

bfedele,all,hgen

time,4 !step101开始完全冷却

NSUBST,15,30,5

solve

save

time,5 !step102开始完全冷却

NSUBST,15,30,5

solve

save

time,6 !step103开始完全冷却

NSUBST,15,30,5

solve

save

time,7 !step104开始完全冷却

NSUBST,15,30,5

solve

save

time,8 !step105开始完全冷却

NSUBST,15,30,5

solve

save

time,9 !step106开始完全冷却

NSUBST,15,30,5

solve

save

time,10 !step107开始完全冷却

NSUBST,15,30,5

solve

save

time,30 !step108开始完全冷却

NSUBST,15,30,5

solve

save

time,300 !step109开始完全冷却

NSUBST,15,30,5

solve

save

!************生成节点温度分布云图动画文件的

程序段**************

/VIEW,1,1,2,3

/ANG,1

/REP,FAST

/post1

/seg,dele

!/cont,1,15,0,3500/16,3500

/dscale,1,1.0

avprin,0,0

avres,1

/seg,multi,temp1,0.1

esel,all

*do,i,1,37

set,(i-1)*3+1

plnsol,temp

*enddo

/seg,off,temp37,1

/anfile,save,temp37,avi

/image,save,temp37,jpeg

anim,1,1,1

finish

!***********************************进入后处

理**************

/post26 ! 进入时

间历程后处理器

nsol,2,138,temp,,temp138 ! 取出(3.9,

0.9,0.3)的温度值并赋给变量2号

nsol,3,163,temp,,temp163 ! 取出(3.9,

2.4,0.3)的温度值并赋给变量3号

nsol,4,249,temp,,temp249 ! 取出(6.6,

1.2,0.3)的温度值并赋给变量3号

nsol,5,154,temp,,temp154 ! 取出(6.6,

2.4,0.3)的温度值并赋给变量3号

!nsol,4,149,temp,,temp149 ! 取出(6.9,

1.2,0.3)的温度值并赋给变量3号

!nsol,5,148,temp,,temp148 ! 取出(6.9,

2.4,0.3)的温度值并赋给变量3号

/gropt,axnsc,1.5, ! 缩放图标

字体的大小

plvar,2,3 ! 图形显示

变量2,3号

!prvar,2,3

/image,save,temp23,jpeg ! 抓图

plvar,4,5 ! 图形显示

变量2,3号

!prvar,4,5

/image,save,temp45,jpeg ! 抓图

plvar,2,4 ! 图形显示

变量2,3号

!prvar,2,4

/image,save,temp24,jpeg ! 抓图

finish

2024年10月13日发(作者:袭依波)

!非线性材料求解成功GAUSS分布Z向扫描!

!考虑了和基板对流情况下加载热流密度的热分析

rb=0.15mm

!粉床7.8X3.3mm,烧结区域6X1.5mm

!考虑粉床表面的辐射、对流

!考虑粉末状、熔化状(液态)、凝固态的边界条件

变化

!考虑金属蒸发会带走一部分能量,故效率减半eff

=0.7

!r=0.2mm

FINISH

/CLEAR,START

/BATCH

/CWD,'d:AnsysworkEBM FEM Simulation for

Metals3D Temperture distrbution'

/FILNAME,EBM_db,0

/TITLE,3D Temperture distrbution

!选择分析问题的类型:热

/NOPR

/PMETH,OFF,0

KEYW,PR_SET,1

KEYW,PR_STRUC,0

KEYW,PR_THERM,1

KEYW,PR_FLUID,0

KEYW,PR_ELMAG,0

KEYW,MAGNOD,0

KEYW,MAGEDG,0

KEYW,MAGHFE,0

KEYW,MAGELC,0

KEYW,PR_MULTI,0

KEYW,PR_CFD,0

/GO

/UNITS,SI !Standard Units

!*******************************************

!开始,进入前处理器,定义下列属性-

!0参数定义

!1定义单元类型

!2实常数

!3材料性能

!4几何模型

!5网格划分控制

!6其他

!**************************************!

/PREP7

!0参数定义

!模型参数

!几何模型尺寸me-3=mm

*SET,Block_x,7.8e-3

*SET,Block_x1,0.9e-3

*SET,Block_x2,6.9e-3

*SET,Block_y,3.3e-3

*SET,Block_y1,0.9e-3

*SET,Block_y2,2.4e-3

*SET,Block_z,0.3e-3

*SET,Block_z1,0.9e-3

!划分网格的大小

*SET,LMeshx,3e-4 !line1

*SET,LMeshy,3e-4 !line4

*SET,LMeshz,3e-4 !line9

!边界条件参数

*SET,Tinit,30 !初始温度

!1定义单元类型

ET,1,SOLID70

et,2,surf152 !表面效应单元

r,2

KEYOPT,2,4,1 !表面效应单元设置

KEYOPT,2,8,4

ET,3,SOLID87

!2实常数

!Nothing

!3材料性能

MPTEMP

MPTEMP,1,25,400,1200,1600,2000,2500

MPDATA,DENS,1,1,3983,4688.4,5406.8,5948.8,690

8,6331 !密度

MPDATA,KXX,1,1,1.6278,2.3812,3.6396,29.8,30.6,3

2 !热导率

mpdata,c,1,1,472,535,679,859,945,1034 !比热

MPTEMP,,,,,,,,

MPTEMP,1,0,200,400,800,1200

MPTEMP,6,1400,1454,1800,2000

MPDATA,ENTH,1,1,0,7.9729e+8,1.6400e+9,3.4621e

+9,5.3897e+9

MPDATA,ENTH,1,6,6.3415e+9,8.2595e+9,9.8798e+

9,1.0816e+10 !热焓

MPTEMP,,,,,,,,

MPTEMP,1,20,300,600,900,1200,1500,1800,2000,30

00,4000

MPDATA,HF,1,1,6,50,120,200,250,378,700,850,1746

,3799 !对流系数

MPTEMP,,,,,,,,

MPTEMP,1,20,200,400,600,800,900,1000,1100,1200,

1420,1460

MPDATA,DENS,2,1,7966,7893,7814,7724,7630,758

3,7535,7486,7436,7320,7320

MPDATA,KXX,2,1,13.31,16.33,19.47,22.38,25.07,26

.33,27.53,28.67,29.76,31.95,32 !热导率

mpdata,c,2,1,470,508,550,592,634,655,676,698,719,7

65,765

MPTEMP,,,,,,,,

MPTEMP,1,0,200,400,800,1200

MPTEMP,6,1400,1454,1800,2000

MPDATA,ENTH,2,1,0,7.9729e+8,1.6400e+9,3.4621e

+9,5.3897e+9

MPDATA,ENTH,2,6,6.3415e+9,8.2595e+9,9.8798e+

9,1.0816e+10

!4几何模型

BLOCK,0,Block_x,0,Block_y,0,Block_z,

BLOCK,Block_x1,Block_x2,Block_y1,Block_y2,0,Bl

ock_z,

vsel,all

VOVLAP,all

BLOCK,0,Block_x,0,Block_y,0,-Block_z1,

vglue,all

numcmp,all

!划分网格

lesize,8,LMeshx

lesize,5,LMeshy

lesize,13,LMeshz

vsel,s,,,1

type,1

mat,1

mshkey,1

vmesh,all

allsel

esize,0.3e-3

mshkey,0

mshape,1,3d

vsel,s,,,2

type,3

mat,2

vmesh,all

allsel

esize,0.3e-3

mshkey,0

mshape,1,3d

vsel,s,,,3

type,3

mat,1

vmesh,all

allsel

!成形件轨迹单元质心排序

width=Block_y2-Block_y1

!wpoffs,Block_x1,Block_y1,0

!local,11,1,Block_x1,Block_y1,0

ALLSEL,ALL

*GET,EMAX,ELEM,,COUNT,MAX

VSEL,S, , , 1

ESLV,S

*GET,AEMAX,ELEM,,COUNT1,MAX

*DIM,ANE,ARRAY,AEMAX,

*DIM,ANE1,ARRAY,AEMAX,

*DIM,ANE2,ARRAY,AEMAX,

*DIM,ANE3,ARRAY,AEMAX,

*DIM,ANE4,ARRAY,AEMAX,

*DIM,ANE5,ARRAY,AEMAX,

*DIM,ANEX,ARRAY,AEMAX

*DIM,ANEY,ARRAY,AEMAX

*DIM,ANEZ,ARRAY,AEMAX

*DIM,ANEORDER,ARRAY,AEMAX,,1

!形心排序

VSEL,S, , , 1

ESLV,S

*GET,ANSEL,ELEM,,COUNT1

II=0

*DO,I,1,AEMAX

*IF,ESEL(I),EQ,1,THEN

II=II+1

ANE(II)=I

*ENDIF

b=0

*do,i,1,AEMAX

*if,ANEY(I),ge,width/5+Block_y1,then

*if,ANEY(I),lt,2*width/5+Block_y1,then

*ENDDO

*DO,I,1,ANSEL

*GET,ANEZ(I),ELEM,ANE(I),CENT,Z

*GET,ANEY(I),ELEM,ANE(I),CENT,Y

*GET,ANEX(I),ELEM,ANE(I),CENT,X

*ENDDO

e=0

*do,i,1,AEMAX

*if,ANEY(I),ge,4*width/5+Block_y1,then

e=e+1

ANE5(e)=ANE(i)

*endif

*enddo

d=0

*do,i,1,AEMAX

*if,ANEY(I),ge,3*width/5+Block_y1,then

*if,ANEY(I),lt,4*width/5+Block_y1,then

d=d+1

ANE4(d)=ANE(i)

*endif

*endif

*enddo

c=0

*do,i,1,AEMAX

*if,ANEY(I),ge,2*width/5+Block_y1,then

*if,ANEY(I),lt,3*width/5+Block_y1,then

c=c+1

ANE3(c)=ANE(i)

*endif

*endif

*enddo

b=b+1

ANE2(b)=ANE(i)

*endif

*endif

*enddo

a=0

*do,i,1,AEMAX

*if,ANEY(I),lt,width/5+Block_y1,then

a=a+1

ANE1(a)=ANE(i)

*endif

*enddo

!*******对1道焊缝区的单元按质心X坐标进行从

低到高排序********

esel,none

*do,i,1,a

*if,ANE1(i),NE,0,then

esel,a,elem,,ANE1(i)

*endif

*enddo

MINE=0

*DIM,ANEX1,ARRAY,a

*DIM,ANEY1,ARRAY,a

*DIM,ANEZ1,ARRAY,a

*DO,I1,1, a

esel,u,elem,,mine

*GET,ANSEL1,ELEM,,COUNT1

II=0

*DO,I,1,AEMAX

*IF,ESEL(I),EQ,1,THEN

II=II+1

ANE1(II)=I

*ENDIF

*ENDDO

*DO,I,1,ANSEL1

*GET,ANEZ1(I),ELEM,ANE1(I),CENT,Z

*GET,ANEY1(I),ELEM,ANE1(I),CENT,Y

*GET,ANEX1(I),ELEM,ANE1(I),CENT,X

*ENDDO

MINZ=1E20

MINY=1E20

MINX=1E20

*DO,I,1,ANSEL1

*IF,ANEZ1(I),LT,MINZ,THEN

MINZ=ANEZ1(I)

MINY=ANEY1(I)

MINX=ANEX1(I)

MINE=ANE1(I)

*ELSE

*IF,ANEZ1(I),EQ,MINZ,THEN

*IF,ANEY1(I),LT,MINY,THEN

MINZ=ANEZ1(I)

MINY=ANEY1(I)

MINX=ANEX1(I)

MINE=ANE1(I)

*ELSE

*IF,ANEY1(I),EQ,MINY,THEN

*IF,ANEX1(I),LT,MINX,THEN

MINZ=ANEZ1(I)

MINY=ANEY1(I)

MINX=ANEX1(I)

MINE=ANE1(I)

*ENDIF

*ENDIF

*ENDIF

*ENDIF

*ENDIF

*ENDDO

ANEORDER(I1)=MINE

*ENDDO

!********对2道焊缝区的单元按质心X坐标进行

从高到低排序******

MAXE=1

esel,none

*do,j,1,b

*if,ANE2(j),NE,0,then

esel,a,elem,,ANE2(j)

*endif

*enddo

*DIM,ANEX2,ARRAY,b

*DIM,ANEY2,ARRAY,b

*DIM,ANEZ2,ARRAY,b

*DO,J1,1, b

esel,u,elem,,MAXE

*GET,ANSEL2,ELEM,,COUNT1

JJ=0

*DO,J,1,AEMAX

*IF,ESEL(I),EQ,1,THEN

JJ=JJ+1

ANE2(JJ)=J

*ENDIF

*ENDDO

*DO,J,1,ANSEL2

*GET,ANEZ2(J),ELEM,ANE2(J),CENT,Z

*GET,ANEY2(J),ELEM,ANE2(J),CENT,Y

*GET,ANEX2(J),ELEM,ANE2(J),CENT,X

*ENDDO

MAXZ=1E20

MAXY=1E20

MAXX=-1E20

*DO,J,1,ANSEL2

*IF,ANEZ2(J),LT,MAXZ,THEN

MAXZ=ANEZ2(J)

MAXY=ANEY2(J)

MAXX=ANEX2(J)

MAXE=ANE2(J)

*ELSE

*IF,ANEZ2(J),EQ,MAXZ,THEN

*IF,ANEY2(J),LT,MAXY,THEN

MAXZ=ANEZ2(J)

MAXY=ANEY2(J)

MAXX=ANEX2(J)

MAXE=ANE2(J)

*ELSE

*IF,ANEY2(J),EQ,MAXY,THEN

*IF,ANEX2(J),GT,MAXX,THEN

MAXZ=ANEZ2(J)

MAXY=ANEY2(J)

MAXX=ANEX2(J)

MAXE=ANE2(J)

*ENDIF

*ENDIF

*ENDIF

*ENDIF

*ENDIF

*ENDDO

ANEORDER(J1+a)=MAXE

*ENDDO

!********对3道焊缝区的单元按质心X坐标进行

从低到高排序******

MINE=1

esel,none

*do,k,1,c

*if,ANE3(k),NE,0,then

esel,a,elem,,ANE3(k)

*endif

*enddo

*DIM,ANEX3,ARRAY,c

*DIM,ANEY3,ARRAY,c

*DIM,ANEZ3,ARRAY,c

*DO,K1,1, c

esel,u,elem,,mine

*GET,ANSEL3,ELEM,,COUNT1

KK=0

*DO,K,1,AEMAX

*IF,ESEL(K),EQ,1,THEN

KK=KK+1

ANE3(KK)=K

*ENDIF

*ENDDO

*DO,K,1,ANSEL3

*GET,ANEZ3(K),ELEM,ANE3(K),CENT,Z

*GET,ANEY3(K),ELEM,ANE3(K),CENT,Y

*GET,ANEX3(K),ELEM,ANE3(K),CENT,X

*ENDDO

MINZ=1E20

MINY=1E20

MINX=1E20

*DO,K,1,ANSEL3

*IF,ANEZ3(K),LT,MINZ,THEN

MINZ=ANEZ3(K)

MINY=ANEY3(K)

MINX=ANEX3(K)

MINE=ANE3(K)

*ELSE

*IF,ANEZ3(K),EQ,MINZ,THEN

*IF,ANEY3(K),LT,MINY,THEN

MINZ=ANEZ3(K)

MINY=ANEY3(K)

MINX=ANEX3(K)

MINE=ANE3(K)

*ELSE

*IF,ANEY3(K),EQ,MINY,THEN

*IF,ANEX3(K),LT,MINX,THEN

MINZ=ANEZ3(K)

MINY=ANEY3(K)

MINX=ANEX3(K)

MINE=ANE3(K)

*ENDIF

*ENDIF

*ENDIF

*ENDIF

*ENDIF

*ENDDO

ANEORDER(K1+a+b)=MINE

*ENDDO

!*******对4道焊缝区的单元按质心X坐标进行从

高到低排序******

MAXE=1

esel,none

*do,j,1,d

*if,ANE4(j),NE,0,then

esel,a,elem,,ANE4(j)

*endif

*enddo

*DIM,ANEX4,ARRAY,d

*DIM,ANEY4,ARRAY,d

*DIM,ANEZ4,ARRAY,d

*DO,J1,1, d

esel,u,elem,,MAXE

*GET,ANSEL4,ELEM,,COUNT1

JJ=0

*DO,J,1,AEMAX

*IF,ESEL(I),EQ,1,THEN

JJ=JJ+1

ANE2(JJ)=J

*ENDIF

*ENDDO

*DO,J,1,ANSEL4

*GET,ANEZ4(J),ELEM,ANE4(J),CENT,Z

*GET,ANEY4(J),ELEM,ANE4(J),CENT,Y

*GET,ANEX4(J),ELEM,ANE4(J),CENT,X

*ENDDO

MAXZ=1E20

MAXY=1E20

MAXX=-1E20

*DO,J,1,ANSEL4

*IF,ANEZ4(J),LT,MAXZ,THEN

MAXZ=ANEZ4(J)

MAXY=ANEY4(J)

MAXX=ANEX4(J)

MAXE=ANE4(J)

*ELSE

*IF,ANEZ4(J),EQ,MAXZ,THEN

*IF,ANEY4(J),LT,MAXY,THEN

MAXZ=ANEZ4(J)

MAXY=ANEY4(J)

MAXX=ANEX4(J)

MAXE=ANE4(J)

*ELSE

*IF,ANEY4(J),EQ,MAXY,THEN

*IF,ANEX4(J),GT,MAXX,THEN

MAXZ=ANEZ4(J)

MAXY=ANEY4(J)

MAXX=ANEX4(J)

MAXE=ANE4(J)

*ENDIF

*ENDIF

*ENDIF

*ENDIF

*ENDIF

*ENDDO

ANEORDER(J1+a+b+c)=MAXE

*ENDDO

!********对5道焊缝区的单元按质心X坐标进行

从低到高排序*****

esel,none

*do,i,1,e

*if,ANE5(i),NE,0,then

esel,a,elem,,ANE5(i)

*endif

*enddo

MINE=1

*DIM,ANEX5,ARRAY,e

*DIM,ANEY5,ARRAY,e

*DIM,ANEZ5,ARRAY,e

*DO,I1,1, e

esel,u,elem,,mine

*GET,ANSEL5,ELEM,,COUNT1

II=0

*DO,I,1,AEMAX

*IF,ESEL(I),EQ,1,THEN

II=II+1

ANE5(II)=I

*ENDIF

*ENDDO

*DO,I,1,ANSEL5

*GET,ANEZ5(I),ELEM,ANE5(I),CENT,Z

*GET,ANEY5(I),ELEM,ANE5(I),CENT,Y

*GET,ANEX5(I),ELEM,ANE5(I),CENT,X

*ENDDO

MINZ=1E20

MINY=1E20

MINX=1E20

*DO,I,1,ANSEL1

*IF,ANEZ5(I),LT,MINZ,THEN

MINZ=ANEZ5(I)

MINY=ANEY5(I)

MINX=ANEX5(I)

MINE=ANE5(I)

*ELSE

*IF,ANEZ5(I),EQ,MINZ,THEN

*IF,ANEY5(I),LT,MINY,THEN

MINZ=ANEZ5(I)

MINY=ANEY5(I)

MINX=ANEX5(I)

MINE=ANE5(I)

*ELSE

*IF,ANEY5(I),EQ,MINY,THEN

*IF,ANEX5(I),LT,MINX,THEN

MINZ=ANEZ5(I)

MINY=ANEY5(I)

MINX=ANEX5(I)

MINE=ANE5(I)

*ENDIF

*ENDIF

*ENDIF

*ENDIF

*ENDIF

*ENDDO

ANEORDER(I1+a+b+c+d)=MINE

*ENDDO

!成形件轨迹单元质心排序

FINISH

!*********************体热源加载求解

************

/SOL

ANTYPE,4 !瞬态分析

TRNOPT,FULL !指定瞬态分析选项

eqslv !指定求解器

solcontrol,on !求解控制(用优化求解器)

ESEL,ALL

EPLOT

/AUTO,1

/REPLOT

allsel,all

outres,all,all

TOFFST,273

tunif,24

kbc,1

timint,on

nsub1=2

nsub2=20

asel,s,loc,z,Block_z !加对流条

asel,a,loc,x,0

asel,a,loc,x,Block_x

asel,a,loc,y,0

asel,a,loc,y,Block_y

nsla

sf,all,conv,-1,24

allsel

dt=3e-2 ! 定义每次成形

所需要的时间

tim=0

!生死单元控制

!*DO,I1,1,AEMAX

! ESEL,S,,,ANEORDER(I1)

! EKILL,ALL

! ESEL,S,LIVE

! EPLOT

!*enddo

j=aemax !j小于AEmax

*DO,I1,1,j

nsubst,,,,1

esel,s,,,ANEORDER(I1)

! EALIVE,ANEORDER(I1-1)

! ESEL,S,LIVE

EPLOT

! *ENDIF

esel,all

EPLOT

!***************体载荷加载*********

tim=tim+dt

time,tim

!bfe,ANEORDER(I1),hgen,1,3.91e12

bfe,ANEORDER(I1),hgen,1,4.63e12*0.7!0.6

T_end=300

!*************************************

SOLVE

bfedele,ANEORDER(I1),hgen

*ENDDO

/solu

ANTYPE,,rest

bfedele,all,hgen

time,4 !step101开始完全冷却

NSUBST,15,30,5

solve

save

time,5 !step102开始完全冷却

NSUBST,15,30,5

solve

save

time,6 !step103开始完全冷却

NSUBST,15,30,5

solve

save

time,7 !step104开始完全冷却

NSUBST,15,30,5

solve

save

time,8 !step105开始完全冷却

NSUBST,15,30,5

solve

save

time,9 !step106开始完全冷却

NSUBST,15,30,5

solve

save

time,10 !step107开始完全冷却

NSUBST,15,30,5

solve

save

time,30 !step108开始完全冷却

NSUBST,15,30,5

solve

save

time,300 !step109开始完全冷却

NSUBST,15,30,5

solve

save

!************生成节点温度分布云图动画文件的

程序段**************

/VIEW,1,1,2,3

/ANG,1

/REP,FAST

/post1

/seg,dele

!/cont,1,15,0,3500/16,3500

/dscale,1,1.0

avprin,0,0

avres,1

/seg,multi,temp1,0.1

esel,all

*do,i,1,37

set,(i-1)*3+1

plnsol,temp

*enddo

/seg,off,temp37,1

/anfile,save,temp37,avi

/image,save,temp37,jpeg

anim,1,1,1

finish

!***********************************进入后处

理**************

/post26 ! 进入时

间历程后处理器

nsol,2,138,temp,,temp138 ! 取出(3.9,

0.9,0.3)的温度值并赋给变量2号

nsol,3,163,temp,,temp163 ! 取出(3.9,

2.4,0.3)的温度值并赋给变量3号

nsol,4,249,temp,,temp249 ! 取出(6.6,

1.2,0.3)的温度值并赋给变量3号

nsol,5,154,temp,,temp154 ! 取出(6.6,

2.4,0.3)的温度值并赋给变量3号

!nsol,4,149,temp,,temp149 ! 取出(6.9,

1.2,0.3)的温度值并赋给变量3号

!nsol,5,148,temp,,temp148 ! 取出(6.9,

2.4,0.3)的温度值并赋给变量3号

/gropt,axnsc,1.5, ! 缩放图标

字体的大小

plvar,2,3 ! 图形显示

变量2,3号

!prvar,2,3

/image,save,temp23,jpeg ! 抓图

plvar,4,5 ! 图形显示

变量2,3号

!prvar,4,5

/image,save,temp45,jpeg ! 抓图

plvar,2,4 ! 图形显示

变量2,3号

!prvar,2,4

/image,save,temp24,jpeg ! 抓图

finish

发布评论

评论列表 (0)

  1. 暂无评论