CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   UDF Compilation Error (http://www.cfd-online.com/Forums/fluent/50453-udf-compilation-error.html)

Karthik February 2, 2009 16:22

UDF Compilation Error
 
Hello all,

I'm working in a case that needs an udf to control the viscosity of fluid. I compile the udf and the following error message appears,

ERROR: Set_material_property: null user defined function name

I would be grateful if anybody could help me to solve this problem.

Thanks in advance

Karthik. K.


KJ Larsen February 8, 2009 17:38

Re: UDF Compilation Error
 
Hello Karthik

As it sounds as if it's complaining about your UDF's name:

Try set_material_properties in the name given as an arguments for the (I assume) Define_Property UDF, I do not believe capitals are allowed.

Hope it's this simple. Kris


Karthik February 9, 2009 12:17

Re: UDF Compilation Error
 
Hi Kris,

Thanks a lot for the reply. I tried changing the name but it did not work. This is UDF I am using can you please let me know if some thing is wrong with it?

#include "udf.h" #define n 0.67 #define alph 1.0 #define mu 0.0042

DEFINE_PROPERTY(power_law_model,cell,thread) {

float trace;

double visc;

float u[3], v[3], w[3];

int j;

for(j=0;j<3;j++)

{

u[j]=C_U_G(cell,thread)[j];

v[j]=C_V_G(cell,thread)[j];

w[j]=C_W_G(cell,thread)[j];

} trace= 0.5*(2*pow(u[0],2)+pow(v[0]+u[1],2)+2*pow(v[1],2)+pow(v[2]+w[1],2)+2*pow(w[2],2)+pow(w[0]+u[2],2)); visc=0.5*mu*pow(1+alph*trace,0.67); return visc; }

KJ Larsen February 9, 2009 12:38

Re: UDF Compilation Error
 
Hello Karthik

I cannot see any immediate problems in that code but it's very difficult without any clues. Surely the error has changed; since Set_material_property is not in this code. Are line numbers given?

Kris


Karthik February 9, 2009 12:42

Re: UDF Compilation Error
 
Hi Kris,

It does'nt show the line numbers, but this is the error it shows when I try to compile it,

Error: Set_Material_Property: null user-defined-function name Error Object: #f

I tried changing the name but it did not work. Any idea of what else can I do?

Thanks, Karthik.


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