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

DEFINE_DPM_OUTPUT udf

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 28, 2004, 17:40
Default DEFINE_DPM_OUTPUT udf
  #1
K. Kevala
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
  Reply With Quote

Old   January 29, 2004, 08:38
Default Re: DEFINE_DPM_OUTPUT udf
  #2
Robert Hart
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

  Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic Mesh UDF Qureshi FLUENT 7 March 23, 2017 07:37
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 22:14
How to add a UDF to a compiled UDF library kim FLUENT 3 October 26, 2011 21:38
UDF...UDF...UDF...UDF Luc SEMINEL FLUENT 0 November 25, 2002 04:03
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 04:01


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