CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   UDF compilation problem -- "undeclared variable" (https://www.cfd-online.com/Forums/fluent/37949-udf-compilation-problem-undeclared-variable.html)

Henrik Ström September 20, 2005 08:26

UDF compilation problem -- "undeclared variable"
 
Hello!

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"

DEFINE_DPM_SWITCH(dpm_switch,p,coupled)

{

if(5.0 > 1.0)

P_CURRENT_LAW(p) = DPM_LAW_INITIAL_INERT_HEATING;

else

P_CURRENT_LAW(p) = DPM_LAW_VAPORIZATION;

}

---

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.

/Henrik


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