bzz77
Geotechnical
- Oct 20, 2008
- 2
Hi--I am a Geoscience researcher wanting to use ANSYS for modeling melting of rocks. I'm a new user. I would very much appreciate help with the following problem.
I want to build on/modify an example I found here: where element death is used for modeling melting. At the bottom of the site page there is a link to the command code. There is also a suggestion to modify the code to more accurately model element death over time. This is what I want to do, but I'm having problems making an animation showing elements melting sequentially (my code is below). Here's the suggestion at the website:
Rather than running the analysis for a time of 60 and killing any elements above the melting temperature at the END, a check can be done after each substep to see if any elements are above the specified temperature and be killed at that point. That way, the prescribed convection can then act on the elements below those killed, more accurately modelling the heating process.
I can mesh and get a solution (I think), but can't make an animation showing melting over time--I just keep getting a single temp shown or, when I change the BC/IC, I get error messages saying that no element is selected. I don't know what is going on with the animation! Can anyone tell me how to animate the melting process as elements melt/disappear? I am new at this, so would really appreciate some specific suggestions. Many thanks.
Here is my code
/title, Convection Example
/prep7 ! Enter the preprocessor
! define geometry
k,1,0,0 ! Define keypoints
k,2,0.03,0
k,3,0.03,0.03
k,4,0,0.03
a,1,2,3,4 ! Connect the keypoints to form area
! mesh 2D areas
ET,1,Plane55 ! Element type
MP,Dens,1,2262e9 ! Define density
mp,c,1,0.001604 ! Define specific heat
mp,kxx,1,1.8 ! Define heat transfer coefficient
esize,0.0025 ! Mesh size
amesh,all ! Mesh area
finish
/solu ! Enter solution phase
antype,4 ! Transient analysis
tot_time = 1e6
t_steps = 50
time_inc = tot_time/t_steps
time,1e6 ! Time at end of analysis
nropt,full ! Newton Raphson - full
lumpm,0 ! Lumped mass off
nsubst,20 ! Number of substeps, 20
neqit,10 ! Max no. of iterations
autots,off ! Auto time search off
lnsrch,on ! Line search on
TUNIF,200,
IC,all,temp,200 ! Initial conditions, temp = 200
*do, i,1 ,50, 1
/solu
time=i*time_inc
nsub, 1
outres,all,all ! Output data for all substeps
!... any stuff about boundary conditions ...
! fixed temp BC's
nsel,s,ext ! Node select all exterior nodes
sf,all,conv,1,1200
NSEL,ALL ! Reselect all nodes
kbc,1 ! Load applied in steps, not ramped
/gst,off ! Turn off graphical convergence monitor
solve
finish
/post1
set, last
etable,melty,temp, ! Create an element table
esel,s,etab,melty,900 ! Select all elements from table above 500
finish
/solu ! Re-enter solution phase
antype,,rest ! Restart analysis
ekill,all ! Kill all selected elements
esel,all
!*enddo
/post1 ! Re-enter postprocessor
set,last ! 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
*enddo
/post1
ANTIME,20,0.5, ,0,2,200,1200
I want to build on/modify an example I found here: where element death is used for modeling melting. At the bottom of the site page there is a link to the command code. There is also a suggestion to modify the code to more accurately model element death over time. This is what I want to do, but I'm having problems making an animation showing elements melting sequentially (my code is below). Here's the suggestion at the website:
Rather than running the analysis for a time of 60 and killing any elements above the melting temperature at the END, a check can be done after each substep to see if any elements are above the specified temperature and be killed at that point. That way, the prescribed convection can then act on the elements below those killed, more accurately modelling the heating process.
I can mesh and get a solution (I think), but can't make an animation showing melting over time--I just keep getting a single temp shown or, when I change the BC/IC, I get error messages saying that no element is selected. I don't know what is going on with the animation! Can anyone tell me how to animate the melting process as elements melt/disappear? I am new at this, so would really appreciate some specific suggestions. Many thanks.
Here is my code
/title, Convection Example
/prep7 ! Enter the preprocessor
! define geometry
k,1,0,0 ! Define keypoints
k,2,0.03,0
k,3,0.03,0.03
k,4,0,0.03
a,1,2,3,4 ! Connect the keypoints to form area
! mesh 2D areas
ET,1,Plane55 ! Element type
MP,Dens,1,2262e9 ! Define density
mp,c,1,0.001604 ! Define specific heat
mp,kxx,1,1.8 ! Define heat transfer coefficient
esize,0.0025 ! Mesh size
amesh,all ! Mesh area
finish
/solu ! Enter solution phase
antype,4 ! Transient analysis
tot_time = 1e6
t_steps = 50
time_inc = tot_time/t_steps
time,1e6 ! Time at end of analysis
nropt,full ! Newton Raphson - full
lumpm,0 ! Lumped mass off
nsubst,20 ! Number of substeps, 20
neqit,10 ! Max no. of iterations
autots,off ! Auto time search off
lnsrch,on ! Line search on
TUNIF,200,
IC,all,temp,200 ! Initial conditions, temp = 200
*do, i,1 ,50, 1
/solu
time=i*time_inc
nsub, 1
outres,all,all ! Output data for all substeps
!... any stuff about boundary conditions ...
! fixed temp BC's
nsel,s,ext ! Node select all exterior nodes
sf,all,conv,1,1200
NSEL,ALL ! Reselect all nodes
kbc,1 ! Load applied in steps, not ramped
/gst,off ! Turn off graphical convergence monitor
solve
finish
/post1
set, last
etable,melty,temp, ! Create an element table
esel,s,etab,melty,900 ! Select all elements from table above 500
finish
/solu ! Re-enter solution phase
antype,,rest ! Restart analysis
ekill,all ! Kill all selected elements
esel,all
!*enddo
/post1 ! Re-enter postprocessor
set,last ! 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
*enddo
/post1
ANTIME,20,0.5, ,0,2,200,1200