CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

parallel implementation of DEFINE_INIT UDF not working

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 28, 2019, 16:58
Unhappy parallel implementation of DEFINE_INIT UDF not working
  #1
New Member
 
Join Date: Jan 2019
Posts: 1
Rep Power: 0
eml51 is on a distinguished road
Hi,

I have written a UDF to initialise all the cells in my domain to a temperature of 500K; however, when I contour plot static temperature (after initialising the solution) all the cells are at the default 300K specified in the GUI.

My simulation is transient, using a pressure based solver and a partially premixed combustion model.

My end goal is to initialise the solution with a more complex temperature distribution (hence the motivation to write a UDF).

I have hooked the UDF onto "initialisation" and I am using Fluent in Parallel mode in Workbench 19.2. I have also included the mem.h header when building the library.

Here is the code:



#include "udf.h" //DEFINE macros + more
#include "mem.h" //access flow variables

// initialise the solution with temp = 500K
DEFINE_INIT(temp_init_test,d)
{
cell_t c;
Thread *t;
/* loop over all cell threads in the domain */

thread_loop_c(t,d)
{
/* loop over all cells */
begin_c_loop_all(c,t)
{
C_T(c,t) = 500.;
Message("first ct is %f\n", C_T(c,t));

}
end_c_loop_all(c,t)
}
Message("Cells should be initialised!");
}



Am I missing something required to make this work in parallel mode (or something else entirely)? Any insight is greatly appreciated.


Thanks in advance


EDIT:
The UDF behaves the exact same way when Fluent is run in Serial mode
eml51 is offline   Reply With Quote

Old   January 28, 2019, 22:26
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
in your code you have output messages
Code:
Message("first ct is %f\n", C_T(c,t));
Message("Cells should be initialized!");
did you get messages in fluent's output console?

if not, than your init macro is not hooked

user-defined -> function hooks -> initialization -> select your macro -> OK

best regards
AlexanderZ is offline   Reply With Quote

Reply

Tags
define_init, parallel, udf


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Parallel UDF Segmentation fault error KevinZ09 Fluent UDF and Scheme Programming 1 January 9, 2017 06:30
Explicitly filtered LES saeedi Main CFD Forum 16 October 14, 2015 12:58
simpleFoam parallel AndrewMortimer OpenFOAM Running, Solving & CFD 12 August 7, 2015 19:45
udf parallel toghay FLUENT 2 July 14, 2015 00:13
UDF is working in Laptop, but not working in Serial Cluster Tanjina Fluent UDF and Scheme Programming 0 December 20, 2013 22:42


All times are GMT -4. The time now is 16:47.