CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > FLUENT

First Iteration UDF Problem

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   May 16, 2016, 17:00
Default First Iteration UDF Problem
  #1
New Member
 
Join Date: Nov 2015
Posts: 16
Rep Power: 3
Student_GF is on a distinguished road
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.
Student_GF is offline   Reply With Quote

Old   May 20, 2016, 01:21
Default
  #2
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 791
Rep Power: 9
`e` is on a distinguished road
What is your UDF and are you running in parallel or serial mode?
`e` is offline   Reply With Quote

Old   May 20, 2016, 10:40
Default
  #3
New Member
 
Join Date: Nov 2015
Posts: 16
Rep Power: 3
Student_GF is on a distinguished road
Hello!

My simulation is running in parallel woth 4 processes.
Student_GF is offline   Reply With Quote

Old   May 20, 2016, 12:01
Default
  #4
New Member
 
Join Date: Nov 2015
Posts: 16
Rep Power: 3
Student_GF is on a distinguished road
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.
Student_GF is offline   Reply With Quote

Old   May 20, 2016, 17:50
Default
  #5
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 791
Rep Power: 9
`e` is on a distinguished road
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).
`e` is offline   Reply With Quote

Reply

Tags
first iteration, question, udf

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF Compilation Error - Loading Library - COMMON Problem! Help! robtheslob Fluent UDF and Scheme Programming 8 July 24, 2015 00:53
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM Rizwan Fluent UDF and Scheme Programming 32 May 8, 2015 06:05
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 10:22


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