CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > FLUENT

UDF compilation problem -- "undeclared variable"

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   September 20, 2005, 08:26
Default UDF compilation problem -- "undeclared variable"
  #1
Henrik Ström
Guest
 
Posts: n/a
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

  Reply With Quote

Old   September 21, 2005, 05:25
Default Re: UDF compilation problem -- "undeclared variabl
  #2
Henrik Ström
Guest
 
Posts: n/a
I solved this problem by compiling the UDF instead.

/Henrik
  Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
A problem about 'printf' and 'Message' in UDF. LICH Fluent UDF and Scheme Programming 2 May 2, 2013 02:45
UDF compiling problem Wouter Fluent UDF and Scheme Programming 6 June 6, 2012 04:43
what's the problem with my udf zzyan FLUENT 0 November 4, 2010 04:56
Help! Compiled UDF problem 4 Wave tank tutorial Shane FLUENT 1 September 3, 2010 02:32
UDF variables F1, y / problem with UDF Fabian FLUENT 6 June 2, 2003 10:22


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