CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

DEFINE_PROFILE help!!

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 30, 2011, 03:21
Default DEFINE_PROFILE help!!
  #1
New Member
 
Marlom Ramos
Join Date: Jun 2011
Posts: 2
Rep Power: 0
Marlom is on a distinguished road
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.!!
Marlom is offline   Reply With Quote

Old   June 30, 2011, 12:44
Default
  #2
Senior Member
 
Micael
Join Date: Mar 2009
Location: Canada
Posts: 156
Rep Power: 18
Micael is on a distinguished road
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.
Micael is offline   Reply With Quote

Old   June 30, 2011, 14:17
Default
  #3
New Member
 
Marlom Ramos
Join Date: Jun 2011
Posts: 2
Rep Power: 0
Marlom is on a distinguished road
Quote:
Originally Posted by Micael View Post
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
Marlom is offline   Reply With Quote

Old   July 5, 2011, 17:19
Default
  #4
Senior Member
 
Micael
Join Date: Mar 2009
Location: Canada
Posts: 156
Rep Power: 18
Micael is on a distinguished road
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) 
 
}
Micael is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 23:02.