X Zhou
Mechanical
- Dec 7, 2016
- 3
Dear all,
I encountered a problem in debugging an element birth-death problem. I’m new to this community as well as APDL language, so I hope your extensive experience would help me.
Problem statement:
I was trying to construct a cuboid model, apply initial temperature and convection boundary condition first, kill all elements, and activate the elements one by one to simulate an additive manufacturing process. The activation procedure involves activate along the length, width, and height, so I programmed it as a triple nested do loop. However, ANSYS gives me an error of “an error has occurred in reading the CDWRITE file on surface loads (CONV). This may be the result of editing the CDWRITE file.”
Debug approaches:
Remove width and height loop: program runs without error and result looks reasonable
Remove convection BC: program runs without error
Substitute convection to heat flux: similar error occurred
Run inside loop twice with outside loop counter manually changed: program runs without error and result looks reasonable. This is what confuse me at most, is there any special issue I need pay attention to when using nested loop? I know a maximum of 20 nested loops is allowed, but I don't think I exceed that limit.
APDL codes I used:
I removed the death-birth feature but the problem presists. Right now it is nothing but a transient heat transfer problem with multiple restrat in the middle.
Much appreciated if you could help me.
X.Zhou
I encountered a problem in debugging an element birth-death problem. I’m new to this community as well as APDL language, so I hope your extensive experience would help me.
Problem statement:
I was trying to construct a cuboid model, apply initial temperature and convection boundary condition first, kill all elements, and activate the elements one by one to simulate an additive manufacturing process. The activation procedure involves activate along the length, width, and height, so I programmed it as a triple nested do loop. However, ANSYS gives me an error of “an error has occurred in reading the CDWRITE file on surface loads (CONV). This may be the result of editing the CDWRITE file.”
Debug approaches:
Remove width and height loop: program runs without error and result looks reasonable
Remove convection BC: program runs without error
Substitute convection to heat flux: similar error occurred
Run inside loop twice with outside loop counter manually changed: program runs without error and result looks reasonable. This is what confuse me at most, is there any special issue I need pay attention to when using nested loop? I know a maximum of 20 nested loops is allowed, but I don't think I exceed that limit.
APDL codes I used:
I removed the death-birth feature but the problem presists. Right now it is nothing but a transient heat transfer problem with multiple restrat in the middle.
Code:
[b]!***************TEMPERATURE CALCULATION*****************[/b]
FINISH
/CLEAR,START
/TITLE, Transient Analysis of FDM
/UNITS,SI
*SET,L2,2E-3
*SET,W2,2E-3
*SET,H2,0.3E-3
!Regulate the size of one single element
L1=10*L2
W1=6*W2
H1=5*H2
Tnumber=L1/L2*W1/W2*H1/H2 !dimension ratio
/PREP7
ET,1,SOLID70
MP,DENS,1,1150
MP,KXX,1,3E-2
MP,C,1,1470 ! a bunch of properties
! MODELING
BLC4,0,0,L1,W1,H1 ! Create rectangle
LSEL,S,LENGTH,,L1,,,0
LESIZE,ALL,L2,,,,0,,,0
LSEL,A,LENGTH,,W1,,,0
LESIZE,ALL,W2,,,,0,,,0
LSEL,A,LENGTH,,H1,,,0
LESIZE,ALL,H2,,,,0,,,0
VMESH,ALL
FINISH
/SOLU
ANTYPE,TRANSIENT,NEW
TRNOPT,FULL
LUMPM,OFF
NROPT,FULL,,ON
TINTP,,,,1.0
LSCLEAR,ALL !remove all loads
IC,ALL,TEMP,270
SFA,ALL,1,CONV,72,25 !Apply convection BC
/REPLOT,FAST
OUTRES,ALL,ALL
OUTPR,NSOL,LAST
Itvar=0.1
tvar=Itvar
TIME,Itvar
KBC,1 !STEP
AUTOTS,ON
DELTIM,Itvar/4,Itvar/4,Itvar/2,0
TIMINT,ON
*DO,Wvar,1,5,2 !W do loop, [b]Wvar is not used inside of the loop[/b]
*DO,Lvar1,1,10,1 !l do +loop, [b]Lvar1 is not used inside of the loop[/b]
SOLVE
tvar=tvar+Itvar
save
FINISH
PARSAV,ALL !ALL - Write scalar and array parameters.
/SOL
ANTYPE,,RESTART
PARRES
TIME,tvar
*ENDDO
*ENDDO
!*ENDDO
SOLVE
[b]!****************program COMPLETE**************![/b]
Much appreciated if you could help me.
X.Zhou