CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   DEFINE_PROFILE help!! (https://www.cfd-online.com/Forums/fluent-udf/90075-define_profile-help.html)

Marlom June 30, 2011 03:21

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.!!

Micael June 30, 2011 12:44

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.

Marlom June 30, 2011 14:17

Quote:

Originally Posted by Micael (Post 314278)
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.

Thanks for your reply.

---------------------------------------------------

#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

Micael July 5, 2011 17:19

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)
 
}



All times are GMT -4. The time now is 21:41.