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

Fluent udf "DEFINE_PROFILE" parallelization

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 5, 2018, 21:19
Question Fluent udf "DEFINE_PROFILE" parallelization
  #1
New Member
 
David
Join Date: Nov 2017
Posts: 14
Rep Power: 8
uconcorde is on a distinguished road
Hi Everyone,

I am using udf "DEFINE_PROFILE" to get a boundary layer velocity profile for the inlet of my computational domain.

My udf is very simple and works perfect in Serial Mode.

Then, I followed the examples in UDF manual and tried to parallelize my udf. It seems that the face_loop in the udf is only able to loop in one partition (see the lower section of the parallel plot, which gives correct values), and values of the upper section are not assigned correctly.

Sorry, I don't know why I cannot attach these images, please click them
serial mode profile: https://drive.google.com/file/d/1kQb...ew?usp=sharing
parallel mode profile: https://drive.google.com/file/d/1gO0...ew?usp=sharing

Here is my udf:
Code:
DEFINE_PROFILE(inlet_u_profile,t,i)
{
real xf[ND_ND];
face_t f;
float blasiusU[] = { ...blasius values... }; /* store blasius profile data */
#if !RP_HOST
begin_f_loop(f,t)
{
F_PROFILE(f,t,i) = blasiusU[f];
}
end_f_loop(f,t)
#endif
}
Does anybody know how to continue looping the faces on the adjacent partition in the domain?

Thanks in advance.
Dv

Last edited by uconcorde; May 5, 2018 at 21:28. Reason: insert image
uconcorde is offline   Reply With Quote

Old   May 7, 2018, 02:47
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
Code:
float blasiusU[] = { ...blasius values... }; /* store blasius profile data */
This is unusual for me. For this to work, you need to store the values of the faces in the same order as Fluent wants to read them. This order is never specified, as far as I know. If it worked for you in the serial case, I guess that you were just 'lucky', as Fluent took the same order as you guessed.

But in the parallel case, Fluent will (apparently) take a different order. So your approach does not work.

The normal approach for this: describe the profile as a function of x (or whatever coordinate that varies).

Code:
float blasiusU(float x) {
 if (x<0.03) {   /*just an example function */
  return(0.2-x);
 } else if x<0.6 {
  return(0.173-0.1*x);
 } else {
  return(0.113);
 }
}

DEFINE_PROFILE(inlet_u_profile,t,i)
{
#if !RP_HOST
 real xf[ND_ND];
 face_t f;
 begin_f_loop(f,t) {
  F_CENTROID(xf,f,t);
  F_PROFILE(f,t,i) = blasiusU(xf[0]);
 }
 end_f_loop(f,t)
#endif
}
pakk is offline   Reply With Quote

Reply

Tags
parallel, profile boundary, udf


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem running fluent with udf on batch tobi b. Fluent UDF and Scheme Programming 3 April 14, 2016 13:54
implementing UDF for fluent in workbench for running multiple simulations faizan_habib7 Fluent UDF and Scheme Programming 0 March 18, 2016 22:29
Running UDF with Supercomputer roi247 FLUENT 4 October 15, 2015 13:41
fluent UDF external library lapack problem Rick FLUENT 0 May 7, 2008 10:16
UDF problem caused by various version of Fluent Yurong FLUENT 3 January 15, 2006 10:57


All times are GMT -4. The time now is 00:36.