- 积分
- 33776
- 回帖
- 0
- 西莫币
-
- 贡献
-
- 威望
-
- 存款
-
- 阅读权限
- 100
- 最后登录
- 1970-1-1
签到天数: 31 天 连续签到: 10 天 [LV.5]常住居民I
|
可以查看fluxv宏的整个APDL程序,位置
C:\Program Files\ANSYS Inc\v145\ansys\apdl
内容如下:
! ANSYS $RCSfile: FLUXV.MAC,v $
! Modified on $Date: 2006/12/15 06:34:09 $
! Source ID = $Revision: 1.1 $
! mpg vz dfo
/nopr
/out,scratch
/COM, MACRO FOR CALCULATING FLUX PASSING THROUGH A CLOSED LOOP
/COM,
/COM, *** ASSUMPTIONS
/COM, VALID FOR VECTOR POTENTIAL FORMULATIONS ONLY
/COM, LINE INTEGRAL PATH HAS BEEN CREATED PRIOR TO CALLING THIS MACRO
/COM, LINE INTEGRAL PATH IS CLEARED OF ALL DATA AFTER COMPLETION OF MACRO
/COM, *** ANSYS REVISION 5.3
/COM,
/COM, *** CALCULATED PARAMETER
/COM,
/COM, FLUX (WEBERS) - MKS UNITS
/COM, (MAXWELLS) - CGS UNITS
/COM,
/COM, (PARAMETER IS RETAINED)
/out
flux=
*get,_nops,active,,prkey
*get,_mnu,active,,menu
*get,_arout,active,,rout
_ok=1
*if,_arout,ne,31,then
*msg,warn
Enter Post1 before issuing this command macro
_ok=0
*endif
*if,_ok,eq,1,then
*get,_nc,path,,node,count
*if,_nc,eq,0,then
*msg,error
Path must be defined before calling command macro
_ok=0
*endif
*get,_sysc,active,,csys ! get active CSYS c.s.
*get,_sysr,active,,rsys ! get active RSYS c.s.
*get,_unit,active,,solu,emunit ! 1=mks, 2=cgs, 3=user
*get,_dimn,active,,solu,dimn
! convert keydim from new to old meaning pck 10/98 qt-13025
! new: 0=planar, 1=axisym, 2=axisym-harmonic, 3=3d
! old: 1=axisym, 2=planar, 3=3d
*if,_dimn,eq,0,then
_dimn=2
*endif
! convert to new usage as convenient
! end of keydim conversion
csys,0
rsys,0
*endif
_afun=atan(1)
*if,_afun,gt,1,then
*afun,rad
*endif
_tpi=8*atan(1)
*if,_dimn*_ok,eq,2,then ! 2-d planar
pdef,_az,a,z
*get,_flx1,path,,item,_az,pathpt,1
*get,_flx2,path,,last,_az
flux=_flx2-_flx1
pdef,clear
*elseif,_dimn*_ok,eq,1,then ! axisymmetric
pdef,_az,a,z
*get,_flx1,path,,item,_az,pathpt,1
*get,_flx2,path,,last,_az
*get,_r1,path,,item,xg,pathpt,1
*get,_r2,path,,last,xg
flux=_tpi*((_flx1*_r1)-(_flx2*_r2))
pdef,clear
*elseif,_dimn*_ok,eq,3,then ! 3-d
PDEF,_AX,A,X ! interpret potentials to path
PDEF,_AY,A,Y
PDEF,_AZ,A,Z
PVECT,TANG,TX,TY,TZ ! interpret tangent normals to path
PDOT,D,_AX,_AY,_AZ,TX,TY,TZ ! calculate dot product
PCALC,INTG,FLUX,D,S ! integrate over path
*GET,FLUX,PATH,,LAST,FLUX ! get total flux
pdef,clear
*endif
*if,_ok,eq,1,then
/out,fluxv,out
*msg,info
%/________________SUMMARY OF FLUX CALCULATIONS______________
*endif
*if,_dimn*_ok,eq,2,then
*if,_unit,le,1,then
*msg,info,flux
%/Flux = %g Webers/m
*elseif,_unit,eq,2,then
*msg,info,flux
%/Flux = %g Maxwells/cm
*endif
*elseif,_dimn*_ok,ne,0,then
*if,_unit,le,1,then
*msg,info,flux
%/Flux = %g Webers
*elseif,_unit,eq,2,then
*msg,info,flux
%/Flux = %g Maxwells
*endif
*endif
*if,_ok,eq,1,then
*msg,info
%/ Parameter defined for flux: FLUX %/
*msg,info
__________________________________________________________
/out
*list,fluxv,out
*if,_mg1,ne,1,then
_mg1=0
*endif
*if,_mnu*(1-_mg1),ne,0,then
*uilist,fluxv,out
*endif
rsys,_sysr
csys,_sysc
*endif
_tpi=
_unit=
_dimn=
_sysr=
_sysc=
_nc= $_az= $_flx1= $_flx2= $_r1= $_r2=
check_=
*if,_afun,gt,1,then
*afun,deg
*endif
_afun=
_arout=
_mnu=
_ok=
*if,_nops,eq,0,then
/nopr
_nops=
*else
_nops=
/go
*endif |
|