CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Urgent! Help on UDF to set inlet velocity (https://www.cfd-online.com/Forums/fluent/39045-urgent-help-udf-set-inlet-velocity.html)

Ray Hong December 26, 2005 05:18

Urgent! Help on UDF to set inlet velocity
 
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

loop December 26, 2005 07:25

Re: Urgent! Help on UDF to set inlet velocity
 
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


Ray Hong December 27, 2005 00:29

Re: Urgent! Help on UDF to set inlet velocity
 
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

Ray Hong December 28, 2005 00:47

Re: Urgent! Help on UDF to set inlet velocity
 
The mistake in udf was solved.

The program works OK.

Thank you any way.

Ray

loop December 30, 2005 12:32

Re: Urgent! Help on UDF to set inlet velocity
 
sorry for not responding. good it works. regards


All times are GMT -4. The time now is 00:49.