CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

undeclared variable

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 20, 2010, 12:48
Default undeclared variable
  #1
New Member
 
ramin
Join Date: May 2010
Posts: 2
Rep Power: 0
ramintakhti is on a distinguished road
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!
ramintakhti is offline   Reply With Quote

Old   May 24, 2010, 00:22
Default
  #2
Senior Member
 
Join Date: Feb 2010
Posts: 164
Rep Power: 17
gearboy is on a distinguished road
Quote:
Originally Posted by ramintakhti View Post
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);
gearboy is offline   Reply With Quote

Old   May 24, 2010, 13:12
Default
  #3
New Member
 
ramin
Join Date: May 2010
Posts: 2
Rep Power: 0
ramintakhti is on a distinguished road
Hi dear gear boy.
I changed my udf according to your suggestion.
but again i encountered this error:
"P_CELL: undeclared variable"
ramintakhti is offline   Reply With Quote

Old   May 24, 2010, 22:13
Default
  #4
Senior Member
 
Join Date: Feb 2010
Posts: 164
Rep Power: 17
gearboy is on a distinguished road
Quote:
Originally Posted by ramintakhti View Post
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++
gearboy is offline   Reply With Quote

Old   March 14, 2011, 10:44
Default
  #5
Member
 
iman vasefi
Join Date: Aug 2010
Posts: 39
Rep Power: 16
elah599 is on a distinguished road
hi dear
did you find a solution? I have a same problem.
elah599 is offline   Reply With Quote

Old   March 16, 2011, 19:37
Default
  #6
New Member
 
Chun-Liang Wu
Join Date: May 2010
Posts: 2
Rep Power: 0
richardwu is on a distinguished road
This macro can be accessed only by complied UDF.
richardwu is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
error in COMSOL:'ERROR:6164 Duplicate Variable' bhushas COMSOL 1 May 30, 2008 05:35
Problems with additional variable Krishna Premi CFX 1 October 29, 2007 09:19
Env variable not set gruber2 OpenFOAM Installation 5 December 30, 2005 05:27
UDF compilation problem -- "undeclared variable" Henrik Ström FLUENT 1 September 21, 2005 06:25
Replace periodic by inlet-outlet pair lego CFX 3 November 5, 2002 21:09


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