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

Paralellizing UDF DEFINE_PROFILE

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 23, 2018, 06:56
Default Paralellizing UDF DEFINE_PROFILE
  #1
New Member
 
Burak
Join Date: Apr 2013
Posts: 6
Rep Power: 10
bluejojoba is on a distinguished road
Hi,

I would like to give heat flux from a surface depending on timestep. So I wrote an UDF for serial (haven't tried yet if it is working btw), but I am not sure if I need to paralellize it when I use parallel solver.

I would like to use DEFINE_PROFILE as follows:


---------------------------------------------------------
#include "udf.h"

DEFINE_PROFILE(hf_profile,t,i)
{
real x[ND_ND];
real y;
face_t f;

if (CURRENT_TIME > 5 && CURRENT_TIME < 8) {
F_PROFILE(f,t,i) = 100;
}
else if (CURRENT_TIME >= 8 && CURRENT_TIME < 15) {

F_PROFILE(f,t,i) = 150;
}
}


How should I need to add #if !RP_HOST or !RP_NODE ? I did not quite understand from the manual if I need to use these parallel functions because I think I am not using global functions.

Thank you in advance,
bluejojoba is offline   Reply With Quote

Old   October 24, 2018, 23:50
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 1,638
Rep Power: 23
AlexanderZ will become famous soon enough
Code:
#include "udf.h"

DEFINE_PROFILE(hf_profile,t,i)
{
face_t f;
begin_f_loop(f,t)
{
if (CURRENT_TIME > 5 && CURRENT_TIME < 8) 
	{F_PROFILE(f,t,i) = 100;}
	else if (CURRENT_TIME >= 8 && CURRENT_TIME < 15) 
	{F_PROFILE(f,t,i) = 150;}
}
end_f_loop(f,t)
}
you don't use x and y variables in your code, so I removed them
you don't need to modify your code to use it in parallel

best regards
AlexanderZ is offline   Reply With Quote

Old   October 31, 2018, 10:42
Default
  #3
New Member
 
Burak
Join Date: Apr 2013
Posts: 6
Rep Power: 10
bluejojoba is on a distinguished road
Quote:
Originally Posted by AlexanderZ View Post
Code:
#include "udf.h"

DEFINE_PROFILE(hf_profile,t,i)
{
face_t f;
begin_f_loop(f,t)
{
if (CURRENT_TIME > 5 && CURRENT_TIME < 8) 
	{F_PROFILE(f,t,i) = 100;}
	else if (CURRENT_TIME >= 8 && CURRENT_TIME < 15) 
	{F_PROFILE(f,t,i) = 150;}
}
end_f_loop(f,t)
}
you don't use x and y variables in your code, so I removed them
you don't need to modify your code to use it in parallel

best regards
Thank you AlexanderZ,

But Do I need to write a loop? I would like to give heatflux from one surface only.
bluejojoba is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
udf for one dimensional linear motion based on force maccheese Fluent UDF and Scheme Programming 2 September 1, 2019 02:18
Save output of udf in another udf! JuanJoMex FLUENT 0 February 8, 2018 12:43
UDF Compilation Error - Loading Library - COMMON Problem! Help! robtheslob Fluent UDF and Scheme Programming 8 July 24, 2015 00:53
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 22:14
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 04:01


All times are GMT -4. The time now is 09:51.