CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   user defined function (https://www.cfd-online.com/Forums/fluent/137469-user-defined-function.html)

Geethu g June 17, 2014 06:36

user defined function
 
hello,

am new in fluent. i want to create a new material in fluent database. the material is salt water. but i dont know how to write udf code for making this new material. can anyone help me???

Sun June 18, 2014 07:22

Hi,
If the properties of salt water are not varying (say with respect to time or other independent variables), I don't think you need any UDFs. You can simply create a new material by modifying an available one. For example see this tutorial on how to create a new material:
http://aerojet.engr.ucdavis.edu/flue...tg/node309.htm

cheers!

I-mech June 18, 2014 07:50

Quote:

Originally Posted by Geethu g (Post 497356)
hello,

am new in fluent. i want to create a new material in fluent database. the material is salt water. but i dont know how to write udf code for making this new material. can anyone help me???

There are few threads about it, have a look.
Once you've created a new material, if you need to set a property that is for example temperature dependent you need a UDF similar to the following.
Once you've interpreted your udf, you have to modify material property calling your function.

This udf set a temperature dependent viscosity, you can modify it for your goal.

/************************************************** *******************
UDF for Temperature dependent Dynamic Viscosity
************************************************** ********************/
#include "udf.h"
#include "math.h"
DEFINE_PROPERTY(cell_viscosity,cell,thread)
{
real mu_lam;
real temp = C_T(cell,thread);
{
mu_lam=0.0000631*pow(10,3.722*pow(1+(temp-273)/(135),-1.102));
return mu_lam;
}
}

Geethu g June 19, 2014 04:26

okay...:) i will try these steps....thankyou so much guys.....:)

Harith January 25, 2016 14:01

Hi Geethu,

Did u manage to model Salt-water as a material in fluent?
I am struggling to do this as well.
Please let me know if you found out how to do this.

Thank you very much.

If anyone else has an idea on how to do this please let me know...

Thanks.


All times are GMT -4. The time now is 06:44.