UDF for 3D circular inlet
I had tried with the below UDF progamme but it cannot produce a parabolic profile at the 3D inlet. So i need some advise on my programme. thanx
#include "udf.h" DEFINE_PROFILE(inlet_y_velocity, thread, position) { real y[ND_ND]; /* this will hold the position vector */ real x, z, r; face_t f; r=x=z; begin_f_loop(f, thread) { F_CENTROID(y,f,thread); x = y[1]; z = y[2]; r = y[3]; F_PROFILE(f, thread, position) = .07667 - r*r/(.0075*.0075)*.07667; } end_f_loop(f, thread) } |
Re: UDF for 3D circular inlet
y is an array which store the centroid coordination(x0,y0,z0),that is,y[0]=x0,y[1]=y0,y[2]=z0, so if your inlet face is parallel to x diretion, for example x=100mm , and you want to use y0 as the r value, you should write the program as:
r=y[1]; if you use r=y[3], maybe you will not get any value for r. hope useful for you. |
All times are GMT -4. The time now is 09:14. |