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

Itīs possible to use this in unsteady dpm tracking?

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 25, 2011, 15:26
Default Itīs possible to use this in unsteady dpm tracking?
  #1
New Member
 
Join Date: Feb 2011
Posts: 16
Rep Power: 15
JSoares is on a distinguished road
Hello everyone.

Itīs possible to use this in unsteady dpm tracking?
I have a problem with this UDF using unsteady particle tracking, because the scalar is updated to a new value and will not retain the last. I want to measure the total U.V. dose in each particle on the output boundary, but I only get the last value of UV dose, and not the total.
Iīm a beginner user to UDF but there is any way to change this, to retain the values of UV dose each dpm time step?

/************************************************** *********************/
/* UDF for computing the UV dosage along a particle trajectory */
/************************************************** *********************/

#include "udf.h"
#include "dpm.h"
#include "sg_disco.h"

#define fileuv "output.dpm"
#define C_DO(c,t)C_STORAGE_R_XV(c,t,SV_DO_IRRAD,0)

static real uv_intensity_0;
static real x0, y00, z0;

FILE *fuv;

DEFINE_DPM_SCALAR_UPDATE(uv_dosage, cell, thread, initialize, p)
{
cphase_state_t *c = &(p->cphase);
if (initialize)
{
p->user[0] = 0.;
uv_intensity_0 = C_DO(cell,thread);
x0=p->state.pos[0];
y00=p->state.pos[1];
z0=p->state.pos[2];
}

else
{
p->user[0] += P_DT(p) * .5 * (uv_intensity_0 + C_DO(cell,thread));
uv_intensity_0 = C_DO(cell,thread);
}
}

DEFINE_DPM_OUTPUT(uv_output, header, fp, p, thread, plane)
{

char name[100];


if (header)
{
fuv = fopen(fileuv,"w");
if (NNULLP(thread))
{
fprintf(fuv,"(%s %d)\n",thread->head->dpm_summary.sort_file_name,14);
}
else
fprintf(fuv,"(%s %d)\n",plane->sort_file_name,14);
fprintf(fuv,"(%10s %10s %10s %10s %10s %10s %10s"
" %10s %10s %10s %10s %10s %10s %10s %s)\n",
"X0","Y0","Z0",
"X","Y","Z","U","V","W","diameter","T","mass-flow",
"time","UV-Dosage","name");
fclose(fuv);
}
else
{
fuv = fopen(fileuv,"a");
sprintf(name,"%s:%d",p->injection->name,p->part_id);
fprintf(fuv,
"((%10.6g %10.6g %10.6g %10.6g %10.6g %10.6g "
"%10.6g %10.6g %10.6g %10.6g %10.6g %10.6g %10.6g %10.6g) %s)\n",
x0,y00,z0,
p->state.pos[0], p->state.pos[1], p->state.pos[2],
p->state.V[0], p->state.V[1], p->state.V[2],
p->state.diam, p->state.temp, p->flow_rate, p->state.time,
p->user[0], name);
fclose(fuv);
}
}
JSoares is offline   Reply With Quote

Old   May 26, 2011, 10:08
Default
  #2
New Member
 
Join Date: Feb 2011
Posts: 16
Rep Power: 15
JSoares is on a distinguished road
Hello fluent users,

Sorry to ask again, but i think that i wasnīt very explicit. In first figure you see the particles recording the total uv radiation . In second figure youīll see particles recording only instant uv radiation.
I want to change the UDF so i can have results as first figure. Anyone nows how to do that?

Thanks

http://imageshack.us/photo/my-images/851/pata.jpg/

http://imageshack.us/photo/my-images/543/16044862.jpg/

Last edited by wyldckat; September 3, 2015 at 17:48. Reason: disabled embedded images
JSoares is offline   Reply With Quote

Old   June 9, 2011, 08:53
Default
  #3
New Member
 
Lauri Parviainen
Join Date: Jul 2010
Posts: 8
Rep Power: 15
lauripar is on a distinguished road
Hi, I'm modelling UV and particles my self too. Have you visited this site?
http://www.sandia.gov/cfd-water/uvdisinfection.htm

It might help you a bit. At least there is an UDF file that can calculate the total UV dose what a particle gets.
lauripar is offline   Reply With Quote

Old   June 9, 2011, 10:41
Default
  #4
New Member
 
Join Date: Feb 2011
Posts: 16
Rep Power: 15
JSoares is on a distinguished road
Quote:
Originally Posted by lauripar View Post
Hi, I'm modelling UV and particles my self too. Have you visited this site?
http://www.sandia.gov/cfd-water/uvdisinfection.htm

It might help you a bit. At least there is an UDF file that can calculate the total UV dose what a particle gets.
Thanks for your answer lauripar. Iīm using that udf in my simulations and the results are positive for steady state. If you try to use it in a transient dpm formulation, it only retains the last state information. I think that the diferences wouldnīt be big, but i would like to try it.

Thanks anyway.
JSoares is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trouble: Sandia UV UDF on FLUENT 12.0.16 RPJones Fluent UDF and Scheme Programming 31 May 25, 2011 11:15
particle tracking in unsteady flow peterchen FLUENT 1 July 22, 2010 22:18
steady or unsteady DPM ??? Marina FLUENT 5 July 5, 2006 04:52
steady or unsteady? (in dpm) winnie FLUENT 1 April 28, 2003 11:30
CFX- Particle tracking in Unsteady flow faithkim Main CFD Forum 3 September 14, 1999 20:57


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