ANSYS命令调用子程序

ANSYS命令调用子程序,第1张

又是在提问之后自己找到了答案,囧!

自己的另一个号又来回答了~

.mac是宏文件。ANSYS在调用宏时的搜索路径有

一、目录:/AnsysInc/v70/ANSYS/apdl。

二、在ANSYS_MACROLIB环境下指定的路径或者注册目录。

三、由$HOME环境变量所指定的目录。

四、工作目录。

给你一个三维平板焊接的实例,用的是移动高斯热源。主要是这一段:

! Begin of equation: Qm*exp(-3*({X}^2+({Y}-V*{TIME})^2)/R^2)

/PREP7

!定义焊接参数

L=1E-1 !焊件的长度

W=1E-1 !焊件的宽度

H=6E-3 !焊件的高度

U=20 !焊接电压

I=160 !焊接电流

V=0.01!焊接速度

YITA=0.7 !焊接热效率

R=0.007 !电弧有效加热半径

Q=U*I*YITA!电弧热功率

Qm=3/3.1415/R**2*Q !加热斑点中心最大热流密度

!*

ET,1,PLANE55

ET,2,SOLID70

MPTEMP,,,,,,,,

MPTEMP,1,20

MPTEMP,2,200

MPTEMP,3,500

MPTEMP,4,750

MPTEMP,5,1000

MPTEMP,6,1500

MPTEMP,7,1700

MPTEMP,8,2500

MPDATA,KXX,1,,50

MPDATA,KXX,1,,47

MPDATA,KXX,1,,40

MPDATA,KXX,1,,27

MPDATA,KXX,1,,30

MPDATA,KXX,1,,35

MPDATA,KXX,1,,40

MPDATA,KXX,1,,55

MPDATA,DENS,1,,7820

MPDATA,DENS,1,,7700

MPDATA,DENS,1,,7610

MPDATA,DENS,1,,7550

MPDATA,DENS,1,,7490

MPDATA,DENS,1,,7350

MPDATA,DENS,1,,7300

MPDATA,DENS,1,,7090

MPDATA,C,1,,460

MPDATA,C,1,,480

MPDATA,C,1,,530

MPDATA,C,1,,675

MPDATA,C,1,,670

MPDATA,C,1,,660

MPDATA,C,1,,780

MPDATA,C,1,,820

MPDATA,EX,1,,2.05E11

MPDATA,EX,1,,1.87E11

MPDATA,EX,1,,1.5E11

MPDATA,EX,1,,0.7E11

MPDATA,EX,1,,0.2E11

MPDATA,EX,1,,0.19E2

MPDATA,EX,1,,0.18E2

MPDATA,EX,1,,0.12e2

MPDATA,PRXY,1,,0.28

MPDATA,PRXY,1,,0.29

MPDATA,PRXY,1,,0.31

MPDATA,PRXY,1,,0.35

MPDATA,PRXY,1,,0.4

MPDATA,PRXY,1,,0.45

MPDATA,PRXY,1,,0.48

MPDATA,PRXY,1,,0.5

UIMP,1,REFT,,,20

MPDATA,ALPX,1,,1.1e-5

MPDATA,ALPX,1,,1.22e-5

MPDATA,ALPX,1,,1.39e-5

MPDATA,ALPX,1,,1.48e-5

MPDATA,ALPX,1,,1.34e-5

MPDATA,ALPX,1,,1.33e-5

MPDATA,ALPX,1,,1.32e-5

MPDATA,ALPX,1,,1.31e-5

TB,BISO,1,6,2,

TBTEMP,20

TBDATA,,220e6,0,,,,

TBTEMP,250

TBDATA,,175e6,0,,,,

TBTEMP,500

TBDATA,,80e6,0,,,,

TBTEMP,750

TBDATA,,40E6,0,,,,

TBTEMP,1000

TBDATA,,10E6,0,,,,

TBTEMP,1500

TBDATA,,1E-5,0,,,,

K,1,0,0,0

K,2,0,L,0

K,3,-W/2*0.15,L,0

K,4,-W/2*0.3,L,0

K,5,-W/2*0.5,L,0

K,6,-W/2,L,0

K,7,-W/2,0,0

K,8,-W/2*0.5,0,0

K,9,-W/2*0.3,0,0

K,10,-W/2*0.15,0,0

K,11,0,0,H

A,1,2,3,10

A,10,3,4,9

A,9,4,5,8

A,8,5,6,7

ESIZE,0.0012

AMESH,1

ESIZE,0.0025

AMESH,2

ESIZE,0.005

AMESH,3

ESIZE,0.0065

AMESH,4

TYPE, 2

EXTOPT,ESIZE,2,0,

EXTOPT,ACLEAR,1

!*

EXTOPT,ATTR,1,0,0

REAL,_Z4

ESYS,0

!*

VOFFST,1,H, ,

VOFFST,2,H, ,

VOFFST,3,H, ,

VOFFST,4,H, ,

EPLOT

NUMMRG,ALL, , , ,LOW

/SOL

!*

ANTYPE,4

!*

TRNOPT,FULL

LUMPM,0

*DEL,_FNCNAME

*DEL,_FNCMTID

*DEL,_FNC_C1

*DEL,_FNC_C2

*DEL,_FNC_C3

*DEL,_FNCCSYS

*SET,_FNCNAME,'GAOSI'

*DIM,_FNC_C1,,1

*DIM,_FNC_C2,,1

*DIM,_FNC_C3,,1

*SET,_FNC_C1(1),QM

*SET,_FNC_C2(1),V

*SET,_FNC_C3(1),R

*SET,_FNCCSYS,0

! /INPUT,HANJIE.func,,,1

*DIM,%_FNCNAME%,TABLE,6,19,1,,,,%_FNCCSYS%

!

! Begin of equation: Qm*exp(-3*({X}^2+({Y}-V*{TIME})^2)/R^2)

*SET,%_FNCNAME%(0,0,1), 0.0, -999

*SET,%_FNCNAME%(2,0,1), 0.0

*SET,%_FNCNAME%(3,0,1), %_FNC_C1(1)%

*SET,%_FNCNAME%(4,0,1), %_FNC_C2(1)%

*SET,%_FNCNAME%(5,0,1), %_FNC_C3(1)%

*SET,%_FNCNAME%(6,0,1), 0.0

*SET,%_FNCNAME%(0,1,1), 1.0, -1, 0, 0, 0, 0, 0

*SET,%_FNCNAME%(0,2,1), 0.0, -2, 0, 1, 0, 0, -1

*SET,%_FNCNAME%(0,3,1), 0, -3, 0, 1, -1, 2, -2

*SET,%_FNCNAME%(0,4,1), 0.0, -1, 0, 3, 0, 0, -3

*SET,%_FNCNAME%(0,5,1), 0.0, -2, 0, 1, -3, 3, -1

*SET,%_FNCNAME%(0,6,1), 0.0, -1, 0, 2, 0, 0, 2

*SET,%_FNCNAME%(0,7,1), 0.0, -3, 0, 1, 2, 17, -1

*SET,%_FNCNAME%(0,8,1), 0.0, -1, 0, 1, 18, 3, 1

*SET,%_FNCNAME%(0,9,1), 0.0, -4, 0, 1, 3, 2, -1

*SET,%_FNCNAME%(0,10,1), 0.0, -1, 0, 2, 0, 0, -4

*SET,%_FNCNAME%(0,11,1), 0.0, -5, 0, 1, -4, 17, -1

*SET,%_FNCNAME%(0,12,1), 0.0, -1, 0, 1, -3, 1, -5

*SET,%_FNCNAME%(0,13,1), 0.0, -3, 0, 1, -2, 3, -1

*SET,%_FNCNAME%(0,14,1), 0.0, -1, 0, 2, 0, 0, 19

*SET,%_FNCNAME%(0,15,1), 0.0, -2, 0, 1, 19, 17, -1

*SET,%_FNCNAME%(0,16,1), 0.0, -1, 0, 1, -3, 4, -2

*SET,%_FNCNAME%(0,17,1), 0.0, -1, 7, 1, -1, 0, 0

*SET,%_FNCNAME%(0,18,1), 0.0, -2, 0, 1, 17, 3, -1

*SET,%_FNCNAME%(0,19,1), 0.0, 99, 0, 1, -2, 0, 0

! End of equation: Qm*exp(-3*({X}^2+({Y}-V*{TIME})^2)/R^2)

TUNIF,20, !定义初始温度

!定义对流换热边界

SFA,15,1,CONV,30,20

SFA,20,1,CONV,30,20

SFA,9,1,CONV,30,20

SFA,14,1,CONV,30,20

SFA,19,1,CONV,30,20

SFA,24,1,CONV,30,20

SFA,23,1,CONV,30,20

SFA,7,1,CONV,30,20

SFA,12,1,CONV,30,20

SFA,17,1,CONV,30,20

SFA,22,1,CONV,30,20

SFA,1,1,CONV,30,20

SFA,2,1,CONV,30,20

SFA,3,1,CONV,30,20

SFA,4,1,CONV,30,20

!施加高斯热源

SFA,5,1,HFLUX, %GAOSI%

SFA,10,1,HFLUX, %GAOSI%

OUTRES,ALL,ALL,

TIME,L/V !设置求解时间

AUTOTS,-1

NSUBST,50,50,50

KBC,0

TSRES,ERASE

LSWRITE,1, !写入载荷文件为1

!*

TIME,20

AUTOTS,1

NSUBST,20,20,20

KBC,0

!*

TSRES,ERASE

LSWRITE,2,

TIME,50

AUTOTS,1

NSUBST,30,30,30

KBC,0

!*

TSRES,ERASE

LSWRITE,3,

TIME,1100

AUTOTS,1

NSUBST,105,105,105

KBC,0

!*

TSRES,ERASE

LSWRITE,4,

LSSOLVE,1,4,1, !开始求解


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/12005711.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-20
下一篇 2023-05-20

发表评论

登录后才能评论

评论列表(0条)

保存