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/)
-   -   How to let UDF run in parallel (https://www.cfd-online.com/Forums/fluent-udf/226864-how-let-udf-run-parallel.html)

mariam.sara May 10, 2020 09:37

How to let UDF run in parallel
 
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

vinerm May 10, 2020 12:20

Parallelization
 
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 May 10, 2020 16:16

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 (Post 769714)
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.


vinerm May 11, 2020 03:15

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


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