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

Parse error for x[ND_ND]

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 2, 2017, 12:41
Default Parse error for x[ND_ND]
  #1
New Member
 
Kaushal Sumaria
Join Date: Mar 2016
Posts: 2
Rep Power: 0
KaushalSumaria is on a distinguished road
I am using a DEFINE_SOURCE udf for momentum in x direction. I am using the following UDF. IT is giving out parse error where 'real x[ND_ND]' is defined and then undeclared variable where it encounters x. Any help in this regard is appreciated.

Thank you

#include "udf.h"

#define CON 20.0

DEFINE_SOURCE(momentum_balance, cell, thread, dS, eqn)
{
real source;
cell_t cell;
Thread *cell_thread;
Domain *subdomain;
subdomain = Get_Domain(3);
real x[ND_ND];

/*loop over all cell threads in the secondary phase domain*/
thread_loop_c(cell_thread, subdomain)
{
/*loop over all cells in secondary phase cell threads*/
begin_c_loop_all(cell,cell_thread)
{
C_CENTROID(x,cell,cell_thread)
if (x[0]>(-0.0015)) || x[0]<0.0015)
{
if(C_VOF(cell,cell_thread)>1)
{
thread_loop_c(cell_thread, subdomain)
{
begin_c_loop_all(cell, cell_thread)
{
/* source term */
source = -CON*C_U(cell,thread) + 100;

/* derivative of source term w.r.t. x-velocity. */
dS[eqn] = -CON;
}
end_c_loop_all(cell, cell_threaD)
}
}
}
return source;
//break:
}
end_c_loop_all(cell,cell_thread)
}
}
KaushalSumaria 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
Parse error mehdimoradi. Fluent UDF and Scheme Programming 2 October 25, 2013 05:24
parse error in DEFINE_DPM_BODY_FORCE 89566008 FLUENT 0 October 24, 2012 02:38
parse error in transient udf spring FLUENT 1 July 6, 2010 06:26
Parse Error Message While interpreting UDF in FLUENT dhimans Fluent UDF and Scheme Programming 1 July 10, 2009 06:29
PARSE ERROR Message when interpreting UDF in FLUENT dhimans FLUENT 0 May 24, 2009 11:40


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