|
[Sponsors] |
June 12, 2018, 10:10 |
Problem using UDF for velocity inlet
|
#1 |
New Member
Join Date: Jun 2018
Posts: 7
Rep Power: 8 |
Hey,
i've real big problem using an UDF for velocity inlet and can't solve it. It's a Mesh over an Airfoil created with ANSYS ICEM 15.0. When i load the Mesh into FLUENT 15.0 everything is fine, no errors. Hybrid Initialisation is well without using the UDF, so no Errors without using the UDF. But when i want to implement the UDF and press Hybrid Initialisation, FLUENT says this: Error: %prf-set-var: invalid flonum Error Object: -1.#ind I can't figure out, where the problem is. Also never heard this error before and searching via google wasn't succesfull. So maybe someone coul help me? Here my defined UDF: #include "udf.h" #define c_max 30.88 // unit m/s #define delta 0.04 DEFINE_PROFILE(inlet_velocity, t, i) { real x[3]; real y; face_t f; begin_f_loop(f,t) { F_CENTROID(x,f,t); y = x[2]; if(x[2] <delta) F_PROFILE(f,t,i) = c_max * pow(x[2]/delta, 0.2); else F_PROFILE(f,t,i) = c_max; } end_f_loop(f,t) } I appreciate every kind of help. Best regards |
|
June 12, 2018, 22:55 |
|
#2 |
Senior Member
teguh hady
Join Date: Aug 2009
Location: Saga, Japan
Posts: 222
Rep Power: 18 |
Dear panasonic18
I think there are mistakes. You define real x[3] but you do not use x[3] in your whole code. you have already written y = x[2] so I think no need to write again x[2] in if(x[2] <delta). Just write if(y <delta). The same case can be applied also in pow(x[2]/delta, 0.2). For the comment in #define c_max 30.88 // unit m/s you should write #define c_max 30.88 /* unit m/s */ Hope it helps
__________________
Now Or Never!!! |
|
June 13, 2018, 03:59 |
|
#3 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
The line with x[3] is correct, don't change it to x[2]. It signals that x is a three-dimensional array. Better is to change it to x[ND_ND].
I think the real problem (apart from the comment-problem after #define) is that you might take a non-integer exponent of a negative number If you have a cell with negative y-coordinate, for example y=-0.04, then you calculate: Code:
pow(-1, 0.2) If this is really what you want, then you should help the compiler: Code:
if (x[2]<0) { F_PROFILE(f,t,i) = -c_max * pow(-x[2]/delta, 0.2); } else { F_PROFILE(f,t,i) = c_max * pow(x[2]/delta, 0.2); } |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF problem- time dependent temperature at inlet | kaeran | FLUENT | 1 | June 16, 2015 22:48 |
Open channel (inlet problem) | burak_ekmekci | Main CFD Forum | 0 | December 22, 2014 08:45 |
UDF profile: Fluent method for coupling inlet and outlet | I-mech | Fluent UDF and Scheme Programming | 0 | May 10, 2014 11:36 |
UDF problem : inlet velocity in cyl. coord. system | Jongdae Kim | FLUENT | 0 | June 15, 2004 12:21 |
UDF 3D inlet b.c. problem | Andrew | FLUENT | 4 | May 25, 2004 05:24 |