|
[Sponsors] |
parallel implementation of DEFINE_INIT UDF not working |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 28, 2019, 16:58 |
parallel implementation of DEFINE_INIT UDF not working
|
#1 |
New Member
Join Date: Jan 2019
Posts: 1
Rep Power: 0 |
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 |
|
January 28, 2019, 22:26 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
in your code you have output messages
Code:
Message("first ct is %f\n", C_T(c,t)); Message("Cells should be initialized!"); if not, than your init macro is not hooked user-defined -> function hooks -> initialization -> select your macro -> OK best regards |
|
Tags |
define_init, parallel, udf |
|
|
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 |