How to write an UDF programming inside FLUENT?
I have a brick region..the front surface i make it as inlet and i would like to write a UDF programme for the inlet velocity which is parabolic shape.. eg: at the center of the inlet is the highest velociy. (a parabolic shape)
secondly, left, right and behind surface i make it as pressure outlet and write a UDF programme for pressure different. Due to the brick region as a sea. and the lower surface is a seabed.. therefore if from top surface to lower surface(deeper) , the pressure will increase..(a triangle shape) May I know how to write a UDF programme for this..THX 
There is a detailed example of a parabolic velocity profile in the UDF manual (chapter 8). Once you learn how to do it, the pressure BCs would be easy to add.

ya..i saw it be4..but then i got the result that doesnt make sense..for example: i put X=0 , Y=1, Z=0..inside the grapgh, ya i get the parabolic shape which is 'u' shape..OR is it suppose a 'n' shape.
But for the pressure difference is it necessary use this function?F_CENTROID(x,f,thread) regards 
yes, probably. f_centroid will return the position vector of the cell in 'x'. The solver should produce the pressure profile throughout your domain given appropriate initial and boundary conditions.

Quote:
and if the using of the cell will return the vector of it,what will return if we use face instead? O(∩_∩)O~ thx in advance 
UDF for derivatives if fluctuating velocities
Hello,
Does anyone know how to calculate 1st derivatives (partial derivative) of the fluctuating velocities in UDF? Appreciate any help. Thanks, 
Quote:

1 Attachment(s)
Bruno Machado,
Thank you for your reply. I really appreciate your help. I never tried a UDF and UDS before. Could you please give me some more help on this? I have added an image file of the equation that I am trying to define in Fluent. Thank you, 
Quote:
The macro C_UDSI_G(c,t,i)[0] is the derivative with respect of X, whilst C_UDSI_G(c,t,i)[1] is in the Y direction and C_UDSI_G(c,t,i)[2] is with respect of Z direction. What you gotta do is to define a UDS (fluctuating velocity) and then using the macros previous mentioned, you can easily reproduce the equation you attached. 
nested if statement in udf
Respected members
I am using udf for defining transient temperature at inlet boundary of my model in fluent. I am writing nested if statement, but model keeps on using the same equation after 180 seconds, and does not move to the next if else statement. My udf is as follows: #include"udf.h" DEFINE_PROFILE(inlet_temperature,thread,position ) { face_t f; begin_f_loop(f,thread) { real t = RP_Get_Real("flowtime"); if ( t <= 100.0 ) F_PROFILE(f,thread,position) = 379.48 + 0.0004*t; else if (100.0 < t <= 180.0 ) F_PROFILE(f,thread,position) = 1.0624*t + 352.0; else if (180.0 < t <= 200.0 ) F_PROFILE(f,thread,position) = 0.2716*t + 494.4; else if (200.0 < t <= 400.0 ) F_PROFILE(f,thread,position) = 328.14*pow(t,0.097); else F_PROFILE(f,thread,position) = 727.82; } end_f_loop(f,thread) } sorry for my poor knowledge of programming. please help me on this error. Thanks. 
All times are GMT 4. The time now is 17:15. 