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

Problem with UDF!

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 22, 2013, 05:52
Unhappy Problem with UDF!
  #1
New Member
 
neda rahimi
Join Date: May 2013
Posts: 13
Rep Power: 13
nikiii is on a distinguished road
Hello,
What''s wrong with my UDF?
It compiled successfully and when i track particle it work but UDMI couldn't be updated.
Please help me.
thank you.

#include "udf.h"
#include "mem.h"
#define K 1.38e-23
#define e 1.6e-19
#define T 293
#define ci 240
#define E0 8.854e-12
#define pi 3.141593
#define KP 2.5
#define bi 0.00015

DEFINE_DPM_SCALAR_UPDATE(charge,c,t,initialize,p)
{
real Qs, E, Q, tow, towc, Qp, dQ_dt, dQ;

if (initialize)
{
/* this is the initialization call, set:
* p->user[0] contains the melting index, initialize to 0
* viscosity_0 contains the viscosity at the start of a time step*/
C_UDMI(c,t,3)= 0.;
C_UDMI(c,t,2)=0;
}

else
{

E=sqrt(ND_SUM(pow(C_UDMI(c,t,0),2),pow(C_UDMI(c,t, 1),2)));
Qs=(3*pi*E0*KP*pow(P_DIAM(p),2)*E)/(KP+2);
tow=(4*E0)/(C_UDSI(c,t,1)*bi);
towc=(8*E0*K*T)/(P_DIAM(p)*e*ci*C_UDSI(c,t,1));
Qp=Qs*(P_TIME(p)/(P_TIME(p)+tow))+(2*pi*E0*P_DIAM(p)*K*T/e)*log(1+(P_TIME(p)/towc));
dQ_dt=Qs*(tow/(pow((P_TIME(p)+tow),2)))+(2*pi*E0*P_DIAM(p)*K*T/e)*(1/(towc+P_TIME(p)));
dQ=P_DT(p)*dQ_dt;
C_UDMI(c,t,3)=C_UDMI(c,t,2)+dQ;
/* Update UDMI(c,t,2) for start of next step */
C_UDMI(c,t,2) = C_UDMI(c,t,3);
}
}
nikiii is offline   Reply With Quote

Reply

Tags
udf and programming


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
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM Rizwan Fluent UDF and Scheme Programming 40 March 18, 2018 07:05
Problem with my udf july Fluent UDF and Scheme Programming 3 June 20, 2010 07:56
UDF problem mansha goraya FLUENT 0 October 29, 2007 01:31
udf compiling problem akr FLUENT 3 August 22, 2007 08:14
UDF problem chiseung FLUENT 4 January 10, 2002 10:58


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