|
[Sponsors] |
January 15, 2015, 13:31 |
Udf stopped my runs !!
|
#1 |
Member
souria
Join Date: Mar 2013
Location: Nancy
Posts: 66
Rep Power: 13 |
Hey everyone,
I'm simulating sediment transport using DPM. So, I tried an UDF to follow the particules. I built and hooked the udf, no problem. But, when I try to track the particules (means when I run the DPM) I got this message : " DPM Iteration .... MPI Application rank 0 exited before MPI_Finalize() with status -1 The fl process could not be started. " Please, does anyone know where it comes from ?? !! Thanks for your help Souria |
|
January 15, 2015, 16:20 |
|
#2 |
Member
Join Date: Dec 2014
Posts: 38
Rep Power: 11 |
Could you show your UDF?
|
|
January 15, 2015, 16:58 |
|
#3 |
Member
souria
Join Date: Mar 2013
Location: Nancy
Posts: 66
Rep Power: 13 |
Here is the UDF :
/************************************************** ************************************/ /* UDF for computing cell co-ordinates */ /************************************************** ************************************/ #include "udf.h" #include "sg.h" #include "prop.h" #include "dpm.h" #include "surf.h" #define WALL_ID 5 DEFINE_DPM_SCALAR_UPDATE(particle_coords, c, ct, initialize, p) { real A[ND_ND]; int n; face_t f; Thread *ft; c_face_loop(c, ct, n) { f=C_FACE(c, ct,n); ft=C_FACE_THREAD(c, ct, n); if (NNULLP(ft)) { if (THREAD_ID(ft)== WALL_ID) { p->user[0] = p->state.pos[0]; p->user[1] = p->state.pos[1]; p->user[2] = p->state.pos[2]; } } } } DEFINE_DPM_OUTPUT(Particle_coords_output, header, fp, p, thread, plane) { char name[10]; if (header) { if (NNULLP(thread)) par_fprintf(fp,"(%s %d)\n", THREAD_HEAD(thread)-> dpm_summary.sort_file_name,5); else par_fprintf(fp,"(%s %d)\n", plane->sort_file_name,5); par_fprintf(fp,"(%10s %10s %10s)\n","X", "Y", "Z"); } else { sprintf(name,"%s:%d", p->injection->name,p->part_id); sprintf(fp,"(%10.6g %10.6g %10.6g)\n", p->user[0], p->user[1], p->user[2]); } } thanks for your help |
|
January 15, 2015, 17:00 |
|
#4 |
Member
Join Date: Dec 2014
Posts: 38
Rep Power: 11 |
I don't know:/
|
|
January 15, 2015, 17:10 |
|
#5 |
Member
souria
Join Date: Mar 2013
Location: Nancy
Posts: 66
Rep Power: 13 |
||
January 16, 2015, 04:02 |
|
#6 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26 |
I have my doubts with
Code:
sprintf(fp,"(%10.6g %10.6g %10.6g)\n", p->user[0], p->user[1], p->user[2]); Code:
par_fprintf(fp,"(%10.6g %10.6g %10.6g)\n", p->user[0], p->user[1], p->user[2]); |
|
January 16, 2015, 04:21 |
|
#7 | |
Member
souria
Join Date: Mar 2013
Location: Nancy
Posts: 66
Rep Power: 13 |
Hi Pakk,
I change it but it gives the same error ! Excuse me, but what didi you mean by (#if !RP_HOST). PS. I'm not an expert in UDF, I just begun ... Thanks for your help Quote:
|
||
January 16, 2015, 06:28 |
|
#8 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26 |
The Fluent help has a "UDF manual", chapter 7.5.1 explains the compiler directives that I referred to.
|
|
January 18, 2015, 20:12 |
|
#9 |
Member
souria
Join Date: Mar 2013
Location: Nancy
Posts: 66
Rep Power: 13 |
||
January 20, 2015, 21:10 |
|
#10 |
Member
S. Morichika
Join Date: Aug 2014
Posts: 62
Rep Power: 11 |
I compiled the the same UDF with two warnings first time (Image attached) and no warning when I compiled it for second time. Then run the simulations without any error but can't find the output file . The fluent console shows that some particles are trapped.
Can anyone help regarding this problem. Thanks in advance. Saidul |
|
January 21, 2015, 11:08 |
|
#11 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26 |
Did you select "write to file" in the appropriate place, and remember which name you gave the file?
|
|
January 21, 2015, 18:49 |
|
#12 | |
Member
S. Morichika
Join Date: Aug 2014
Posts: 62
Rep Power: 11 |
Quote:
{ char name[100]; if (header) { if (NNULLP(thread)) cxprintf(fp,"(%s %d)\n", THREAD_HEAD(thread)-> dpm_summary.sort_file_name,8); else cxprintf(fp,"(%s %d)\n", plane->sort_file_name,8); cxprintf(fp,"(%10s %10s %10s)\n","X", "Y", "Z"); } else { sprintf(name,"%s:%d", p->injection->name,p->part_id); cxprintf(fp,"(%10.6g %10.6g %10.6g)\n", p->user[0], p->user[1], p->user[2]); } } and run the simulation, it showed a fatal error as " Error: received a fatal signal (Segmentation fault)" and stopped the simulation. I don't know what is happening .... saeed |
||
January 21, 2015, 20:44 |
|
#13 | |
New Member
John Yu
Join Date: Dec 2014
Posts: 26
Rep Power: 11 |
From the error message, it seems the paraellel Fluent process could not be strated. Have you try to run in Serial Model?
Quote:
|
||
February 5, 2015, 11:23 |
|
#14 |
Member
souria
Join Date: Mar 2013
Location: Nancy
Posts: 66
Rep Power: 13 |
I fixed the problem.
It comes from parallel, so I parallelized the UDF. I just added : #if !RP_NODE /*in the begining of the UDF*/ #endif /*in the end of the UDF*/ Hope it could help others... Souria |
|
February 9, 2015, 01:37 |
|
#15 |
New Member
John Yu
Join Date: Dec 2014
Posts: 26
Rep Power: 11 |
||
February 12, 2015, 01:44 |
|
#16 |
Member
S. Morichika
Join Date: Aug 2014
Posts: 62
Rep Power: 11 |
Hello,
I compile the following UDF with a warning. # Generating udf_names.c because of makefile dpm_modification.obj udf_names.c udf_names.c(9) : warning C4113: 'void (*)()' differs in parameter lists from 'void (*)(void)' udf_names.c(10) : warning C4113: 'void (*)()' differs in parameter lists from 'void (*)(void)' # Linking libudf.dll because of user_nt.udf udf_names.obj dpm_modification.obj Microsoft (R) Incremental Linker Version 10.00.30319.01 Copyright (C) Microsoft Corporation. All rights reserved. How can I fix it..... /************************************************** ************************************/ /* UDF for computing cell co-ordinates */ /************************************************** ************************************/ #include "udf.h" #include "sg.h" #include "prop.h" #include "dpm.h" #include "surf.h" #define WALL_ID 8 (line 9) DEFINE_DPM_SCALAR_UPDATE(particle_coords, c, ct, initialize, p) { real A[ND_ND]; int n; face_t f; Thread *ft; c_face_loop(c, ct, n) { ft=C_FACE_THREAD(c, ct, n); if (THREAD_ID(ft)==WALL_ID) { p->user[0] = p->state.pos[0]; p->user[1] = p->state.pos[1]; p->user[2] = p->state.pos[2]; } } } DEFINE_DPM_OUTPUT(Particle_coords_output, header, fp, p, thread, plane) { char name[1000]; if (header) { if (NNULLP(thread)) par_fprintf_head(fp,"(%s %d)\n", THREAD_HEAD(thread)->dpm_summary.sort_file_name,3); else par_fprintf_head(fp,"(%s %d)\n", plane->sort_file_name,3); par_fprintf_head(fp,"\n %10s %10s %10s","X", "Y", "Z"); } else { sprintf(name,"%s:%d", p->injection->name,p->part_id); par_fprintf(fp,"%10.6g %10.6g %10.6g\n", p->user[0], p->user[1], p->user[2]); } } |
|
February 12, 2015, 04:28 |
|
#17 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26 |
Look more carefully: the warning that Fluent is giving, points to the file "udf_names.c", not to your file.
It is a file that Fluent makes while (preparing to) compile your code. I get these warnings all the time, since migrating to Fluent 15.0. It is not a mistake in your code, but a mistake in Fluent code. You can ignore it since it does no harm; if you want to get rid of the code then contact the Fluent developers. |
|
February 12, 2015, 21:31 |
|
#18 | |
Member
S. Morichika
Join Date: Aug 2014
Posts: 62
Rep Power: 11 |
Yes, thanks a lot. I got the point.
Quote:
|
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF using c_face_loop(c,t,i) | frederic | FLUENT | 3 | January 16, 2017 23:17 |
Parallelize UDF? Which kind of UDF? | Lilly | FLUENT | 5 | March 25, 2014 02:05 |
Help! Delete the UDM codes in the UDF | Messi | Fluent UDF and Scheme Programming | 2 | January 28, 2014 09:01 |
udf for multiple reaction | alihosseini63 | Fluent UDF and Scheme Programming | 0 | July 4, 2013 18:37 |
UDF programming | fullmonty | FLUENT | 5 | June 30, 2011 02:40 |