|
[Sponsors] |
August 15, 2015, 14:20 |
User defined viscosity - error in load
|
#1 |
Senior Member
|
Here is my udf for defining the viscosity as function of temperature and pressure:
Code:
#include "udf.h" DEFINE_PROPERTY(viscosity,c,t) { real mu_laminar, temp, pr; temp = C_T(c,t); pr = C_T(c,t); mu_laminar = 0.0127*exp(0.000000213345*(pr- 101345))*exp(0.029*(temp-293)); return mu_laminar; } D:\a\libudf\win64\3ddp\libudf.dll Copied D:\a/D:\a\viscosity .c to libudf\src udf_names.c and user_nt.udf files in 3ddp are upto date. (system "copy "C:\PROGRA~1\ANSYSI~1\v160\fluent"\fluent16.0.0\sr c\udf\makefile_nt.udf "libudf\win64\3ddp\makefile" ") 1 file(s) copied. (chdir "libudf")(chdir "win64\3ddp") Done. Then I click on load option to make it available to solver, but then I get this error message : Any suggestion? |
|
August 16, 2015, 02:26 |
|
#2 |
Senior Member
|
Today morning, just started the procedure again without any changes to system configuration or Fluent settings and surprisingly every thing is working fine.
Though you can see that I have made few changes to UDF but that is not more than adding comments etc... Here is the message I received now (perfectly working udf ) And UDF (also attached) PS: I am using Visual studio Express 12.0. For editing of udf files ( c files in fact), I am using notepad++. |
|
August 18, 2015, 07:38 |
|
#3 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
I generally find it safest to first unload the compiled library before building and loading a new library (instructions). Restarting Fluent would have a similar effect which could explain why the compilation worked next day.
|
|
August 18, 2015, 21:00 |
|
#5 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
Fluent UDF macros are implemented with the usual C function definitions which may return a value. Article on C Functions. In this particular case, the DEFINE_PROPERTY macro is called for each cell and returns the viscosity value. This process occurs when the properties are updated (near the end of each iteration before the convergence check).
|
|
Tags |
ansys, fluent, udf, user defined viscosity, viscosity |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
User Defined Scalars - Returning Values | Carlos V. | FLUENT | 0 | April 19, 2006 19:18 |
Source term for user defined scalars | Mech.eng. | Siemens | 0 | March 16, 2006 07:15 |
Usage of user defined functions | Gowrish | FLUENT | 1 | October 26, 2005 08:44 |
User viscosity routine and user scalars? | Jeff | Siemens | 3 | January 6, 2003 06:26 |
Commercial software question (user viscosity) | Jeff | Main CFD Forum | 2 | July 20, 2002 11:41 |