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

What’s the problem with this udf?

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

Reply
 
LinkBack Thread Tools Display Modes
Old   October 8, 2013, 06:30
Post What’s the problem with this udf?
  #1
New Member
 
neda rahimi
Join Date: May 2013
Posts: 13
Rep Power: 5
nikiii is on a distinguished road
What’s the problem with this udf?

#include "udf.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 /* relative permittivity-particle dielectric constatnt */
#define Dp 4e-6 /* diameter of particles */
#define bi 0.00015 /* ion mobility */
DEFINE_DPM_BODY_FORCE(particle_body_force, p, i)
{
Domain*d;
real bforcex,bforcey, Qs, E, Q, tow, towc, Qp;
real bforce=0;
Thread *t;
cell_t c;
face_t f;
d=Get_Domain(2);
thread_loop_c(t,d)
{
begin_c_loop(c,t)
{
E=sqrt(ND_SUM(pow(C_UDMI(c,t,0),2),pow(C_UDMI(c,t, 1),2)));
Qs=(3*pi*E0*KP*pow(Dp,2)*E)/(KP+2);
tow=(4*E0)/(C_UDSI(c,t,1)*bi);
towc=(8*E0*K*T)/(Dp*e*ci*C_UDSI(c,t,1));
Qp=Qs*(P_TIME(p)/(P_TIME(p)+tow))+(2*pi*E0*Dp*K*T/e)*log(1+(P_TIME(p)/C_UDMI(c,t,2)));
C_UDMI(c,t,3)=Qp;
bforcex=Qp*C_UDMI(c,t,0);
bforcey=Qp*C_UDMI(c,t,1);
bforce=sqrt(ND_SUM(pow(bforcex,2),pow(bforcey,2))) ;
C_UDMI(c,t,4)=bforce;
}
end_c_loop(c,t)
}
I consider 2 uds and 5 udm in define/user define/scalars or memories.
It compiled successfully but when I want track particle in fluent, this error appear.
Error:
FLUENT received fatal signal (ACCESS_VIOLATION)
1. Note exact events leading to error.
2. Save case/data under new name.
3. Exit program and restart to continue.
4. Report error to your distributor.
Error Object: ()

If anybody know what should I do please help me. Thank you.
nikiii is offline   Reply With Quote

Old   October 8, 2013, 08:39
Default
  #2
Senior Member
 
A CFD free user's Avatar
 
A-A Azarafza
Join Date: Jan 2013
Posts: 206
Rep Power: 6
A CFD free user is on a distinguished road
Hi dude
The problem which many guys encounter when working with UDF. You have probably forgot to set UDM in Fluent. This error shows when someone forgets to set UDM or even less than the numbers used in UDF. For instance, you have three UDMs but set only two. Here, the error comes.
__________________
Regard yours
A CFD free user is offline   Reply With Quote

Old   October 8, 2013, 09:25
Default
  #3
New Member
 
neda rahimi
Join Date: May 2013
Posts: 13
Rep Power: 5
nikiii is on a distinguished road
I set 6 UDHs in define/user-define/memories. but this error appears again.
nikiii is offline   Reply With Quote

Old   October 8, 2013, 17:39
Default
  #4
Senior Member
 
A CFD free user's Avatar
 
A-A Azarafza
Join Date: Jan 2013
Posts: 206
Rep Power: 6
A CFD free user is on a distinguished road
Hi!
I suppose that the problem is due to not invoking UDM(s) and UDS(s) that you already defined and you're gonna use. If you have a look at your UDF, you can see that you've using UDS(s) and UDM(s) that have not invoked in this UDF. For instance, UDS(c,t,0)? It's undefined. Try it, it works.
__________________
Regard yours
A CFD free user is offline   Reply With Quote

Reply

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
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM Rizwan Fluent UDF and Scheme Programming 32 May 8, 2015 06:05
what's the problem with my udf zzyan FLUENT 0 November 4, 2010 04:56
Problem with my udf july Fluent UDF and Scheme Programming 3 June 20, 2010 06:56
udf compiling problem akr FLUENT 3 August 22, 2007 07:14
UDF problem chiseung FLUENT 4 January 10, 2002 10:58


All times are GMT -4. The time now is 23:31.