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

How to write UDF for the density at melting point?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 22, 2018, 04:49
Default How to write UDF for the density at melting point?
  #1
New Member
 
Shivam Kumar
Join Date: May 2018
Posts: 1
Rep Power: 0
smkr is on a distinguished road
I am modelling isothermal melting of the metals in FLUENT 17.2. I am unable to give different density for the solid and liquid at the melting point. Can any one please tell me about how to write an UDF for this.

Thank You!
smkr is offline   Reply With Quote

Old   May 23, 2018, 07:54
Default
  #2
Member
 
zobekenobe
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 72
Rep Power: 17
zobekenobe is on a distinguished road
using define_property you can select the material and then in it's density tab hook the following macro


define the melting point and the solid and liquid density, and using an if else assign the required density and return it from the macro



Code:
#define "udf.h"
#define T_melting_point = 100;
#define solid_density = 10.0;
#define liquid_density = 2.0;


DEFINE_PROPERTY(udf_name, c, ct)
{
    real temp = C_T(c, ct);
    real metal_density;

    if(temp > T_melting_point)
        metal_density = liquid_density;
    else
        metal_density = solid_density;

    return metal_density

}

hope this helps
zobekenobe is offline   Reply With Quote

Old   May 23, 2018, 21:47
Default
  #3
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
fluent has "solidification & melting" model
use Ansys Fluent User's Guide and Ansys Fluent Tutorial Guide to find detailed information

best regards
AlexanderZ is offline   Reply With Quote

Reply


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
confusion on how to write udf for density of a mixture solution in multiphase problem Hirakjyoti Fluent UDF and Scheme Programming 1 September 11, 2017 02:21
Can we write UDF for secondary phase droplet/bubble diameter in Eulerain model? Navier Stoke Fluent UDF and Scheme Programming 1 September 7, 2017 16:02
Point Source for Radiation by UDF daire6 FLUENT 0 May 13, 2016 09:07
[ICEM] Point density as a custom function/spline (Pre-Mesh Params)? Electrophile ANSYS Meshing & Geometry 1 July 21, 2015 09:03
UDF for searching the closest point to a certain point princekar Fluent UDF and Scheme Programming 2 April 26, 2015 05:53


All times are GMT -4. The time now is 17:14.