|
[Sponsors] |
July 6, 2023, 10:02 |
Melting Dependent UDF
|
#1 |
New Member
Melody
Join Date: Jul 2023
Posts: 8
Rep Power: 3 |
I am simulating SLM of basalt on ansys fluent and I want to write a UDF which says that the density before melting 1810, the density during the liquid state is 2760, and the density after resolidification is 2704. Originally I had created a variable "melted" to track whether the sample has already been melted, and thus the density would depend on both temperature and the melted variable. However, because the function is called from scratch every iteration, the melted variable is not stored anywhere and my function doesn't work. I also don't think it's possible to code it based on time because not all elements melt at the same time. I've attached a screenshot of my code so far, is there any other way to make my vision work? Screenshot 2023-07-06 145940.png
|
|
July 6, 2023, 16:34 |
|
#2 |
Senior Member
Kareem
Join Date: Nov 2022
Location: New York
Posts: 125
Rep Power: 4 |
Is there a reason you are trying to do this with a UDF rather than a piecewise equation in the materials GUI?
__________________
Please like the answer if it helped! Video Tutorials and Tips: https://www.youtube.com/@cfdkareem/featured |
|
July 7, 2023, 03:58 |
|
#3 |
New Member
Melody
Join Date: Jul 2023
Posts: 8
Rep Power: 3 |
Thanks for the reply, I am using a UDF because the initial density of 1810 has a temperature range of 300K - 1450K, but the resolidified density at the end of 2704 has the same temperature range, so I didn't think that was possible to do using the materials GUI
|
|
July 11, 2023, 05:21 |
|
#4 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
you may use user defined memory to store flag
C_UDMI(c,t,0) = value change melting variable to C_UDMI(c,t,0). allocate user defined memory location = 1 at fluent GUI next time put the code here, so It could be modified on the other hand, you may use piecewise equation for this simulations, as was suggested
__________________
best regards ****************************** press LIKE if this message was helpful |
|
Tags |
density, melting/solidification, slm, udf, udf code |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF for Temperature Dependent Energy Source | er.mkumar | Fluent UDF and Scheme Programming | 9 | March 14, 2024 05:01 |
Pressure&Temperature dependent viscosity UDF - error in calculation | JINXING | FLUENT | 5 | January 12, 2023 05:24 |
Creating a heat Flux UDF with a temperature Dependent argument | nagas | Fluent UDF and Scheme Programming | 3 | March 20, 2018 08:14 |
udf for moving heat flux for the simulation of laser melting | rishitosh | Fluent UDF and Scheme Programming | 2 | January 24, 2018 02:01 |
Problems in converging viscosity UDF dependent upon strain rate and temperature. | alexskerhut | Fluent UDF and Scheme Programming | 1 | March 17, 2016 08:19 |