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

Udf stopped my runs !!

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By souria
  • 1 Post By Saidul

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 15, 2015, 13:31
Default Udf stopped my runs !!
  #1
Member
 
souria
Join Date: Mar 2013
Location: Nancy
Posts: 66
Rep Power: 13
souria is on a distinguished road
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
shahab2710 likes this.
souria is offline   Reply With Quote

Old   January 15, 2015, 16:20
Default
  #2
Member
 
Join Date: Dec 2014
Posts: 38
Rep Power: 11
Harry321 is on a distinguished road
Could you show your UDF?
Harry321 is offline   Reply With Quote

Old   January 15, 2015, 16:58
Default
  #3
Member
 
souria
Join Date: Mar 2013
Location: Nancy
Posts: 66
Rep Power: 13
souria is on a distinguished road
Quote:
Originally Posted by Harry321 View Post
Could you show your UDF?
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
souria is offline   Reply With Quote

Old   January 15, 2015, 17:00
Default
  #4
Member
 
Join Date: Dec 2014
Posts: 38
Rep Power: 11
Harry321 is on a distinguished road
I don't know:/
Harry321 is offline   Reply With Quote

Old   January 15, 2015, 17:10
Default
  #5
Member
 
souria
Join Date: Mar 2013
Location: Nancy
Posts: 66
Rep Power: 13
souria is on a distinguished road
Quote:
Originally Posted by Harry321 View Post
I don't know:/
thanks anyway
souria is offline   Reply With Quote

Old   January 16, 2015, 04:02
Default
  #6
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
I have my doubts with
Code:
sprintf(fp,"(%10.6g %10.6g %10.6g)\n", p->user[0], p->user[1], p->user[2]);
I think you'd rather use:
Code:
par_fprintf(fp,"(%10.6g %10.6g %10.6g)\n", p->user[0], p->user[1], p->user[2]);
For the rest, it might be that you have to add some compiler directives (#if !RP_HOST) to the DEFINE_DPM_OUTPUT macro, because the host does not know about some variables.
pakk is offline   Reply With Quote

Old   January 16, 2015, 04:21
Default
  #7
Member
 
souria
Join Date: Mar 2013
Location: Nancy
Posts: 66
Rep Power: 13
souria is on a distinguished road
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:
Originally Posted by pakk View Post
I have my doubts with
Code:
sprintf(fp,"(%10.6g %10.6g %10.6g)\n", p->user[0], p->user[1], p->user[2]);
I think you'd rather use:
Code:
par_fprintf(fp,"(%10.6g %10.6g %10.6g)\n", p->user[0], p->user[1], p->user[2]);
For the rest, it might be that you have to add some compiler directives (#if !RP_HOST) to the DEFINE_DPM_OUTPUT macro, because the host does not know about some variables.
souria is offline   Reply With Quote

Old   January 16, 2015, 06:28
Default
  #8
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
The Fluent help has a "UDF manual", chapter 7.5.1 explains the compiler directives that I referred to.
pakk is offline   Reply With Quote

Old   January 18, 2015, 20:12
Default
  #9
Member
 
souria
Join Date: Mar 2013
Location: Nancy
Posts: 66
Rep Power: 13
souria is on a distinguished road
Quote:
Originally Posted by pakk View Post
The Fluent help has a "UDF manual", chapter 7.5.1 explains the compiler directives that I referred to.
Thank you, I will check this...
souria is offline   Reply With Quote

Old   January 20, 2015, 21:10
Default
  #10
Member
 
S. Morichika
Join Date: Aug 2014
Posts: 62
Rep Power: 11
Saidul is on a distinguished road
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
Attached Images
File Type: jpg 1.jpg (37.7 KB, 25 views)
File Type: jpg 5.jpg (24.5 KB, 17 views)
Saidul is offline   Reply With Quote

Old   January 21, 2015, 11:08
Default
  #11
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
Did you select "write to file" in the appropriate place, and remember which name you gave the file?
pakk is offline   Reply With Quote

Old   January 21, 2015, 18:49
Default
  #12
Member
 
S. Morichika
Join Date: Aug 2014
Posts: 62
Rep Power: 11
Saidul is on a distinguished road
Quote:
Originally Posted by pakk View Post
Did you select "write to file" in the appropriate place, and remember which name you gave the file?
Yes, I did everything with no results. I think the problem is with code. We have to check the print command. When I changed the print command
{
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
Saidul is offline   Reply With Quote

Old   January 21, 2015, 20:44
Default
  #13
New Member
 
John Yu
Join Date: Dec 2014
Posts: 26
Rep Power: 11
fishball is on a distinguished road
From the error message, it seems the paraellel Fluent process could not be strated. Have you try to run in Serial Model?

Quote:
Originally Posted by souria View Post
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
fishball is offline   Reply With Quote

Old   February 5, 2015, 11:23
Default
  #14
Member
 
souria
Join Date: Mar 2013
Location: Nancy
Posts: 66
Rep Power: 13
souria is on a distinguished road
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

Quote:
Originally Posted by fishball View Post
From the error message, it seems the paraellel Fluent process could not be strated. Have you try to run in Serial Model?
souria is offline   Reply With Quote

Old   February 9, 2015, 01:37
Default
  #15
New Member
 
John Yu
Join Date: Dec 2014
Posts: 26
Rep Power: 11
fishball is on a distinguished road
Quote:
Originally Posted by souria View Post
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

Cool, Thanks
fishball is offline   Reply With Quote

Old   February 12, 2015, 01:44
Default
  #16
Member
 
S. Morichika
Join Date: Aug 2014
Posts: 62
Rep Power: 11
Saidul is on a distinguished road
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]);
}
}
ramakant likes this.
Saidul is offline   Reply With Quote

Old   February 12, 2015, 04:28
Default
  #17
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
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.
pakk is offline   Reply With Quote

Old   February 12, 2015, 21:31
Default
  #18
Member
 
S. Morichika
Join Date: Aug 2014
Posts: 62
Rep Power: 11
Saidul is on a distinguished road
Yes, thanks a lot. I got the point.

Quote:
Originally Posted by pakk View Post
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.
Saidul is offline   Reply With Quote

Reply


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
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


All times are GMT -4. The time now is 22:32.