|
[Sponsors] |
May 2, 2015, 22:01 |
UDF expected void
|
#1 |
Member
Kegan Leckness
Join Date: Mar 2015
Posts: 38
Rep Power: 11 |
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? |
|
June 8, 2015, 11:28 |
Same problem
|
#2 |
New Member
Changda Feng
Join Date: Jun 2015
Posts: 1
Rep Power: 0 |
I have the same problem with you in using DEFINE_TRANSIENT_PROFILE. Did you solve this problem? And how did you solve this problem?
|
|
June 10, 2015, 13:41 |
|
#3 |
Member
Kegan Leckness
Join Date: Mar 2015
Posts: 38
Rep Power: 11 |
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 |
|
|
|
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 |