|
[Sponsors] |
January 28, 2004, 18:40 |
DEFINE_DPM_OUTPUT udf
|
#1 |
Guest
Posts: n/a
|
Hello,
I am trying to write a DEFINE_DPM_OUTPUT udf so that I can track particles as they move through my domain and also assign a strain rate to each particle at each location in the domain. (time dependant - moving mesh). As a first step, I am writing a simple template just to see if I have the idea. I have written the following: #include "udf.h" DEFINE_DPM_OUTPUT(history,header,fp,p,t,plane) { fp = fopen("myfile.txt","a+"); if(header) fprintf(fp,"This is a test\n"); else{ if(p==NULL) ; else{ fprintf(fp,"%10.6f",P_VEL(p)[0]); fprintf(fp," %10.6f",P_POS(p)[0]); } } } When I interpret the UDF, I get the error message: Error: D:\velocity_history.c: line 18: P_POS: undeclared variable However, if I remove the last fprintf statement (containing the P_POS(p)[i] macro which is clearly defined in the manual as giving particle position for i=0,1,2 (and also in dpm.h), then there is no problem. Is the P_VEL(p) macro correct, but I am using P_POS(p) incorrectly? With just the P_POS(p) statement in my udf, Fluent interprets the udf ok and gives an output file that seems reasonable after I hook it into the report->dpm->summary gui. Thanks for any suggestions. Karl |
|
January 29, 2004, 09:38 |
Re: DEFINE_DPM_OUTPUT udf
|
#2 |
Guest
Posts: n/a
|
I just had a look in dpm.h, and somewhat oddly, you have
#define P_VEL(p)(p->state.V) and #define P_POS(p,i)(p->state.pos[i]) This seems to imply that you should use P_POS(p, 0) in your function above, but P_VEL(p)[0]. Go figure |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Dynamic Mesh UDF | Qureshi | FLUENT | 7 | March 23, 2017 08:37 |
UDF parallel error: chip-exec: function not found????? | shankara.2 | Fluent UDF and Scheme Programming | 1 | January 16, 2012 23:14 |
How to add a UDF to a compiled UDF library | kim | FLUENT | 3 | October 26, 2011 22:38 |
UDF...UDF...UDF...UDF | Luc SEMINEL | FLUENT | 0 | November 25, 2002 05:03 |
UDF, UDF, UDF, UDF | Luc SEMINEL | Main CFD Forum | 0 | November 25, 2002 05:01 |