CFD Online Logo CFD Online URL
Home > Forums > FLUENT


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

LinkBack Thread Tools Display Modes
Old   January 28, 2004, 18:40
K. Kevala
Posts: n/a

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+");


fprintf(fp,"This is a test\n"); else{





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.

  Reply With Quote

Old   January 29, 2004, 09:38
Robert Hart
Posts: n/a
I just had a look in dpm.h, and somewhat oddly, you have

#define P_VEL(p)(p->state.V)


#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

  Reply With Quote


Thread Tools
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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
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 21:38
Dynamic Mesh UDF Qureshi FLUENT 1 December 2, 2009 01:27
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

All times are GMT -4. The time now is 11:37.