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

UDF expected void

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 2, 2015, 22:01
Default UDF expected void
  #1
Member
 
Kegan Leckness
Join Date: Mar 2015
Posts: 38
Rep Power: 11
KeganLeckness is on a distinguished road
Hi all,

I'm having issues getting my UDF to work properly in my transient analysis. I'm applying it at a pressure-inlet boundary condition. I get the error indicating "chip-exec: wrong return type: void udf function expected." My code is below:

#include "udf.h"

DEFINE_TRANSIENT_PROFILE(impulse_pressure, time)
{
real pressure_value=0.0;
if (time >= 0.0 && time < 0.003)
{
pressure_value= 20000 - 6666.6666667 * time;
}
else
{
pressure_value= 0;
}
return pressure_value;
}

I have no issues interpreting the code. Are there any thought on how to resolve this error?
KeganLeckness is offline   Reply With Quote

Old   June 8, 2015, 11:28
Default Same problem
  #2
New Member
 
Changda Feng
Join Date: Jun 2015
Posts: 1
Rep Power: 0
Changda is on a distinguished road
I have the same problem with you in using DEFINE_TRANSIENT_PROFILE. Did you solve this problem? And how did you solve this problem?
Changda is offline   Reply With Quote

Old   June 10, 2015, 13:41
Default
  #3
Member
 
Kegan Leckness
Join Date: Mar 2015
Posts: 38
Rep Power: 11
KeganLeckness is on a distinguished road
Hi,

I was able to fix the problem. My goal was a triangular pressure wave that started at 20 kPa at t=0 s and ended at 0 Pa at t=.003 s. The code I now use for that purpose is:


#include "udf.h"

DEFINE_PROFILE(impulse_pressure_20, thread, position)
{
float t, pressure;
face_t f;

t = RP_Get_Real("flow-time");

if (t<.003)
{
pressure = -6666666.667*t +20000;
begin_f_loop(f, thread)
{
F_PROFILE(f, thread, position) = pressure;
}
end_f_loop(f, thread)
}
else
{
pressure =0;
}
}


Hope this helps,
Kegan
KeganLeckness 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
Dynamic Mesh UDF Qureshi FLUENT 7 March 23, 2017 08:37
Mass transfer UDF expecting void return Quinos Fluent UDF and Scheme Programming 0 January 8, 2014 19:36
Source Term UDF VS Porous Media Model pchoopanya Fluent UDF and Scheme Programming 1 August 28, 2013 07:12
OpenFoam 14 installation problem gfcoppola OpenFOAM Installation 20 November 2, 2007 14:38
UDF...UDF...UDF...UDF Luc SEMINEL FLUENT 0 November 25, 2002 05:03


All times are GMT -4. The time now is 16:46.