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

Problem with a simple UDF to calculate cell-averaged particle values

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 13, 2009, 11:16
Default Problem with a simple UDF to calculate cell-averaged particle values
  #1
New Member
 
Mayank Kumar
Join Date: May 2009
Posts: 4
Rep Power: 17
kmayank is on a distinguished road
Hi,

I want to write a UDF for recovering averaged particle properties within each cell throughout the domain.
For that I wrote a simple test UDF, mainly copying from Fluent manual, as follows:

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

DEFINE_EXECUTE_AT_END(execute_at_end)
{

Domain *d;
Thread *t;
cell_t c;
d = Get_Domain(1); /* mixture domain if multiphase */
int count;
Particle *p;

thread_loop_c(t,d)
{
begin_c_loop(c,t)
{

begin_particle_cell_loop(p,c,t){
count += 1;
}end_particle_cell_loop(p,c,t)

}end_c_loop(c,t)
}

printf("Total particles in domain %d \n", count);
}


This gives no error in compilation but on running gives Segmentation Violation and stack backtrace generation. The Segmentation Violation seems due to the presence of the particle loop only. When I remove the particle loop, the error message does not come.


------------------------------------------------------------------------
Stack backtrace generated for process id 301 on signal 1:
Please include this information with any bug report you file on this issue!
------------------------------------------------------------------------
/opt/ansys_inc/v120/fluent/fluent12.0.16/lnamd64/3ddp/fluent.12.0.16[0x128bc1d]
/opt/ansys_inc/v120/fluent/fluent12.0.16/lnamd64/3ddp/fluent.12.0.16[0x128c123]
/lib/libpthread.so.0[0x7fe71c5a90f0]
libudf/lnamd64/3ddp/libudf.so(execute_at_end+0x26)[0x7fe7187c43d2]


Could anyone please me help me on this.

My aim is to obtain cell avergaed values of x, y, z particle velocities throughout the domain. Fluent postprocessing does not provide these values, so I guess we have to write a UDF.

Thanks!!
kmayank is offline   Reply With Quote

Old   January 18, 2011, 02:40
Default
  #2
Member
 
Roman Gobitz-Pfeifer
Join Date: Dec 2009
Location: Stuttgart
Posts: 83
Rep Power: 17
Wikie is on a distinguished road
Hi,

did you solve your problem? I also have to count the number of particles, but I wasn't able to do so yet.

Thanks,
Wikie
Wikie 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
Ensight - node values -cell values leo FLUENT 1 May 12, 2010 09:47
accessing upstream cell - UDF bohis FLUENT 0 April 7, 2008 06:12
Accessing node values using a UDF Nico FLUENT 2 December 20, 2007 03:50
compatibility problem of UDF on LINUX manu FLUENT 4 December 19, 2007 05:58
extremely simple problem... can you solve it properly? Mikhail Main CFD Forum 40 September 9, 1999 10:11


All times are GMT -4. The time now is 01:13.