CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > FLUENT

UDF DPM Unsteady

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

Reply
 
LinkBack Thread Tools Display Modes
Old   February 23, 2006, 09:34
Default UDF DPM Unsteady
  #1
Lourival
Guest
 
Posts: n/a
Hy everybody.

I'm trying to write a quite simple UDF to obtain some simple values of the particles flow.

So, I'm using the DEFINE_DPM_BC to obtain the position and the velocity of the particle that hit the wall. Also I'm using the LES turbulence model with 3D Unsteady solver with a group injection of 5 stream.

I wrote this simple UDF, shown below, but althought this UDF is compiled without problem I don't have the file with the values of the particles that are hitting the wall.

Does anybody did something similar ?? Does anyone know why I can print to file those values ?

Thanks

Lourival

#include "udf.h"

DEFINE_DPM_BC(bc_leitura_imp, p, t, f, f_normal, dim)

{ real vx, px; real vy, py; real vz, pz; real diam ; int ID_part ; FILE *fp;

vx=p->state.V[0] ;

vy=p->state.V[1] ;

vz=p->state.V[2] ;

px=p->state.pos[0] ;

py=p->state.pos[1] ;

pz=p->state.pos[2] ;

diam=p->state.diam ;

ID_part= p->part_id ;

fp = fopen("teste_export.txt","a+");

fprintf(fp,"ID %d", ID_part);

fprintf(fp,";");

fprintf(fp,"Vel X %f", vx);

fprintf(fp,";");

fprintf(fp, "Vel Y %f", vy);

fprintf(fp,";");

fprintf(fp, "Vel Z %f", vz);

fprintf(fp,";");

fprintf(fp,"Pos X %f", px);

fprintf(fp,";");

fprintf(fp, "Pos Y %f", py);

fprintf(fp,";");

fprintf(fp, "Pos Z %f", pz);

fprintf(fp,";");

fprintf(fp, "Diam %f", diam);

fprintf(fp,"\n");

fclose(fp);

return PATH_ABORT;

}

  Reply With Quote

Old   February 23, 2006, 13:38
Default Re: UDF DPM Unsteady
  #2
HS
Guest
 
Posts: n/a
Hi!

I have actually done something similar that seemed to work just fine. I don't know what your problem is, I cannot see it in the code... Are you sure that the particles actually hit the wall during your simulation? You could put a simple Message-macro call within the code so that you will actually see in FLUENT whether the bc is being executed or not.

Also, I am not sure why you use "a+" as the mode for fopen? Try using only "a" instead. That should work fine.

Hope this helps!

/Henrik
  Reply With Quote

Old   February 23, 2006, 13:56
Default Re: UDF DPM Unsteady
  #3
Lourival
Guest
 
Posts: n/a
Hi Henrik, thanks a lot for you msn...

Well my problem is something like air flowing around a tube and on this tube I want to know the velocities, position and etc.. of the particles that hit the wall.

So, I did a test, I set only a message on the console of the FLUENT something like:

DEFINE_DPM_BC (....) { Message(" The UDF has been used"); return PATH_ABORT ; }

But I got none of this on the console, after that I shoot down the UDF and I am using the "escape" option of the Fluent model for the Wall and the FLUENT says:

number tracked: 600, escaped: 0, aborted: 0, trapped: 0, evaporated: 0, incomplete: 0

I guess that is something wrong with my physical model, but I don't know where...
  Reply With Quote

Old   February 23, 2006, 15:22
Default Re: UDF DPM Unsteady
  #4
Lourival
Guest
 
Posts: n/a
Hey Henrik, I got the error... The problem was that the particle was too light so, it wasn't hitting the tube. I increased the density and every thing was OK...

Thanks for your attention
  Reply With Quote

Old   February 24, 2006, 08:21
Default Re: UDF DPM Unsteady
  #5
Lourival
Guest
 
Posts: n/a
I use the "a+" to append a text to the end of my file. And if the file doesn't exist then it is created...

Lourival
  Reply With Quote

Old   February 24, 2006, 08:36
Default Re: UDF DPM Unsteady
  #6
HS
Guest
 
Posts: n/a
If it works fine, then it's probably OK

I use only "a" to do the same thing, and it works just fine too.

Cheers, Henrik
  Reply With Quote

Reply

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
Itīs possible to use this in unsteady dpm tracking? JSoares Fluent UDF and Scheme Programming 3 June 9, 2011 10:41
DPM UDF particle position using the macro P_POS(p)[i] dm2747 FLUENT 0 April 17, 2009 01:29
DPM with UDF - Step-by-Step Procedure???? Prashanth FLUENT 3 April 3, 2009 17:45
UDF Unsteady velocity profile Rashad FLUENT 0 February 27, 2008 15:57
steady or unsteady? (in dpm) winnie FLUENT 1 April 28, 2003 11:30


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