|
[Sponsors] |
October 8, 2013, 07:30 |
What’s the problem with this udf?
|
#1 |
New Member
neda rahimi
Join Date: May 2013
Posts: 13
Rep Power: 12 |
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. |
|
October 8, 2013, 09:39 |
|
#2 |
Senior Member
A-A Azarafza
Join Date: Jan 2013
Posts: 226
Rep Power: 14 |
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 |
|
October 8, 2013, 10:25 |
|
#3 |
New Member
neda rahimi
Join Date: May 2013
Posts: 13
Rep Power: 12 |
I set 6 UDHs in define/user-define/memories. but this error appears again.
|
|
October 8, 2013, 18:39 |
|
#4 |
Senior Member
A-A Azarafza
Join Date: Jan 2013
Posts: 226
Rep Power: 14 |
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 |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
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 |
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 07:56 |
udf compiling problem | akr | FLUENT | 3 | August 22, 2007 08:14 |
UDF problem | chiseung | FLUENT | 4 | January 10, 2002 10:58 |