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

How to let UDF run in parallel

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 10, 2020, 09:37
Default How to let UDF run in parallel
  #1
Senior Member
 
Join Date: Jan 2011
Posts: 339
Rep Power: 16
mariam.sara is on a distinguished road
Hello I have the below UDF for mixture density it works fine in series I want to run it in parallel what changes I need to add.

include "udf.h"
DEFINE_PROPERTY(c_densityN10RaT1E6, c, t)
{
real rhm,rho,To,Co,betaT,betaC;
real T = C_T(c,t);
rho= 1.12;
Co=0.049;
To=313.15;
betaT=0.0032;
betaC=0.590636677;
rhm = rho*(1.-betaT*(T-To)-betaC*(1.*C_YI(c,t,0)-Co)); /* density of mixture */
return rhm;
}

Thanks
Mariam
mariam.sara is offline   Reply With Quote

Old   May 10, 2020, 12:20
Default Parallelization
  #2
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
Usually, such code do not require parallelization. However, you can do that just to be sure.

Put whole of the code within

#if !RP_HOST
#endif

#if must be after opening brace of the DEFINE_ function and #endif before the the closing brace.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   May 10, 2020, 16:16
Default
  #3
Senior Member
 
Join Date: Jan 2011
Posts: 339
Rep Power: 16
mariam.sara is on a distinguished road
Many thanks Vinerm to the reply. Is that used normally with interpret option or I need to use compile when using parallel?

Mariam

Quote:
Originally Posted by vinerm View Post
Usually, such code do not require parallelization. However, you can do that just to be sure.

Put whole of the code within

#if !RP_HOST
#endif

#if must be after opening brace of the DEFINE_ function and #endif before the the closing brace.
mariam.sara is offline   Reply With Quote

Old   May 11, 2020, 03:15
Default Parallelization
  #4
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 35
vinerm will become famous soon enough
Compilation or Interpretation are not related to parallelization. So, if you are using the code for parallel simulation, you should parallelize it, doesn't matter whether you compile or interpret.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem during mpi in server: expected Scalar, found on line 0 the word 'nan' muth OpenFOAM Running, Solving & CFD 3 August 27, 2018 04:18
Error code: 126 when loading parallel UDF Coop Fluent UDF and Scheme Programming 0 July 13, 2018 08:33
parallel run is slower than serial run (pimpleFoam) !!! mechy OpenFOAM 18 August 17, 2016 17:19
Explicitly filtered LES saeedi Main CFD Forum 16 October 14, 2015 11:58
Help: how to realize UDF on parallel cluster? Haoyin FLUENT 1 August 6, 2007 13:53


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