|
[Sponsors] |
May 16, 2016, 18:00 |
First Iteration UDF Problem
|
#1 |
New Member
Join Date: Nov 2015
Posts: 16
Rep Power: 11 |
Hi All,
I have a question regarding UDF's, mainly using "first iteration". I currently creating a UDF code to execute in the first iteration of a timestep using "first Iteration". The problem I am having is that when simulation is executed, the code that I intended to be executed at at the first iteration executes 5 times rather than the intended one in the first iteration of a time step. Does anyone know why this occurs? Thank you. |
|
May 20, 2016, 02:21 |
|
#2 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
What is your UDF and are you running in parallel or serial mode?
|
|
May 20, 2016, 11:40 |
|
#3 |
New Member
Join Date: Nov 2015
Posts: 16
Rep Power: 11 |
Hello!
My simulation is running in parallel woth 4 processes. |
|
May 20, 2016, 13:01 |
|
#4 |
New Member
Join Date: Nov 2015
Posts: 16
Rep Power: 11 |
Opps currently I am not on my work computer but the code is something like the following
define Profile { Begin cell loop { if (first_iteration) { (does operation) } else { (default to constant value) } printf(Display Values <- This was done so I can determine how many time it is running at what time) } end Cell loop } If you need the real code, I can get it to you later tonight. |
|
May 20, 2016, 18:50 |
|
#5 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
The DEFINE_PROFILE macro is called by all compute nodes and the host (in parallel mode). For your case where parallel is used with four processes, four compute nodes exist as well as the host causing the macro to be called a total of five times. Depending on what you're trying to achieve, this duplication is fine.
The cell loop (with begin_c_loop) only contains the cells on the respective compute node. If the boundary value only depends on local values on its compute node (e.g. position) then you'll be fine as is. However, if you're defining a boundary value based on global values (e.g. total volume of the computation domain) then you'll need to be careful of counting overlapping cells. Have a read of the parallel considerations chapter in the UDF manual for details (the section on looping over interior and exterior cells). |
|
Tags |
first iteration, question, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM | Rizwan | Fluent UDF and Scheme Programming | 40 | March 18, 2018 07:05 |
UDF Compilation Error - Loading Library - COMMON Problem! Help! | robtheslob | Fluent UDF and Scheme Programming | 8 | July 24, 2015 01:53 |
UDF compiling problem in Flient 6.3 | jeevan kumar | FLUENT | 2 | February 25, 2009 01:43 |
UDF using problem, error happens-heip!! | Michael | FLUENT | 1 | December 9, 2008 08:51 |
UDF variables F1, y / problem with UDF | Fabian | FLUENT | 6 | June 2, 2003 11:22 |