CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   undeclared variable (http://www.cfd-online.com/Forums/fluent-udf/76277-undeclared-variable.html)

ramintakhti May 20, 2010 11:48

undeclared variable
 
hi.
I want to interpret a udf in fluent, but i encounter this error:
"line 12: P_CELL: undeclared variable"
here is part of my file:

#include "udf.h"
DEFINE_DPM_LAW(condenshumidlaw,p,coupled)
{
#define R 8314.34;
#define Mo2 31.999;
#define Mn2 28.013;
#define Mh2o 18.015;
#define Dim 3e-5;
#define noo_wv 0.64;
cell_t c;
c=P_CELL(p);
Thread *t;
t=P_CELL_THREAD(p);
real m_cel=C_R(c,t)*C_VOLUME(c,t);
real t_cel=C_T(c,t);


is there any one who can help me.
so thanks!

gearboy May 23, 2010 23:22

Quote:

Originally Posted by ramintakhti (Post 259565)
hi.
I want to interpret a udf in fluent, but i encounter this error:
"line 12: P_CELL: undeclared variable"
here is part of my file:

#include "udf.h"
DEFINE_DPM_LAW(condenshumidlaw,p,coupled)
{
#define R 8314.34;
#define Mo2 31.999;
#define Mn2 28.013;
#define Mh2o 18.015;
#define Dim 3e-5;
#define noo_wv 0.64;
cell_t c;
c=P_CELL(p);
Thread *t;
t=P_CELL_THREAD(p);
real m_cel=C_R(c,t)*C_VOLUME(c,t);
real t_cel=C_T(c,t);


is there any one who can help me.
so thanks!

declare variable first, then use, its not VC++.
#include "udf.h"
#define R 8314.34;
#define Mo2 31.999;
#define Mn2 28.013;
#define Mh2o 18.015;
#define Dim 3e-5;
#define noo_wv 0.64;
DEFINE_DPM_LAW(condenshumidlaw,p,coupled)
{

cell_t c;
Thread *t;
real m_cel,t_cel;
c=P_CELL(p);
t=P_CELL_THREAD(p);
m_cel=C_R(c,t)*C_VOLUME(c,t);
t_cel=C_T(c,t);

ramintakhti May 24, 2010 12:12

Hi dear gear boy.
I changed my udf according to your suggestion.
but again i encountered this error:
"P_CELL: undeclared variable"

gearboy May 24, 2010 21:13

Quote:

Originally Posted by ramintakhti (Post 259999)
Hi dear gear boy.
I changed my udf according to your suggestion.
but again i encountered this error:
"P_CELL: undeclared variable"

Many macros can be identified in interpreting mode. Maybe you should use compile mode, you should first install VC++

elah599 March 14, 2011 10:44

hi dear
did you find a solution? I have a same problem.

richardwu March 16, 2011 19:37

This macro can be accessed only by complied UDF.


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