|
[Sponsors] |
August 27, 2021, 13:38 |
FLUENT UDF for Parallelization
|
#1 |
Member
Join Date: Jul 2020
Location: India
Posts: 66
Rep Power: 6 |
I am new to writing UDFs and new to coding itself in general. I have written a UDF for adding some source terms in my model. I use 10 cores on my PC for FLUENT in parallel. My UDF compiles and the simulation is also running.
Today, I learnt about something called parallelization of UDF. As I understood, the UDF should be parallelized for using multiple cores by adding some special commands in the UDF. I do not have any special commands in my UDF related to parallelization or number of cores to be used. Is it that my simulation is still running in serial even after selecting 10 cores on Fluent startup? As I said that my UDF compiles without error and the simulation is also running. Do I need to make changes in my UDF? |
|
August 28, 2021, 05:22 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
It depends on the UDF.
If you are doing something that involves the complete domain (integrating, finding a maximum, something like that), you need to change something. But in that case you would also get clearly wrong results if you used the serial code in parallel. If your UDF is writing to a file, you also need some changes. But if you just set viscosity as function of local pressure and temperature, you don't really need to change anything. By the way: typically 99.9% of the time is spent on the "normal" Fluent code to calculate pressures, velocities and temperatures for the next iteration. This code is parallelized by the Ansys programmers, who did it quite well. The <0.1% of time spent in your UDF code is not significant. It might be suboptimal for speed, but it does not matter. If your simulation takes two days to finish, you don't care about the 30 seconds you could gain by improving your UDF. So as long as you don't make your UDF incredibly inefficient, you're fine.
__________________
"The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform" is NOT the error after compiling. It is the error after loading. To see compiler errors, look at your screen after you click "build". |
|
August 28, 2021, 06:32 |
|
#3 |
Member
Join Date: Jul 2020
Location: India
Posts: 66
Rep Power: 6 |
Thanks for your reply. As you mentioned, I am not integrating any quantity or finding maxima-minima. I am just using the UDF to apply source terms and temperature dependent properties. So I hope I don't need to change anything.
|
|
August 28, 2021, 08:33 |
|
#4 |
New Member
Gaurav Kumar
Join Date: Jan 2018
Location: Delhi
Posts: 17
Rep Power: 8 |
I agreed with pakk, and as far as your question, you didn't need to parallelize your code.
|
|
August 28, 2021, 10:58 |
|
#5 |
Member
Join Date: Jul 2020
Location: India
Posts: 66
Rep Power: 6 |
Thanks a lot for clarifying.
|
|
August 30, 2021, 01:19 |
|
#6 | |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
manual says
Quote:
__________________
best regards ****************************** press LIKE if this message was helpful |
||
August 30, 2021, 12:16 |
|
#7 |
Member
Join Date: Jul 2020
Location: India
Posts: 66
Rep Power: 6 |
Thanks for your post. I am using loop over cells to add source terms but not sure whether I need parallelization.
|
|
Tags |
udf parallelization |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
FLUENT UDF for parallelization | Cooper24 | FLUENT | 0 | August 27, 2021 12:55 |
Fluent UDF for moving laser heating of a solid block | Cooper24 | Fluent UDF and Scheme Programming | 7 | July 9, 2021 06:56 |
Problem running fluent with udf on batch | tobi b. | Fluent UDF and Scheme Programming | 3 | April 14, 2016 14:54 |
Running UDF with Supercomputer | roi247 | FLUENT | 4 | October 15, 2015 14:41 |
fluent UDF external library lapack problem | Rick | FLUENT | 0 | May 7, 2008 11:16 |