- #1
bzz77
- 34
- 0
I am a new to ANSYS command-language mode. I am having trouble animating the procedure described below. The procedure is meant to model melting over time through element death (based on example from U. Alberta at www.mece.uAlberta.ca/tutorials/ansys/AT/BirthDeath/BirthDeath.html).
My problem is that I can't get the elements that exceed 600 C (my melting criterion) to disappear SEQUENTIALLY from the animation. Instead, I can only get those elements that exceed 600 C in EITHER the first or last step to disappear. The temperature contours evolve during the animation, but the melted/disappeared elements stay the same. I have tried writing a loop to make a new element table for each substep in which melted elements disappear, but this has not worked.
I would very much appreciate help with this...The postprocessing part of the code should appear in bold blue italics.
finish
/clear
/title, Transient melting by element death (conduction)
/prep7 ! Enter the preprocessor
! define geometry
BLC4,0,0,20,15 ! Create rectangle
BLC4,0,0,10,4 ! Create smaller rectangle (magma)
ASBA,1,2 ! Boolean Subtraction (subtracts area 2 (small) from area 1 (big))
ET,1,Plane55 ! Element type
MP,Dens,1,2262e9 ! Define density
mp,c,1,0.001604 ! Define specific heat
mp,kxx,1,0.001 ! Define heat transfer coefficient
! Mesh size
SMRT,6
CM,_Y,AREA
ASEL, , , , 3
CM,_Y1,AREA
CHKMSH,'AREA'
CMSEL,S,_Y
AMESH,_Y1 ! Mesh area
! Refine mesh
CMDEL,_Y
CMDEL,_Y1
CMDEL,_Y2
FLST,5,6,2,ORDE,4
FITEM,5,6
FITEM,5,22
FITEM,5,-25
FITEM,5,44
CM,_Y,ELEM
ESEL, , , ,P51X
CM,_Y1,ELEM
CMSEL,S,_Y
CMDEL,_Y
EREF,_Y1, , ,3,0,1,1
CMDEL,_Y1
finish
/solu ! Enter solution phase
antype,4 ! Transient analysis
nropt,full ! Newton Raphson - full
SOLCONTROL,ON,0
TUNIF,200,
TREF,200,
OUTPR,ALL,ALL,
OUTRES,ALL,ALL
time,3.1536e13 ! Time at end of analysis
AUTOTS,0
DELTIM,315360e6, , ,1 ! Time step
AUTOTS,0
KBC,1
TSRES,ERASE
TIME,31536000000000
AUTOTS,0
NSUBST,100, , ,1 ! Number of substeps,100
KBC,1
lumpm,0 ! Lumped mass off
neqit,100 ! Max no. of iterations
autots,off ! Auto time search off
lnsrch,on ! Line search on
kbc,1 ! Load applied in steps, not ramped
IC,all,temp,200 ! Initial conditions, temp = 200
PRED,-1
FLST,2,628,1,ORDE,2
FITEM,2,1
FITEM,2,-628
IC,P51X,TEMP,200,
FLST,2,2,4,ORDE,2
FITEM,2,6
FITEM,2,-7
/GO
DL,P51X, ,TEMP,1200,1 ! BC
FLST,2,2,4,ORDE,2
FITEM,2,2
FITEM,2,-3
/GO
DL,P51X, ,TEMP,200,1
SAVE
SAVE
SAVE
/STAT,SOLU
SOLVE
TIME,31536000000000
AUTOTS,-1
DELTIM,315360000000, , ,1
KBC,1
TSRES,ERASE
TIME,31536000000000
AUTOTS,-1
NSUBST,100, , ,1
KBC,1
TSRES,ERASE
/STAT,SOLU
solve
finish
/post1
set, first
etable,melty,temp, ! Create an element table
esel,s,etab,melty,600 ! Select all elements from table ! above 600
finish
/solu ! Re-enter solution phase
antype,,rest ! Restart analysis
ekill,all ! Kill all selected elements
esel,all ! Re-select all elements
finish
/post1 ! Re-enter postprocessor
set,first ! Read in last subset of data
esel,s,live ! Select all live elements
plnsol,temp ! Plot the temp contour of the live elements
!/CONT,1,10,200,100,1200
!PLNS,TEMP,
!/REPLOT
*DO, i,1,10,1
set,i
etable,delete
etable,melty,temp, ! Create an element table
esel,s,etab,melty,600 ! Select all elements from table ! above 600
finish
/solu ! Re-enter solution phase
antype,,rest ! Restart analysis
ekill,all ! Kill all selected elements
esel,all ! Re-select all elements
finish
/post1 ! Re-enter postprocessor
set,i ! Read in last subset of data
esel,s,live ! Select all live elements
plnsol,temp
/CONT,1,10,200,100,1200
PLNS,TEMP,
/replot
*ENDDO
ANTIME,100,0.5, ,0,2,0,0.31536E+14
My problem is that I can't get the elements that exceed 600 C (my melting criterion) to disappear SEQUENTIALLY from the animation. Instead, I can only get those elements that exceed 600 C in EITHER the first or last step to disappear. The temperature contours evolve during the animation, but the melted/disappeared elements stay the same. I have tried writing a loop to make a new element table for each substep in which melted elements disappear, but this has not worked.
I would very much appreciate help with this...The postprocessing part of the code should appear in bold blue italics.
finish
/clear
/title, Transient melting by element death (conduction)
/prep7 ! Enter the preprocessor
! define geometry
BLC4,0,0,20,15 ! Create rectangle
BLC4,0,0,10,4 ! Create smaller rectangle (magma)
ASBA,1,2 ! Boolean Subtraction (subtracts area 2 (small) from area 1 (big))
ET,1,Plane55 ! Element type
MP,Dens,1,2262e9 ! Define density
mp,c,1,0.001604 ! Define specific heat
mp,kxx,1,0.001 ! Define heat transfer coefficient
! Mesh size
SMRT,6
CM,_Y,AREA
ASEL, , , , 3
CM,_Y1,AREA
CHKMSH,'AREA'
CMSEL,S,_Y
AMESH,_Y1 ! Mesh area
! Refine mesh
CMDEL,_Y
CMDEL,_Y1
CMDEL,_Y2
FLST,5,6,2,ORDE,4
FITEM,5,6
FITEM,5,22
FITEM,5,-25
FITEM,5,44
CM,_Y,ELEM
ESEL, , , ,P51X
CM,_Y1,ELEM
CMSEL,S,_Y
CMDEL,_Y
EREF,_Y1, , ,3,0,1,1
CMDEL,_Y1
finish
/solu ! Enter solution phase
antype,4 ! Transient analysis
nropt,full ! Newton Raphson - full
SOLCONTROL,ON,0
TUNIF,200,
TREF,200,
OUTPR,ALL,ALL,
OUTRES,ALL,ALL
time,3.1536e13 ! Time at end of analysis
AUTOTS,0
DELTIM,315360e6, , ,1 ! Time step
AUTOTS,0
KBC,1
TSRES,ERASE
TIME,31536000000000
AUTOTS,0
NSUBST,100, , ,1 ! Number of substeps,100
KBC,1
lumpm,0 ! Lumped mass off
neqit,100 ! Max no. of iterations
autots,off ! Auto time search off
lnsrch,on ! Line search on
kbc,1 ! Load applied in steps, not ramped
IC,all,temp,200 ! Initial conditions, temp = 200
PRED,-1
FLST,2,628,1,ORDE,2
FITEM,2,1
FITEM,2,-628
IC,P51X,TEMP,200,
FLST,2,2,4,ORDE,2
FITEM,2,6
FITEM,2,-7
/GO
DL,P51X, ,TEMP,1200,1 ! BC
FLST,2,2,4,ORDE,2
FITEM,2,2
FITEM,2,-3
/GO
DL,P51X, ,TEMP,200,1
SAVE
SAVE
SAVE
/STAT,SOLU
SOLVE
TIME,31536000000000
AUTOTS,-1
DELTIM,315360000000, , ,1
KBC,1
TSRES,ERASE
TIME,31536000000000
AUTOTS,-1
NSUBST,100, , ,1
KBC,1
TSRES,ERASE
/STAT,SOLU
solve
finish
/post1
set, first
etable,melty,temp, ! Create an element table
esel,s,etab,melty,600 ! Select all elements from table ! above 600
finish
/solu ! Re-enter solution phase
antype,,rest ! Restart analysis
ekill,all ! Kill all selected elements
esel,all ! Re-select all elements
finish
/post1 ! Re-enter postprocessor
set,first ! Read in last subset of data
esel,s,live ! Select all live elements
plnsol,temp ! Plot the temp contour of the live elements
!/CONT,1,10,200,100,1200
!PLNS,TEMP,
!/REPLOT
*DO, i,1,10,1
set,i
etable,delete
etable,melty,temp, ! Create an element table
esel,s,etab,melty,600 ! Select all elements from table ! above 600
finish
/solu ! Re-enter solution phase
antype,,rest ! Restart analysis
ekill,all ! Kill all selected elements
esel,all ! Re-select all elements
finish
/post1 ! Re-enter postprocessor
set,i ! Read in last subset of data
esel,s,live ! Select all live elements
plnsol,temp
/CONT,1,10,200,100,1200
PLNS,TEMP,
/replot
*ENDDO
ANTIME,100,0.5, ,0,2,0,0.31536E+14