|
[Sponsors] |
May 10, 2020, 09:37 |
How to let UDF run in parallel
|
#1 |
Senior Member
Join Date: Jan 2011
Posts: 339
Rep Power: 16 |
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 |
|
May 10, 2020, 12:20 |
Parallelization
|
#2 |
Senior Member
|
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. |
|
May 10, 2020, 16:16 |
|
#3 |
Senior Member
Join Date: Jan 2011
Posts: 339
Rep Power: 16 |
Many thanks Vinerm to the reply. Is that used normally with interpret option or I need to use compile when using parallel?
Mariam |
|
May 11, 2020, 03:15 |
Parallelization
|
#4 |
Senior Member
|
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. |
|
|
|
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 |