# Urgent! Help on UDF to set inlet velocity

 Register Blogs Members List Search Today's Posts Mark Forums Read

 December 26, 2005, 05:18 Urgent! Help on UDF to set inlet velocity #1 Ray Hong Guest   Posts: n/a Dear Friends, I tried to use UDF to set the inlet velocity. The geometry and B.C. are as follows: wall ----------------------------------- i | |o n | |u l | |t e | |l t | |e | |t | | |---------------------------------| | | w | |wall ----------------------------------- wall The inlet velocity is parabolic and the UDF is as follows: /************************************************** ***********************/ /* udf.c */ /* UDF for specifying a steady-state velocity profile boundary condition */ /************************************************** ***********************/ #include "udf.h" DEFINE_PROFILE(inlet_x_velocity, thread, index) { real x[ND_ND]; * this will hold the position vector */ real y; face_t f; begin_f_loop(f, thread) { F_CENTROID(x,f,thread); y = x[1]; F_PROFILE(f, thread, index) = 0.4 - 2.5 * (y-0.6)*(y-0.6); } end_f_loop(f, thread) } The 2ddp solver is used. The real type was tried to change to double but not useful. The interpreted and compiled schemes were used respectively to set the inlet B.C. but in vain. Could you tell me what's wrong? Thank you very much in advance. Ray

 December 26, 2005, 07:25 Re: Urgent! Help on UDF to set inlet velocity #2 loop Guest   Posts: n/a Hi, Can you write exactly what is wrong? What is happening with the profile? I am asking because at glance the entire syntax of the udf looks ok. Regards

 December 27, 2005, 00:29 Re: Urgent! Help on UDF to set inlet velocity #3 Ray Hong Guest   Posts: n/a The udf was pasted before. The problem is that the computed inlet velocity profile is almost uniform. Sorry, I could not paste the computed results there. Could you tell me your email number so that I could send the jpg files to you? Thank you. Ray

 December 28, 2005, 00:47 Re: Urgent! Help on UDF to set inlet velocity #4 Ray Hong Guest   Posts: n/a The mistake in udf was solved. The program works OK. Thank you any way. Ray

 December 30, 2005, 12:32 Re: Urgent! Help on UDF to set inlet velocity #5 loop Guest   Posts: n/a sorry for not responding. good it works. regards