|
[Sponsors] |
Problem with a simple UDF to calculate cell-averaged particle values |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 13, 2009, 11:16 |
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 |
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!! |
|
January 18, 2011, 02:40 |
|
#2 |
Member
Roman Gobitz-Pfeifer
Join Date: Dec 2009
Location: Stuttgart
Posts: 83
Rep Power: 16 |
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 |
|
|
|
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 |