|
[Sponsors] |
July 21, 2014, 18:49 |
Help Please, face_t f, parse error
|
#1 |
New Member
Guy
Join Date: Sep 2013
Posts: 10
Rep Power: 13 |
Hello,
I am new to writing UDFs for FLUENT (launched from Workbench). I am trying to interpreted a UDF source code for a tangential mass flow (compressible flow) for the first time but then I got stuck with errors. Here is some information regarding my Fluent setting: Version: 13.0.0 Working Directory: C:\Users\Kookguy FLUENT ROOT Path: C:\Program Files\ANSYS Inc\v130/fluent The following is my UDF source file, "myudfexample.c": /************************************************** ********************* myudfexample.c UDF for specifying swirling flow ************************************************** **********************/ #include "udf.h" DEFINE_PROFILE(inlet_tangential_massflow, thread, position) { real x[ND_ND]; real y,z,r; y=x[1]; z=x[2]; face_t f; begin_f_loop(f,thread) { F_CENTROID(x, f, thread); r=sqrt(pow(y,2)+pow(z,2)); /*acquiring radius*/ F_PROFILE(f, thread, position) = (r/0.01)*(0.5775); /*S=0.385, so (V=0.5775*U)*/ } end_f_loop(f, thread) } Here are the errors I got as I interpreted the file (also shows my source file location): Error: C:\Users\Kookguy\Desktop\ColdFlow\Sim5_try3_files\ dp0\FFF\Fluent\myudfexample.c: line 13: parse error. Error: C:\Users\Kookguy\Desktop\ColdFlow\Sim5_try3_files\ dp0\FFF\Fluent\myudfexample.c: line 15: f: undeclared variable where line 13, I believe is corresponded to face_t f, which causes subsequent problem in line 15. What am I doing wrong here? Please Help!! |
|
July 22, 2014, 08:12 |
|
#2 |
Member
David
Join Date: Aug 2012
Posts: 48
Rep Power: 14 |
Are you compiling or interpreting it?
pd: it also seems to me that x and y are always 0 check it |
|
July 22, 2014, 09:02 |
|
#3 |
Senior Member
Gonzalo
Join Date: Mar 2011
Location: Argentina
Posts: 122
Rep Power: 16 |
Hi:
i think that you have to do the statements y=x[1]; and z=x[2]; after calculating 'x' in the statement F_CENTROID(x, f, thread);, otherwise you will get the initial value of X[1] and X[2] for y and z. Regards Gonzalo |
|
July 24, 2014, 19:43 |
|
#4 |
New Member
Guy
Join Date: Sep 2013
Posts: 10
Rep Power: 13 |
Thank you very much for the comments!
GM_III, I was just interpreting the file. Do I have to compile it first? Any quick guidance of how and why to do that? Thank you very much for your help. gfoam, I will change that!, again Thank you so much! Hopefully, it will be all clear to me once I got the first file running; however, I'm still stuck at the moment. |
|
July 25, 2014, 12:11 |
|
#5 |
Senior Member
Gonzalo
Join Date: Mar 2011
Location: Argentina
Posts: 122
Rep Power: 16 |
Hi:
I don't think you have to compile it because it's a very simple UDF and it serves only on the porpouse of initializing a BC's. But the UDF seems to bo OK if you change the statement I said to you before. Now, how are you trying to execute it? What variable type is "position" and how are you passing it to the UDF? |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[blockMesh] blockMesh with double grading. | spwater | OpenFOAM Meshing & Mesh Conversion | 92 | January 12, 2019 10:00 |
error compiling modified applications | yvyan | OpenFOAM Programming & Development | 21 | March 1, 2016 05:53 |
[OpenFOAM] Native ParaView Reader Bugs | tj22 | ParaView | 270 | January 4, 2016 12:39 |
Errors in UDF | shashank312 | Fluent UDF and Scheme Programming | 6 | May 30, 2013 21:30 |
Ansys Fluent 13.0 UDF compilation problem in Window XP (32 bit) | Yogini | Fluent UDF and Scheme Programming | 7 | October 3, 2012 08:24 |