|
[Sponsors] |
June 9, 2013, 08:06 |
UDF Define_Init velocity profile
|
#1 |
New Member
Thomas Crepon
Join Date: Jun 2013
Posts: 3
Rep Power: 13 |
Hi everyone,
I really need your help for a scholar modeling. I want to create as an initial condition on inlet, a velocity profile quite simple : if y<2.5 then U=0, else U=2*y. The problem is that I never used C language in my life and so as a complete rookie I'm quite lost... Below you'll find what I've tried to write by copying other examples found on the net. Thanks a lot for every little help you could give me (and sorry for my english) Best Regards |
|
June 14, 2013, 22:03 |
|
#2 |
New Member
Mahboobe Mahdavi
Join Date: Mar 2013
Posts: 22
Rep Power: 13 |
do you still need help? I can help you
|
|
June 19, 2013, 02:19 |
|
#3 |
New Member
Thomas Crepon
Join Date: Jun 2013
Posts: 3
Rep Power: 13 |
It's a bit too late for my scholar deadline but nevertheless, I'm really interested to know how should I have done this ! So I welcome your help if it's still possible.
|
|
June 19, 2013, 14:45 |
|
#4 |
New Member
Mahboobe Mahdavi
Join Date: Mar 2013
Posts: 22
Rep Power: 13 |
I guess the problem is due to this part:
y=F_CENTROID(y,f,t); you need to define real y[ND_ND]; then F_CENTROID(y,f,t); so your x coordinate will be y[0] and y coordinate will be y[1] -------------------------------------------------------------- #include "udf.h" DEFINE_INIT(udfinit,d) { cell_t c; Thread *t; real x[ND_ND]; real y; /* loop over all cell threads in the domain */ thread_loop_c(t,d) { /* loop over all cells */ begin_c_loop_all (c,t) { F_CENTROID(x,c,t); y=x[1] if y>2.5 C_U(c,t)=0 else C_U(c,t)=2*y } end_c_loop_all(c,t) } } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF for inlet velocity profile | Bollonga | Fluent UDF and Scheme Programming | 4 | June 29, 2021 05:40 |
UDF problems - velocity profile | Oli | Fluent UDF and Scheme Programming | 6 | October 24, 2016 11:38 |
UDF Unsteady velocity profile | Rashad | FLUENT | 0 | February 27, 2008 15:57 |
How to specify the Velocity profile (eqn) by UDF | Anant | FLUENT | 1 | February 27, 2008 15:54 |
Multi step transient UDF velocity profile problem | William177 | FLUENT | 1 | February 3, 2008 07:47 |