|
[Sponsors] |
June 7, 2015, 16:31 |
Velocity profile with cylindrical components
|
#1 |
New Member
Shobhan Roy
Join Date: Jun 2015
Posts: 1
Rep Power: 0 |
Hi,
I am writing a UDF for velocity profile at inlet of a draft tube. The inlet is in cylindrical (radial, azimuthal, axial) components. In this case, particularly azimuthal component. I need it to vary with inlet radius. The code is as follows: #include "udf.h" DEFINE_PROFILE(inlet_v_velocity,thread,position) { real a[ND_ND]; /* this will hold the position vector */ real r, R=0.123, E=2.71828; face_t f; begin_f_loop(f,thread) { F_CENTROID(a,f,thread); r = a[1]; if (r<=R) F_PROFILE(f,thread,position) = ((100*R)/(r/R))*(1-pow(E,-(r/R)*(r/R)); r=r+0.001; } end_f_loop(f,thread); } The error is shown as on line 15: parse error; I suspect some changes are to be made since the face is 2d but then the equation is to vary with radius only. Please help. |
|
June 7, 2015, 17:31 |
|
#2 |
Super Moderator
Alex
Join Date: Jun 2012
Location: Germany
Posts: 3,427
Rep Power: 49 |
There is a mismatch between the number of opening and closing parentheses in F_PROFILE(f,thread,position) = ((100*R)/(r/R))*(1-pow(E,-(r/R)*(r/R));
Aditionally, it is always a good idea to write real values instead of integer values to avoid integer arithmetic if you dont want it. Change 100 to 100.0 and so on And the last line in your loop does not seem to make any sense to me. The value of r is fetched at the beginning of the loop from the face centroid position. This will overwrite any changes you made at the end of the loop anyway. Be sure that a[1] is in fact the radial coordinate you need. I am not 100% sure about the convention in fluent, consult the UDF manual. |
|
Tags |
cylindrical coordinates, udf, velocity profile |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF error - parabolic velocity profile - 3D turbine | Zaqie | Fluent UDF and Scheme Programming | 9 | June 25, 2016 20:08 |
Problem with assigned inlet velocity profile as a boundary condition | Ozgur_ | FLUENT | 5 | August 25, 2015 05:58 |
velocity profile as boundary condition | MK. | OpenFOAM Pre-Processing | 2 | November 11, 2014 03:08 |
FSI- Pipe- uniform velocity profile inlet | Absy | Main CFD Forum | 0 | April 6, 2010 04:01 |
How to obtain cylindrical velocity components? | Rikio | CFX | 2 | February 23, 2009 05:37 |