|
[Sponsors] |
June 30, 2013, 07:55 |
udf error
|
#1 |
New Member
Phil
Join Date: Jun 2013
Posts: 11
Rep Power: 13 |
hi,
I am currently trying to write udf to time-average some LES flow properties that Fluent doesn't time-average as default. As a starting point I have copied an execute_at_end udf from the manual, exactly as it is written in the manual, yet I get error messages when I try to compile or interpret it. My udf is as follows: #include "udf.h" DEFINE_EXECUTE_AT_END(averager) { Domain *d; Thread *t; /* Integrate dissipation. */ real sum_diss=0.; cell_t c; d = Get_Domain(1); /* mixture domain if multiphase */ thread_loop_c(t,d) { begin_c_loop )c,t) sum_diss += C_D(c,t) * C_VOLUME(c,t); end_c_loop(c,t) } } printf("Volume integral of turbulent dissipation: %g\n", sum_diss); fflush(stdout); } And the error message I get is: line 15: begin_c_loop: undeclared variable Does anyone have any ideas? Thanks |
|
June 30, 2013, 09:41 |
|
#2 |
Member
Christopher Hershey
Join Date: Feb 2012
Location: East Lansing, Michigan
Posts: 41
Rep Power: 14 |
It looks like your parentheses are backwards in your cell loop. Try this:
#include "udf.h" DEFINE_EXECUTE_AT_END(averager) { Domain *d; Thread *t; /* Integrate dissipation. */ real sum_diss=0.; cell_t c; d = Get_Domain(1); /* mixture domain if multiphase */ thread_loop_c(t,d) { begin_c_loop(c,t) { sum_diss += C_D(c,t) * C_VOLUME(c,t); } end_c_loop(c,t) } } printf("Volume integral of turbulent dissipation: %g\n", sum_diss); fflush(stdout); } |
|
June 30, 2013, 09:53 |
|
#3 |
Member
Christopher Hershey
Join Date: Feb 2012
Location: East Lansing, Michigan
Posts: 41
Rep Power: 14 |
Actually, after looking at this UDF, you have an extra } after the end_c_loop(c,t). Remove it to make sure all brackets are balanced. After doing that, the UDF compiled on my system without error.
|
|
Tags |
compiled, error, fluent, interpreted, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Undeclared Identifier Errof UDF | SteveGoat | Fluent UDF and Scheme Programming | 7 | October 15, 2014 08:11 |
Problem with UDF compiling for kTkLW model | Wantami | FLUENT | 0 | July 18, 2011 06:11 |
ParaView for OF-1.6-ext | Chrisi1984 | OpenFOAM Installation | 0 | December 31, 2010 07:42 |
Installation OF1.5-dev | ttdtud | OpenFOAM Installation | 46 | May 5, 2009 03:32 |
Problem with compile the setParabolicInlet | ivanyao | OpenFOAM Running, Solving & CFD | 6 | September 5, 2008 21:50 |