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

UDF interpreted Error

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 11, 2018, 03:25
Default UDF interpreted Error
  #1
New Member
 
Join Date: May 2018
Posts: 5
Rep Power: 8
ctmagic is on a distinguished road
Hi, Eeverybody!
I'm using fluent 17.

my udf is as bellowacturally, it's partly copied from the Ansys help)
#include "udf.h";
#inclue "math.h";
.......

DEFINE_VR_RATE(reforming_rate,c,t,re,mw,yi,rr,rr_t )
{
..........
if (!strcmp(re->name, "reaction-1")) -----line 49
{
*rr=r1v
}
else if (!strcmp(re->name, "reaction-2"))
{
*rr=r2v
}
else if (!strcmp(re->name, "reaction-3"))
{
*rr=r3v
}
else
{
/* Message("Unknown Reaction\n"); */
}
}

when the UDF is interpreted in fluent, a error ( line 49:structure reference not implemented) occured.

Is there any parse error? Or should I include more head files?

Many thanks in advance!
ctmagic is offline   Reply With Quote

Old   May 11, 2018, 05:36
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
was
Code:
*rr=r1v
new
Code:
*rr=r1v;
may be this one? On the other hand, problem comes from lines above #49, check what is inside your ...

best regards
AlexanderZ is offline   Reply With Quote

Old   May 11, 2018, 21:28
Default
  #3
New Member
 
Join Date: May 2018
Posts: 5
Rep Power: 8
ctmagic is on a distinguished road
Missing of symbol ";" is another obvious error, thanks a lot!
However,i'm afraid that the problem mentioned in my post is about the variable "r", which is defined by fluent macro.
I have tried to used the example udf in fluent help, the error still occured"structure reference not implemented".
it make me crazy.Could you please tell me why? Many thanks!

the example udf from fluent helps is as below:

#include "udf.h"

DEFINE_VR_RATE(myrate,c,t,r,mw,yi,rr,rr_t)
{
/*If more than one reaction is defined, it is necessary to distinguish
between these using the names of the reactions. */
if (!strcmp(r->name, "reaction-1"))
{
/* Reaction 1 */
}
else if (!strcmp(r->name, "reaction-2"))
{
/* Reaction 2 */
}
else
{
/* Message("Unknown Reaction\n"); */
}
/* Message("Actual Reaction: %s\n",r->name); */

}




Quote:
Originally Posted by AlexanderZ View Post
was
Code:
*rr=r1v
new
Code:
*rr=r1v;
may be this one? On the other hand, problem comes from lines above #49, check what is inside your ...

best regards
ctmagic is offline   Reply With Quote

Old   May 13, 2018, 22:22
Default
  #4
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
Use compile instead of interpretation

best regards
AlexanderZ is offline   Reply With Quote

Old   May 14, 2018, 23:26
Default
  #5
New Member
 
Join Date: May 2018
Posts: 5
Rep Power: 8
ctmagic is on a distinguished road
Hi, AlexanderZ!Thanks, it works!

Quote:
Originally Posted by AlexanderZ View Post
Use compile instead of interpretation

best regards
ctmagic 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
Compile calcMassFlowC aurore OpenFOAM Programming & Development 13 March 23, 2018 08:43
long error when using make-install SU2_AD. tomp1993 SU2 Installation 3 March 17, 2018 07:25
Pressure outlet boundary condition rolando OpenFOAM Running, Solving & CFD 62 September 18, 2017 07:45
Compile problem ivanyao OpenFOAM Running, Solving & CFD 1 October 12, 2012 10:31
UDF: DEFINE_CG_MOTION for vertical jump motion of an electrode! alban Fluent UDF and Scheme Programming 2 June 8, 2010 19:54


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