CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

Melting Dependent UDF

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By AlexanderZ

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 6, 2023, 10:02
Default Melting Dependent UDF
  #1
New Member
 
Melody
Join Date: Jul 2023
Posts: 8
Rep Power: 3
dwnzng is on a distinguished road
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
dwnzng is offline   Reply With Quote

Old   July 6, 2023, 16:34
Default
  #2
Senior Member
 
CFDKareem's Avatar
 
Kareem
Join Date: Nov 2022
Location: New York
Posts: 125
Rep Power: 4
CFDKareem is on a distinguished road
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
CFDKareem is offline   Reply With Quote

Old   July 7, 2023, 03:58
Default
  #3
New Member
 
Melody
Join Date: Jul 2023
Posts: 8
Rep Power: 3
dwnzng is on a distinguished road
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
dwnzng is offline   Reply With Quote

Old   July 11, 2023, 05:21
Default
  #4
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
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
dwnzng likes this.
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Reply

Tags
density, melting/solidification, slm, udf, udf code


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 02:51.