|
[Sponsors] |
June 30, 2011, 04:21 |
DEFINE_PROFILE help!!
|
#1 |
New Member
Marlom Ramos
Join Date: Jun 2011
Posts: 2
Rep Power: 0 |
Hi!
A I need that a DEFINE_PROFILE have the array value. How I do this? For example: my array is : real A[]={1,2,3,3,2,1} and this I need that be my profile of velocity. Help me please.!! |
|
June 30, 2011, 13:44 |
|
#2 |
Senior Member
Micael
Join Date: Mar 2009
Location: Canada
Posts: 157
Rep Power: 18 |
Your DEFINE_PROFILE need to define velocity for a single face of a control volume. You should compute the value for each face using a loop. Check the UDF manual about DEFINE_PROFILE, there is example.
|
|
June 30, 2011, 15:17 |
|
#3 | |
New Member
Marlom Ramos
Join Date: Jun 2011
Posts: 2
Rep Power: 0 |
Quote:
--------------------------------------------------- #include "udf.h" DEFINE_PROFILE(y_velocity,thread,index) { real x[ND_ND]; real y; face_t f; real A[]={1,2,3,4,5}; begin_f_loop(f,thread) { F_CENTROID(x,f,thread); F_PROFILE(f,thread,index)=A; } end_f_loop(f,thread) } --------------------------------------------------- This Correct? If the response is NOT. Any idea how to do? NOTE: the mesh of the boundary have 5 face, by I use A of dimension 5. Thanks you |
||
July 5, 2011, 18:19 |
|
#4 |
Senior Member
Micael
Join Date: Mar 2009
Location: Canada
Posts: 157
Rep Power: 18 |
No, it won't works. Also, F_CENTROID really does nothing.
F_PROFILE should be given a single scalar value, not an array like your code try to do. If there is 5 faces on your boundary, then the loop should loops 5 times. It is likely that the loop loops in an ordered way on the boundary, going from one extremity to the other. So this is likely to works, but it is a bit weird and I would recommand. Anyway, that could help you to understand. Code:
#include "udf.h" DEFINE_PROFILE(y_velocity,thread,index) { face_t f; real A[]={1,2,3,4,5}; int i = 0; begin_f_loop(f,thread) { F_PROFILE(f,thread,index)=A[i]; i++; } end_f_loop(f,thread) } |
|
|
|