DEFINE_PROFILE help!!
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.!! |
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.
|
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 |
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:
|
All times are GMT -4. The time now is 21:41. |