|
[Sponsors] |
July 18, 2011, 03:08 |
UDf - please help
|
#1 |
New Member
Amir
Join Date: Aug 2010
Posts: 10
Rep Power: 15 |
Dear friends
I face with a problem when I want to reform my UDF. Indeed , I want to add a function ( sin(x)) to my udf , but I don’t know what is necessary corrections. Please let me any suggestion in order to correct my udf. Tanks in advance. Amir #include "udf.h" real velocity (real t) { real a, b, value; a = 10.0; b = 0.34; value = 0.0; if ((t >= 0) || (t < 0.2)) { value = sin (a*t);( here , I want to add sin(x) , but I don’t know what corrections is need.) } else { value = b; } return value; } DEFINE_PROFILE(unsteady_velocity, thread, position) { face_t f; real t; t = CURRENT_TIME; begin_f_loop(f, thread) { F_PROFILE(f, thread, position) = velocity(t); } end_f_loop(f, thread) } |
|
July 18, 2011, 03:10 |
|
#2 | |
New Member
Amir
Join Date: Aug 2010
Posts: 10
Rep Power: 15 |
Quote:
|
||
July 19, 2011, 07:53 |
|
#3 |
Member
Join Date: Mar 2011
Posts: 64
Rep Power: 15 |
Hi Dear Mr. Habibdoust
I know you very well you should use this: DEFINE_PROFILE(unsteady_velocity, t, i) { real pos[ND_ND], x; face_t f; begin_f_loop(f, t) { F_CENTROID(pos,f,t); x=pos[0]; F_PROFILE(f, t, i) = sin(x); } end_f_loop(f, thread) }
__________________
Saeed Sadeghi Ansys Fluent CFD Consultant |
|
July 20, 2011, 02:29 |
|
#4 |
New Member
Amir
Join Date: Aug 2010
Posts: 10
Rep Power: 15 |
Dear Saeed,
I know you very well too. Tank for your attention and reply. you mean that if i use your suggested code, I will have velocity inlet as bellow function: sin(x).sin(t) Tanks in advance Amir |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Dynamic Mesh UDF | Qureshi | FLUENT | 7 | March 23, 2017 07:37 |
UDF parallel error: chip-exec: function not found????? | shankara.2 | Fluent UDF and Scheme Programming | 1 | January 16, 2012 22:14 |
How to add a UDF to a compiled UDF library | kim | FLUENT | 3 | October 26, 2011 21:38 |
UDF...UDF...UDF...UDF | Luc SEMINEL | FLUENT | 0 | November 25, 2002 04:03 |
UDF, UDF, UDF, UDF | Luc SEMINEL | Main CFD Forum | 0 | November 25, 2002 04:01 |