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

Help: UDF problem--How to add bodyfore to the DPM

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 13, 2003, 16:10
Default Help: UDF problem--How to add bodyfore to the DPM
  #1
KE
Guest
 
Posts: n/a
My model is to build a ultrafine particle injection to laminar flow with the electric field fore. (2D, Steady,DPM). When I want to add the constant electric field as body fore using UDF, I met a compile error and following is my code:

#include "udf.h"

#define ELECTRIC_FORCE=1.0045

DEFINE_DPM_BODY_FORCE(particle_body_electric, p, i) {

real bforce;

if(i==0)

{

bforce=0;

}

else

{

bforce=-ELECTRIC_FORCE; /* electric force Y */

}

return bforce; } I noticed that I didn't use p as a parameter in the micro definition. But I don't know what's wrong with these seemingly simple lines.

I need your help!

Sincerely
  Reply With Quote

Old   August 17, 2003, 09:46
Default Re: Help: UDF problem--How to add bodyfore to the
  #2
Chen Fangzhi
Guest
 
Posts: n/a
I think the error is due to the define declaration It should be:

#define ELECTRIC_FORCE 1.005
  Reply With Quote

Old   August 17, 2003, 15:08
Default Re: Help: UDF problem--How to add bodyfore to the
  #3
KE
Guest
 
Posts: n/a
Thank u for your advice. I've already corrected it. But I still have some problems with UDF-sometimes it can compile the file I difined, sometimes it didn't. It's the exact same file. I really don't know what's wrong with the fluent compiler. Usually it needs several times to get it complied and connected to the iretation.

Good luck to U!
  Reply With Quote

Old   August 18, 2003, 09:02
Default Re: Help: UDF problem--How to add bodyfore to the
  #4
Chen Fangzhi
Guest
 
Posts: n/a
I don't know the detail of your udf, but if you want to use some advanced features of UDF, you'd better to use compiled rather than interpreted.
  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
A problem about 'printf' and 'Message' in UDF. LICH Fluent UDF and Scheme Programming 2 May 2, 2013 03:45
DPM Output Problem (Again...) DLINSA Fluent UDF and Scheme Programming 1 March 16, 2012 01:45
Parallel DPM Udf problem dust_2 Fluent UDF and Scheme Programming 4 June 11, 2011 11:03
problem in compoile UDF h.daniyel FLUENT 5 June 12, 2008 06:06
fluent UDF external library lapack problem Rick FLUENT 0 May 7, 2008 11:16


All times are GMT -4. The time now is 22:13.