|
[Sponsors] |
Strange error in UDF compiling (version:19R3+VS2015) |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 23, 2019, 11:40 |
Strange error in UDF compiling (version:19R3+VS2015)
|
#1 |
New Member
You Wu
Join Date: Nov 2018
Posts: 16
Rep Power: 8 |
Hi,
I'm using ANSYS fluent19R3 + vs2015, and when i try to build my UDF, i received such an error: ...\...\src\myudf.c(424) : error C2143: syntax error : missing ') 'before 'const' ...\...\src\myudf.c(424) : error C2059: syntax error : ') ' here I post my code around line 424: begin_f_loop(f,tf) { f_node_loop(f,tf,n) { v=F_NODE(f,tf,n);/*this is line 424*/ if (NODE_POS_NEED_UPDATE(v)) { NODE_POS_UPDATED(v); NODE_Z(v)=NODE_Z(v)+disfn[kk]; } kk=kk+1; } } The same thing happens in ANSYS fluent 17.2 But the strangest thing is when i build and load myudf in ANSYS fluent 17.0 + VS2010 it works well. i can see the boundary motion in the animation and no error appears. I double checked my udf and make sure it's caused by spelling problems, Can anyone help me out?Thank you. |
|
October 23, 2019, 22:22 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
Is v defined well?
actually no idea, cause the code is not full. I cant check it on my computer best regards
__________________
best regards ****************************** press LIKE if this message was helpful |
|
October 23, 2019, 23:50 |
|
#3 | |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,754
Rep Power: 66 |
1) It is a compiler error
2) it's probably related to a missing library Quote:
You are running Fluent v17 w/ VS2010 on the same machine or a different machine? Make sure you have the same libraries on all machines. Installing a VS3000 does not mean that you do not need to install the older libraries. |
||
October 24, 2019, 00:21 |
|
#4 |
New Member
You Wu
Join Date: Nov 2018
Posts: 16
Rep Power: 8 |
Thank you for your reply. Yes, all definitions are correct, like Node *v here. Actually myudf works well on the old version fluent and VS, so I thought there might be some differences between different versions that caused my problems. The full code is just too long, I will attach a file if necessary.
|
|
October 24, 2019, 00:27 |
|
#5 | |
New Member
You Wu
Join Date: Nov 2018
Posts: 16
Rep Power: 8 |
Quote:
|
||
October 28, 2019, 10:28 |
|
#6 |
New Member
You Wu
Join Date: Nov 2018
Posts: 16
Rep Power: 8 |
Hi,
Finally, my friend and I worked out a solution. As you can see, there is an array named disfn[] in the loop. I defined this array at the beginning of the code but I didn't post it. But after debugging, we found that there was a problem with the way we defined disfn[]. I first defined the disfn[] as follows: #define n 100 real disfn[n]; This way of declaration is correct in C, and also acceptable for fluent version 17.0. However, in fluent 19R3, this declaration will cause an error in F_NODE (I don't know why). so I have to change it into: real disfn[100]; then error C2143 is fixed. Although the problem has been solved. But I still don't know why the previous declaration can't be used in the new fluent. Maybe some macros are different between versions. I hope it can help somebody else. Use "#define" carefully. |
|
Tags |
fluent - udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF compiling error | Weiqiang Liu | Fluent UDF and Scheme Programming | 3 | March 3, 2019 21:28 |
Strange error building UDF | rik | Fluent UDF and Scheme Programming | 4 | December 5, 2018 09:35 |
UDF compiling error | Weiqiang Liu | FLUENT | 2 | November 21, 2018 10:36 |
UDF Compiling / Parallel mode | MV78 | Fluent UDF and Scheme Programming | 6 | May 29, 2018 06:02 |
ERROR in compiling UDF | stefanos | Fluent UDF and Scheme Programming | 1 | April 25, 2012 08:37 |