|
[Sponsors] |
January 30, 2008, 06:47 |
UDF problems - velocity profile
|
#1 |
Guest
Posts: n/a
|
Hi everybody.
I'm trying to create a non uniform velocity profile at inlet ; the same as you can find it in the Fluent Docs. The source code is #include "udf.h" DEFINE_PROFILE(x_velocity,thread,index) { real x[ND_ND]; real y; face_t f; begin_f_loop(f,thread) { F_CENTROID(x,f,thread); y = x[1]; F_PROFILE(f,thread,index) = 30.0-30.0*(y*y)/(1.5*1.5) } end_f_loop(f,thread) } now i try to compile the source code --> Define --> User Defined Functions --> Interpreted (as it is shown in the Fluent Docu) But I always get the error : Error: /.../... : line 2 : syntax Error Do i overlook something? Fluent is running on a Linux operating system. |
|
January 30, 2008, 16:15 |
Re: UDF problems - velocity profile
|
#2 |
Guest
Posts: n/a
|
F_PROFILE(f,thread,index) = 30.0-30.0*(y*y)/(1.5*1.5)
You forgot the semi colon at the line end |
|
January 31, 2008, 04:37 |
Re: UDF problems - velocity profile
|
#3 |
Guest
Posts: n/a
|
oh yes, thx
but there's still the same error ... other udf's (for example residence_time with DEFINE_SOURCE) are working without problems.... |
|
February 3, 2008, 05:13 |
Re: UDF problems - velocity profile
|
#4 |
Guest
Posts: n/a
|
hi try replace the (index) in line 2, with just(i)... best regards, shehab
|
|
September 30, 2013, 15:39 |
Velocity Profile
|
#5 |
New Member
Yunusrulz
Join Date: Apr 2012
Posts: 10
Rep Power: 14 |
Hi, I want to keep velocity inlet in compressible flow.. since compressible flow allows mass flow inlet I kept same mass flow inlet profile... but it keeps changing as simulation progresses. so i wanna keep velocity inlet in a compressible flow problem.. but the simulation strucks some where.. it shows divergence error.. so is there any way to keep velocity inlet in compressible flow with pressure based solver and laminar flow ??
|
|
October 24, 2016, 04:51 |
UDF for inlet temperature
|
#6 |
New Member
mm
Join Date: May 2016
Posts: 24
Rep Power: 9 |
Dear all
I have following UDF for inlet temperature, untill 1300s it takes correct values according to equation, but after 1300s values are higher and not accorrding to equation, like at 1301s it should have value of 405C but in simulation inlet temperature is 621C. I could not find the error in my UDF after lot of try. please check this and guide me #include"udf.h" DEFINE_PROFILE(inlet_temperature,thread,position ) { face_t f; begin_f_loop(f,thread) { real t = RP_Get_Real("flow-time"); if (t <=1300.0 ) { F_PROFILE(f,thread,position) = 379.13 + 0.0005*t; } else if (1300.0 < t && t <= 1500.0 ) { F_PROFILE(f,thread,position)= -1.04289036878969*pow(10,-10)*pow(t,6.0)+ 8.86126436853789*pow(10,-7)*pow(t,5.0)-3.13621260398811*pow(10,-3)*pow(t,4.0)+5.91804640375908*pow(t,3.0)-6.27969461279651*pow(10,3)*pow(t,2.0)+ 3.55273415252714*pow(10,6)*t - 8.37223405676245*pow(10,8); } else { F_PROFILE(f,thread,position) = -9.51538261322402*pow(10,-23)*pow(t,6) + 8.26192751387975*pow(10,-18)*pow(t,5)-2.85237398505875*pow(10,-13)*pow(t,4)+4.97518353700886*pow(10,-9)*pow(t,3)-4.58733775886876*pow(10,-5)*pow(t,2)+ 2.10251137071757*pow(10,-1)*t +3.57252192344954*pow(10,2); } } end_f_loop(f,thread) } |
|
October 24, 2016, 10:38 |
|
#7 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26 |
You asked the same question in a different thread.
|
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
(ask) how to create UDF for inlet velocity profile | sincity | Fluent UDF and Scheme Programming | 83 | May 16, 2022 13:04 |
UDF parallel velocity inlet profile | Armengol | FLUENT | 3 | September 30, 2009 15:08 |
Prescribed inflow velocity profile - how to? | Alan | Main CFD Forum | 10 | October 28, 2005 12:14 |
UDF velocity profile problem | Steve | FLUENT | 0 | January 18, 2005 12:11 |
UDF problem : inlet velocity in cyl. coord. system | Jongdae Kim | FLUENT | 0 | June 15, 2004 11:21 |