CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   UDF compilation problem -- "undeclared variable" (

Henrik Ström September 20, 2005 08:26

UDF compilation problem -- "undeclared variable"

I would be very happy if someone could help me with this... Probably not too complicated since I am quite new to C programming.. I am working on a bigger UDF but to isolate the problem I have tried to compile smaller parts of code, but I still can't see what I do wrong.

When I try to load a UDF I've written into FLUENT (via Defined->User-Defined->Functions->Interpreted) I get an error message during compilation: "line 7: P_CURRENT_LAW: undeclared variable".

This is when I'm trying to use the P_CURRENT_LAW(p) macro inside a DEFINE_DPM_SWITCH command. The code is more or less directly copied from the UDF User Guide, only slightly simplified:


#include "udf.h"

#include "dpm.h"



if(5.0 > 1.0)






What is wrong?? I get the same error message when I try to use P_MATERIAL(p) inside a DEFINE_DPM_SCALAR_UPDATE command.

In other parts of my bigger UDF I use macros such as P_RHO(p), P_MASS(p), P_INIT_MASS(p), VaporizationLaw(p) etc without trouble.

Any help is highly appreciated!

Thank you very much, Henrik

Henrik Ström September 21, 2005 05:25

Re: UDF compilation problem -- "undeclared variabl
I solved this problem by compiling the UDF instead.


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