|
[Sponsors] |
March 30, 2016, 16:24 |
Parse error in UDF
|
#1 |
New Member
Pratik Dhoot
Join Date: Mar 2016
Location: Boston, MA
Posts: 20
Rep Power: 10 |
Hello everybody,
I am trying to use UDF for defining turbulence viscosity at a cell as a function of its distance from the wall. I used syntax real x[ND_ND]; C_CENTROID(x,c,t) float d1 = x[0]; to find the x coordinate of every cell in the loop but I get a parse error in the float term. I tried to fix it but I am still struggling. If anyone can help with this, please comment. Thanks, Pratik. |
|
March 30, 2016, 18:07 |
|
#2 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
Fluent UDFs follow the ANSI C standard and variables must be declared at the start of a code block. You've called the C_CENTROID macro and then declared the variable d1. Move this declaration further up, for example:
Code:
real x[ND_ND]; float d1 = x[0]; C_CENTROID(x,c,t); |
|
March 31, 2016, 16:06 |
|
#3 |
New Member
Pratik Dhoot
Join Date: Mar 2016
Location: Boston, MA
Posts: 20
Rep Power: 10 |
Hi,
Thanks. That was very much useful. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
A Problem of Fluent Interpreted UDF: parse error | knight | Fluent UDF and Scheme Programming | 25 | August 16, 2018 10:26 |
Parse error interpreting UDF | mrwts | Fluent UDF and Scheme Programming | 2 | September 14, 2015 16:45 |
Parse error in UDF, URGENT HELP NEEDED!!! | Boris Kloser | FLUENT | 2 | December 12, 2009 03:16 |
parse error with interpreting UDF | ivanbuz | Fluent UDF and Scheme Programming | 2 | August 13, 2009 18:29 |
udf parse error | brusly | FLUENT | 0 | February 4, 2007 22:15 |