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

Error Compiling UDF

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By divergence

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 25, 2017, 17:26
Default Error Compiling UDF
  #1
New Member
 
Allen Hammack
Join Date: Sep 2009
Posts: 7
Rep Power: 17
ahammack is on a distinguished road
I have the attached UDF that has worked for another user but isn't working for me. I'm running Fluent on a UNIX system. When I try to interpret this UDF, I keep getting a syntax error that is said to be in Line 2. I can't seem to figure it out. Can someone help?

#include "udf.h"
DEFINE_PROFILE(inflow_v, t, nv)
{
face_t f ;
real flow_time = RP_Get_Real("flow-time");
real A = 16.999874;
real v1 = 0.0;
real v2 = 1034*(0.3048*0.3048*0.3048)/A;

if (flow_time <= 7 )
{
begin_f_loop(f,t)
{
F_PROFILE(f,t,nv) = -1*(v1+(v2-v1)*(flow_time-0)/7);
}
end_f_loop(f,t)

printf("Time = %f sec. \n",flow_time);
printf("Flow rate set at %f cfs \n", -1*(v1+(v2-v1)*(flow_time-0)/7)*A/(0.3048*0.3048*0.3048));
}
else
{
begin_f_loop(f,t)
{
F_PROFILE(f,t,nv) = -1.722343325;
}
end_f_loop(f,t)

printf("Time = %f sec. \n",flow_time);
printf("Flow rate set at %f cfs \n", -1.722343325*A/(0.3048*0.3048*0.3048));
}
}
ahammack is offline   Reply With Quote

Old   July 31, 2017, 11:22
Default
  #2
Member
 
MayTheFlowBeWithYou's Avatar
 
I have to remain anonymous, I'm sorry.
Join Date: Jun 2017
Location: The Netherlands, Delft University of Technology
Posts: 48
Rep Power: 9
MayTheFlowBeWithYou is on a distinguished road
I can interpret this without any issue. Probably ur Fluent installation is fucked, I'd try to re-install the entire thing, otherwise I don't know, sorry and good luck to you.
MayTheFlowBeWithYou is offline   Reply With Quote

Old   August 1, 2017, 06:31
Default
  #3
Member
 
Join Date: Mar 2014
Posts: 56
Rep Power: 12
divergence is on a distinguished road
Before going as far as reinstalling the software, you could try to compiling the code instead of interpreting it. Second thing worth trying is to double check that the file in which the code is saved is in correct form. With this I mean that the file has been somehow altered for instance if it has been read and written in a windows environment and then handled in an unix environment. You could create a new file in your unix environment and copy-paste the code in the new file. Hope this helps, albeit it might seem a long shot!
divergence is offline   Reply With Quote

Reply

Tags
compile a udf, fluent, udf


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
UDF Compilation Error - Loading Library - COMMON Problem! Help! robtheslob Fluent UDF and Scheme Programming 8 July 24, 2015 01:53
Parallelize UDF? Which kind of UDF? Lilly FLUENT 5 March 25, 2014 03:05
Help! Delete the UDM codes in the UDF Messi Fluent UDF and Scheme Programming 2 January 28, 2014 10:01
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 05:01


All times are GMT -4. The time now is 03:28.