- 积分
- 10
- 注册时间
- 2007-1-4
- 仿真币
-
- 最后登录
- 1970-1-1
|
本帖最后由 mlj0016 于 2010-3-25 11:25 编辑
挺长时间没上了,看到不少人问关于单元生死的问题,看来工作找的差不多,总算想起来要做毕设了,呵呵。之前稍微做过一点,有点经验,跟大家分享一下。高手就不用看了,最简单的例子而已。如下所示。
subroutine uactive(m,n,mode,irststr,irststn,inc,time,timinc)
include 'C:\MSC.Software\MSC.Marc\2005\marc2005\common/implicit'
dimension m(2)
c
c user routine to activate or deactivate an element
c
c m(1) - user element number
c m(2) - master element number for local adaptivity
c n - internal elsto number
c mode=-1 - deactivate element and remove element from post file
c mode=-11 - deactivate element and keep element on post file
c mode=2 - leave in current status
c mode=1 - activate element and add element to post file
c mode=11 - activate element and keep status on post file
c irststr - reset stresses to zero
c irststn - reset strains to zero
c inc - increment number
c time - time at begining of increment
c timinc - incremental time
c
dimension temp(8)
do i=1,8
CALL ELMVAR (9,M(1),i,1,temp(i))
tt=tt+temp(i)
enddo
tt=tt/8
if(tt.ge.660)then
mode=-1
endif
return
end
简单讲解一下吧。这个子程序的意思是,将温度大于660度的单元杀死。首先需要提取单元各节点的温度,也就是call... 这一句。
然后对其求平均值,是tt=tt+temp(i)和tt=tt/8这两句。
然后对得到的单元温度进行判断,看其是否大于660度,若大于,则杀死;否则不作处理。是从if...到end if这几句。
这个子程序非常简单,但对于新手还是有几个地方容易犯错。
首先就是fortran和marc之间没有连上,至于这个问题,就不细说了,大伙可以查一下以前的贴子。若是都有这个问题的话,我可以再开一个贴子介绍。
另外一个问题在 include 'C:\MSC.Software\MSC.Marc\2005\marc2005\common/implicit'这句上。很多人调试不成功,是因为你的这句可能还写着"...\common\implicit",或者你写的不是你的marc安装路径。
另外,再说明一下。如果你想在高温的时候把单元杀死,等降到低温后再激活,这是不太好实现的。因为在杀死单元之后,该单元就不再参与计算了,所以其温度保持在被杀死时候的温度,无法降温至你所设置的低温激活温度。或许有别的方法实现,大伙可以自己想一下。
再另外,在你开始编子程序之前,请仔细看一下该此程序中的说明。那些前面标了"c"的代码虽然不参与运算,但却是该子程序的重点。通过这些说明,你可以发现该子程序为我们提供了那些参数可以直接使用,那些参数是必须要设置的。活用这些参数,会让你事半功倍的。
好了,就不再另外了。大家有什么问题可以提出来,互相交流一下。 |
评分
-
1
查看全部评分
-
|