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

Help Please, face_t f, parse error

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 21, 2014, 17:49
Default Help Please, face_t f, parse error
  #1
New Member
 
Guy
Join Date: Sep 2013
Posts: 10
Rep Power: 12
kookguy is on a distinguished road
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!!
kookguy is offline   Reply With Quote

Old   July 22, 2014, 07:12
Default
  #2
Member
 
David
Join Date: Aug 2012
Posts: 48
Rep Power: 13
GM_XIII is on a distinguished road
Are you compiling or interpreting it?
pd: it also seems to me that x and y are always 0 check it
GM_XIII is offline   Reply With Quote

Old   July 22, 2014, 08:02
Default
  #3
Senior Member
 
Gonzalo
Join Date: Mar 2011
Location: Argentina
Posts: 122
Rep Power: 16
gfoam is on a distinguished road
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
gfoam is offline   Reply With Quote

Old   July 24, 2014, 18:43
Default
  #4
New Member
 
Guy
Join Date: Sep 2013
Posts: 10
Rep Power: 12
kookguy is on a distinguished road
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.
kookguy is offline   Reply With Quote

Old   July 25, 2014, 11:11
Default
  #5
Senior Member
 
Gonzalo
Join Date: Mar 2011
Location: Argentina
Posts: 122
Rep Power: 16
gfoam is on a distinguished road
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?
gfoam 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
[blockMesh] blockMesh with double grading. spwater OpenFOAM Meshing & Mesh Conversion 92 January 12, 2019 09:00
error compiling modified applications yvyan OpenFOAM Programming & Development 21 March 1, 2016 04:53
[OpenFOAM] Native ParaView Reader Bugs tj22 ParaView 270 January 4, 2016 11:39
Errors in UDF shashank312 Fluent UDF and Scheme Programming 6 May 30, 2013 20:30
Ansys Fluent 13.0 UDF compilation problem in Window XP (32 bit) Yogini Fluent UDF and Scheme Programming 7 October 3, 2012 07:24


All times are GMT -4. The time now is 02:27.