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

Parallel INIT UDF trouble

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

Reply
 
LinkBack Thread Tools Display Modes
Old   December 24, 2010, 03:29
Question Parallel INIT UDF trouble
  #1
New Member
 
Join Date: Dec 2010
Posts: 2
Rep Power: 0
mil3st3g is on a distinguished road
I've written a udf to patch in volume fractions on a simple rectangular, uniform grid, which works well in serial. However, it crashes fluent when interpreting it in the parallel solver (have to end process to get rid of it actually). Have made sure the cell loops use the parallel macro, but that didn't make much difference. Am wondering if anybody has seen a similar error, or has any hints on what exactly is causing it.

Here's the error message (full udf is below that):

cpp -I"C:\PROGRA~1\ANSYSI~1\v120\fluent\fluent12.0.1 6/src" -I"C:\PROGRA~1\ANSYSI~1\v120\fluent\fluent12.0.1 6/cortex/src" -I"C:\PROGRA~1\ANSYSI~1\v120\fluent\fluent12.0.1 6/client/src" -I"C:\PROGRA~1\ANSYSI~1\v120\fluent\fluent12.0.1 6/multiport/src" -I. -
UDFCONFIG_H="<udfconfig-host.h>" "E:\Numerical Studies\Linear Theory\phase_init_function_case4.c"
E:\\Numerical Studies\\Linear Theory\\phase_init_function_case4.c:2: math.h: No such file or directory
mixture_domain definition shadows previous definition
Warning: E:\\Numerical Studies\\Linear Theory\\phase_init_function_case4.c: line 6:
999999 (..\src\mpsystem.c@1148): mpt_read: failed: errno = 10054
999999: mpt_read: error: read failed trying to read 4 bytes: No such file or directory
MPI Application rank 0 exited before MPI_Finalize() with status -1073741819



The offending UDF:

#include "udf.h"
#include "math.h"
/* domain pointer that is passed by init function is mixture domain */
DEFINE_INIT(phase_init_function_case4, mixture_domain)
{
int phase_domain_index;
cell_t cell;
Thread *cell_thread;
Domain *subdomain;
real xc[ND_ND];
double yamp;
double dx = 0.01/4;
/* loop over all subdomains (phases) in the superdomain (mixture) */
sub_domain_loop(subdomain, mixture_domain, phase_domain_index)
{
/* loop if secondary phase */
if (DOMAIN_ID(subdomain) == 3)

/* loop over all cell threads in the secondary phase domain */
thread_loop_c (cell_thread, subdomain)
{
/*loop over all cells in secondary phase cell threads */
begin_c_loop_int (cell, cell_thread)
{
C_CENTROID(xc,cell,cell_thread);
yamp = 0.0001*cos(2*3.14159625*xc[0]/0.01);
if (xc[1] > 0)
if (xc[1] < dx & yamp > 0)
C_VOF(cell,cell_thread) = yamp/dx;
else
C_VOF(cell,cell_thread) = 0;
else
if (xc[1] > -dx & yamp <= 0)
C_VOF(cell,cell_thread) = 1 + yamp/dx;
else
C_VOF(cell,cell_thread) = 1;
}
end_c_loop_int (cell,cell_thread)
}
/* loop if primary phase */
else if (DOMAIN_ID(subdomain) == 2)
/* loop over all cell threads in the secondary phase domain */
thread_loop_c (cell_thread, subdomain)
{
/*loop over all cells in secondary phase cell threads */
begin_c_loop_int (cell, cell_thread)
{
C_CENTROID(xc,cell,cell_thread);
yamp = 0.0001*cos(2*3.14159625*xc[0]/0.01);
if (xc[1] > 0)
if (xc[1] < dx & yamp > 0)
C_VOF(cell,cell_thread) = 1 - yamp/dx;
else
C_VOF(cell,cell_thread) = 1;
else
if (xc[1] > -dx & yamp <= 0)
C_VOF(cell,cell_thread) = -yamp/dx;
else
C_VOF(cell,cell_thread) = 0;
}
end_c_loop_int (cell,cell_thread)
}
}
}
mil3st3g is offline   Reply With Quote

Old   January 6, 2011, 12:50
Default
  #2
Senior Member
 
dmoroian's Avatar
 
Dragos
Join Date: Mar 2009
Posts: 644
Rep Power: 10
dmoroian is on a distinguished road
Try this:
Code:
#include "udf.h"
#include "math.h"
/* domain pointer that is passed by init function is mixture domain */
DEFINE_INIT(phase_init_function_case4, mixture_domain)
{
int phase_domain_index; cell_t cell; Thread *cell_thread; Domain *subdomain; real xc[ND_ND]; double yamp; double dx = 0.01/4; #if !RP_HOST
/* loop over all subdomains (phases) in the superdomain (mixture) */ sub_domain_loop(subdomain, mixture_domain, phase_domain_index) {
/* loop if secondary phase */ if (DOMAIN_ID(subdomain) == 3) /* loop over all cell threads in the secondary phase domain */ thread_loop_c (cell_thread, subdomain) {
/*loop over all cells in secondary phase cell threads */ begin_c_loop_int (cell, cell_thread) {
C_CENTROID(xc,cell,cell_thread); yamp = 0.0001*cos(2*3.14159625*xc[0]/0.01); if (xc[1] > 0)
if (xc[1] < dx & yamp > 0) C_VOF(cell,cell_thread) = yamp/dx; else C_VOF(cell,cell_thread) = 0;
else
if (xc[1] > -dx & yamp <= 0)
C_VOF(cell,cell_thread) = 1 + yamp/dx;
else
C_VOF(cell,cell_thread) = 1;
} end_c_loop_int (cell,cell_thread)
}
/* loop if primary phase */ else if (DOMAIN_ID(subdomain) == 2)
/* loop over all cell threads in the secondary phase domain */ thread_loop_c (cell_thread, subdomain) {
/*loop over all cells in secondary phase cell threads */ begin_c_loop_int (cell, cell_thread) {
C_CENTROID(xc,cell,cell_thread); yamp = 0.0001*cos(2*3.14159625*xc[0]/0.01); if (xc[1] > 0)
if (xc[1] < dx & yamp > 0)
C_VOF(cell,cell_thread) = 1 - yamp/dx;
else
C_VOF(cell,cell_thread) = 1;
else
if (xc[1] > -dx & yamp <= 0)
C_VOF(cell,cell_thread) = -yamp/dx;
else
C_VOF(cell,cell_thread) = 0;
} end_c_loop_int (cell,cell_thread)
}
} #endif
}
dmoroian is offline   Reply With Quote

Old   January 6, 2011, 14:07
Default
  #3
New Member
 
Join Date: Dec 2010
Posts: 2
Rep Power: 0
mil3st3g is on a distinguished road
Ok, I should have just posted this when I found it a while ago, just forgot about it while running a bunch of stuff in fluent, but I managed to solve the error following the instructions here: compiling udfs in win 64

Turns out this solved the issues I was having, and after doing this, I was able to load the existing code as compiled, rather than interpreted, and it worked just like it did in the serial version, without having to modify the function from what is in the original post.

Edit, nevermind, I did end up adding the #if !RP_HOST and #endif as you suggested dmoroian, so that in combination with using the .net sdk command prompt to start fluent.
mil3st3g is offline   Reply With Quote

Reply

Tags
fluent 12.0, parallel error, udf error

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 parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 22:14
problem loading UDF library in parallel cluster Veera Gutti FLUENT 7 July 3, 2011 09:15
Help: how to realize UDF on parallel cluster? Haoyin FLUENT 1 August 6, 2007 13:53
parallel UDF problem kerem FLUENT 2 June 20, 2006 06:56
UDF in parallel version. yobee FLUENT 0 August 17, 2004 04:12


All times are GMT -4. The time now is 07:46.