-
-
September 3, 2025 at 3:04 pm
Sara.Ranjbareslamloo
SubscriberHello, I am working on capturing residual stress of LPBF in two dissimilar materials using ANSYS Workbench. Since there is no direct module for dissimilar materials, I am simulating the transient thermal behavior and coupling it with structural analysis.
I have written a command for laser movement using a 3D Gaussian heat source, but now I want to extend it to handle multiple laser tracks. I attempted to use element birth and death for each track and apply the heat source individually. However, the issue is that all the commands are being applied simultaneously, whereas I need them to be executed sequentially at different times.
Does anyone have suggestions on how I can achieve this?
I mean I want to do exactly like this tutorial Additive Manufacturing with Element Birth & Death ANSYS Workbench (3D Goldak heat source)
here is my command for one laser trackÂ
g=0.3 !absorbityp=230 !Laser Power in wattsw=0.001  !radius of moving sourceA=(2*g*p)/(22/7*w**2)B=-3C=0D=900 !scan speedE=0F=w**2Â*DIM,HEAT_FLX1,TABLE,8,14,1,,,,0!! Begin of equation: A*exp(B*(({X}-C)^2+({Y}-D*{TIME}-E)^2)/F)*SET,HEAT_FLX1(0,0,1), 0.0, -999*SET,HEAT_FLX1(2,0,1), 0.0*SET,HEAT_FLX1(3,0,1), A*SET,HEAT_FLX1(4,0,1), B*SET,HEAT_FLX1(5,0,1), C*SET,HEAT_FLX1(6,0,1), D*SET,HEAT_FLX1(7,0,1), E*SET,HEAT_FLX1(8,0,1), F*SET,HEAT_FLX1(0,1,1), 1.0, -1, 0, 1, 2, 2, 19*SET,HEAT_FLX1(0,2,1), 0.0, -2, 0, 2, 0, 0, -1*SET,HEAT_FLX1(0,3,1),  0, -3, 0, 1, -1, 17, -2*SET,HEAT_FLX1(0,4,1), 0.0, -1, 0, 1, 20, 3, 1*SET,HEAT_FLX1(0,5,1), 0.0, -2, 0, 1, 3, 2, -1*SET,HEAT_FLX1(0,6,1), 0.0, -1, 0, 1, -2, 2, 21*SET,HEAT_FLX1(0,7,1), 0.0, -2, 0, 2, 0, 0, -1*SET,HEAT_FLX1(0,8,1), 0.0, -4, 0, 1, -1, 17, -2*SET,HEAT_FLX1(0,9,1), 0.0, -1, 0, 1, -3, 1, -4*SET,HEAT_FLX1(0,10,1), 0.0, -2, 0, 1, 18, 3, -1*SET,HEAT_FLX1(0,11,1), 0.0, -1, 0, 1, -2, 4, 22*SET,HEAT_FLX1(0,12,1), 0.0, -1, 7, 1, -1, 0, 0*SET,HEAT_FLX1(0,13,1), 0.0, -2, 0, 1, 17, 3, -1*SET,HEAT_FLX1(0,14,1), 0.0, 99, 0, 1, -2, 0, 0! End of equation: A*exp(B*(({X}-C)^2+({Y}-D*{TIME}-E)^2)/F)!-->sf,s1,hflux,%HEAT_FLX1% -
September 4, 2025 at 7:22 pm
Chandra Sekaran
Ansys EmployeeThe above equation is created in the MAPDL GUI under Function Builder. You can also have multi-regime function where you can set the equation for a specific time range and set it to zero for the rest of the time.Â
The other may be easier approach is create multiple load steps. For example first load step may be from time 0 to t1 (corresponding to track 1), second load step from t1 to t2 (track 2) etc. You can then create mulitple command snippets - one for each track. In the details of each command you can use the 'step control' to specify when the command snippet should be used.Â
NOTE: You must remember to delete the previous track loads at the beginning of each snippet (SFDELE). Otherwise those loads will still be active.
-
September 5, 2025 at 2:56 pm
Sara.Ranjbareslamloo
SubscriberHello,
Thank you for your help.
I obtained the 4-regime equation from MPDL and tested it in different ways. First, I placed the entire command into a single file and applied it to the model, and then I tried applying each laser track in separate commands. In both cases, I couldn’t get the correct results (see screenshots below).
When I placed everything into one command file, no heat flux was applied to the surface at all.
When I separated the commands, only the first step produced results, and the flux was not activated in steps 2–4.
I am wondering if I want to seperate the command for each laser track, where should I put the first part of command which is"time equation"
Below is the command:Â
g=0.3 !absorbityp=230000 !Laser Power in wattsw=1  !radius of moving sourceA=(2*g*p)/(22/7*w**2)B=-3C=0D=500/1000 !scan speedE=-5F=w**2Â*DIM,HEAT_FLX1,TABLE,8,14,5,,,,0Â! Begin of equation: {TIME}*SET,HEAT_FLX1(0,0,1), 0.0, -999*SET,HEAT_FLX1(2,0,1), 0.0*SET,HEAT_FLX1(3,0,1), 0.0*SET,HEAT_FLX1(4,0,1), 0.0*SET,HEAT_FLX1(5,0,1), 0.0*SET,HEAT_FLX1(6,0,1), 0.0*SET,HEAT_FLX1(7,0,1), 0.0*SET,HEAT_FLX1(8,0,1), 0.0*SET,HEAT_FLX1(0,1,1), 1.0, 99, 0, 1, 1, 0, 0*SET,HEAT_FLX1(0,2,1),  0*SET,HEAT_FLX1(0,3,1),  0*SET,HEAT_FLX1(0,4,1),  0*SET,HEAT_FLX1(0,5,1),  0*SET,HEAT_FLX1(0,6,1),  0*SET,HEAT_FLX1(0,7,1),  0*SET,HEAT_FLX1(0,8,1),  0*SET,HEAT_FLX1(0,9,1),  0*SET,HEAT_FLX1(0,10,1),  0*SET,HEAT_FLX1(0,11,1),  0*SET,HEAT_FLX1(0,12,1),  0*SET,HEAT_FLX1(0,13,1),  0*SET,HEAT_FLX1(0,14,1),  0! End of equation: {TIME}!ÂÂ! Begin of equation: A*exp(B*(({X}-C)^2+({Y}-D*{TIME}-E)^2)/F)*SET,HEAT_FLX1(0,0,2), 10, -999*SET,HEAT_FLX1(2,0,2), 0.0*SET,HEAT_FLX1(3,0,2), A*SET,HEAT_FLX1(4,0,2), B*SET,HEAT_FLX1(5,0,2), C*SET,HEAT_FLX1(6,0,2), D*SET,HEAT_FLX1(7,0,2), E*SET,HEAT_FLX1(8,0,2), F*SET,HEAT_FLX1(0,1,2), 1.0, -1, 0, 1, 2, 2, 19*SET,HEAT_FLX1(0,2,2), 0.0, -2, 0, 2, 0, 0, -1*SET,HEAT_FLX1(0,3,2),  0, -3, 0, 1, -1, 17, -2*SET,HEAT_FLX1(0,4,2), 0.0, -1, 0, 1, 20, 3, 1*SET,HEAT_FLX1(0,5,2), 0.0, -2, 0, 1, 3, 2, -1*SET,HEAT_FLX1(0,6,2), 0.0, -1, 0, 1, -2, 2, 21*SET,HEAT_FLX1(0,7,2), 0.0, -2, 0, 2, 0, 0, -1*SET,HEAT_FLX1(0,8,2), 0.0, -4, 0, 1, -1, 17, -2*SET,HEAT_FLX1(0,9,2), 0.0, -1, 0, 1, -3, 1, -4*SET,HEAT_FLX1(0,10,2), 0.0, -2, 0, 1, 18, 3, -1*SET,HEAT_FLX1(0,11,2), 0.0, -1, 0, 1, -2, 4, 22*SET,HEAT_FLX1(0,12,2), 0.0, -1, 7, 1, -1, 0, 0*SET,HEAT_FLX1(0,13,2), 0.0, -2, 0, 1, 17, 3, -1*SET,HEAT_FLX1(0,14,2), 0.0, 99, 0, 1, -2, 0, 0! End of equation: A*exp(B*(({X}-C)^2+({Y}-D*{TIME}-E)^2)/F)sfdele,all,allsf,s1,hflux,%HEAT_FLX1%Â! Begin of equation: A*exp(B*(({X}-C)^2+({Y}+D*{TIME}-E)^2)/F)*SET,HEAT_FLX1(0,0,3), 20, -999*SET,HEAT_FLX1(2,0,3), 0.0*SET,HEAT_FLX1(3,0,3), A*SET,HEAT_FLX1(4,0,3), B*SET,HEAT_FLX1(5,0,3), C*SET,HEAT_FLX1(6,0,3), D*SET,HEAT_FLX1(7,0,3), E*SET,HEAT_FLX1(8,0,3), F*SET,HEAT_FLX1(0,1,3), 1.0, -1, 0, 1, 2, 2, 19*SET,HEAT_FLX1(0,2,3), 0.0, -2, 0, 2, 0, 0, -1*SET,HEAT_FLX1(0,3,3),  0, -3, 0, 1, -1, 17, -2*SET,HEAT_FLX1(0,4,3), 0.0, -1, 0, 1, 20, 3, 1*SET,HEAT_FLX1(0,5,3), 0.0, -2, 0, 1, 3, 1, -1*SET,HEAT_FLX1(0,6,3), 0.0, -1, 0, 1, -2, 2, 21*SET,HEAT_FLX1(0,7,3), 0.0, -2, 0, 2, 0, 0, -1*SET,HEAT_FLX1(0,8,3), 0.0, -4, 0, 1, -1, 17, -2*SET,HEAT_FLX1(0,9,3), 0.0, -1, 0, 1, -3, 1, -4*SET,HEAT_FLX1(0,10,3), 0.0, -2, 0, 1, 18, 3, -1*SET,HEAT_FLX1(0,11,3), 0.0, -1, 0, 1, -2, 4, 22*SET,HEAT_FLX1(0,12,3), 0.0, -1, 7, 1, -1, 0, 0*SET,HEAT_FLX1(0,13,3), 0.0, -2, 0, 1, 17, 3, -1*SET,HEAT_FLX1(0,14,3), 0.0, 99, 0, 1, -2, 0, 0! End of equation: A*exp(B*(({X}-C)^2+({Y}+D*{TIME}-E)^2)/F)!sfdele,all,allsf,s2,hflux,%HEAT_FLX1%Â! Begin of equation: A*exp(B*(({X}-C)^2+({Y}-D*{TIME}-E)^2)/F)*SET,HEAT_FLX1(0,0,4), 30, -999*SET,HEAT_FLX1(2,0,4), 0.0*SET,HEAT_FLX1(3,0,4), A*SET,HEAT_FLX1(4,0,4), B*SET,HEAT_FLX1(5,0,4), C*SET,HEAT_FLX1(6,0,4), D*SET,HEAT_FLX1(7,0,4), E*SET,HEAT_FLX1(8,0,4), F*SET,HEAT_FLX1(0,1,4), 1.0, -1, 0, 1, 2, 2, 19*SET,HEAT_FLX1(0,2,4), 0.0, -2, 0, 2, 0, 0, -1*SET,HEAT_FLX1(0,3,4),  0, -3, 0, 1, -1, 17, -2*SET,HEAT_FLX1(0,4,4), 0.0, -1, 0, 1, 20, 3, 1*SET,HEAT_FLX1(0,5,4), 0.0, -2, 0, 1, 3, 2, -1*SET,HEAT_FLX1(0,6,4), 0.0, -1, 0, 1, -2, 2, 21*SET,HEAT_FLX1(0,7,4), 0.0, -2, 0, 2, 0, 0, -1*SET,HEAT_FLX1(0,8,4), 0.0, -4, 0, 1, -1, 17, -2*SET,HEAT_FLX1(0,9,4), 0.0, -1, 0, 1, -3, 1, -4*SET,HEAT_FLX1(0,10,4), 0.0, -2, 0, 1, 18, 3, -1*SET,HEAT_FLX1(0,11,4), 0.0, -1, 0, 1, -2, 4, 22*SET,HEAT_FLX1(0,12,4), 0.0, -1, 7, 1, -1, 0, 0*SET,HEAT_FLX1(0,13,4), 0.0, -2, 0, 1, 17, 3, -1*SET,HEAT_FLX1(0,14,4), 0.0, 99, 0, 1, -2, 0, 0! End of equation: A*exp(B*(({X}-C)^2+({Y}-D*{TIME}-E)^2)/F)!sfdele,all,allsf,s3,hflux,%HEAT_FLX1%Â! Begin of equation: A*exp(B*(({X}-C)^2+({Y}+D*{TIME}-E)^2)/F)*SET,HEAT_FLX1(0,0,5), 40, -999*SET,HEAT_FLX1(2,0,5), 0.0*SET,HEAT_FLX1(3,0,5), A*SET,HEAT_FLX1(4,0,5), B*SET,HEAT_FLX1(5,0,5), C*SET,HEAT_FLX1(6,0,5), D*SET,HEAT_FLX1(7,0,5), E*SET,HEAT_FLX1(8,0,5), F*SET,HEAT_FLX1(0,1,5), 1.0, -1, 0, 1, 2, 2, 19*SET,HEAT_FLX1(0,2,5), 0.0, -2, 0, 2, 0, 0, -1*SET,HEAT_FLX1(0,3,5),  0, -3, 0, 1, -1, 17, -2*SET,HEAT_FLX1(0,4,5), 0.0, -1, 0, 1, 20, 3, 1*SET,HEAT_FLX1(0,5,5), 0.0, -2, 0, 1, 3, 1, -1*SET,HEAT_FLX1(0,6,5), 0.0, -1, 0, 1, -2, 2, 21*SET,HEAT_FLX1(0,7,5), 0.0, -2, 0, 2, 0, 0, -1*SET,HEAT_FLX1(0,8,5), 0.0, -4, 0, 1, -1, 17, -2*SET,HEAT_FLX1(0,9,5), 0.0, -1, 0, 1, -3, 1, -4*SET,HEAT_FLX1(0,10,5), 0.0, -2, 0, 1, 18, 3, -1*SET,HEAT_FLX1(0,11,5), 0.0, -1, 0, 1, -2, 4, 22*SET,HEAT_FLX1(0,12,5), 0.0, -1, 7, 1, -1, 0, 0*SET,HEAT_FLX1(0,13,5), 0.0, -2, 0, 1, 17, 3, -1*SET,HEAT_FLX1(0,14,5), 0.0, 99, 0, 1, -2, 0, 0! End of equation: A*exp(B*(({X}-C)^2+({Y}+D*{TIME}-E)^2)/F)!-->sfdele,all,allsf,s4,hflux,%HEAT_FLX1%ÂÂ
-
- You must be logged in to reply to this topic.
- The legend values are not changing.
- LPBF Simulation of dissimilar materials in ANSYS mechanical (Thermal Transient)
- Convergence error in modal analysis
- How to model a bimodular material in Mechanical
- APDL, memory, solid
- Meaning of the error
- Simulate a fan on the end of shaft
- Nonlinear load cases combinations
- Real Life Example of a non-symmetric eigenvalue problem
- How can the results of Pressures and Motions for all elements be obtained?
-
3927
-
1414
-
1256
-
1118
-
1015
© 2025 Copyright ANSYS, Inc. All rights reserved.