|
[Sponsors] |
June 10, 2006, 21:49 |
help UDF
|
#1 |
Guest
Posts: n/a
|
Hi. I'm using a DEFINE_INIT macro to define memories with (C_UDMI(cell,thread,0) for store the mass of particle. compiling my UDF is OK, But when I write UDMI0 , the value is 0, I dont' know where is the problem can somebody help me please? thanks my UDF is:
#include "udf.h" #define MIN_IMPACT_VELO 0.0001 Domain *domain; DEFINE_DPM_EROSION(dpm_accr, p, t, f, normal, alpha, Vmag, Mdot) { real A[ND_ND], area; int num_in_data; Thread *t0; cell_t c; real radi_pos[2], radius, imp_vel[2], vel_ortho; radi_pos[0] = p->state.pos[1]; /* Radial location vector. */ radi_pos[1] = p->state.pos[2]; /* (Y and Z in 0 and 1...) */ radius = NV_MAG(radi_pos); NV_VS(radi_pos, =, radi_pos, /, radius); /* Normalized radius direction vector.*/ imp_vel[0] = P_VEL(p)[0]; /* Axial particle velocity component. */ imp_vel[1] = NVD_DOT(radi_pos, P_VEL(p)[1], P_VEL(p)[2], 0.); vel_ortho = NV_DOT(imp_vel, normal); /*velocity orthogonal to wall */ if(fabs(vel_ortho)< MIN_IMPACT_VELO) C_UDMI(c,t,0) = C_UDMI(c,t,0)+ P_MASS(p); return; } DEFINE_INIT(my_init,domain) { Domain*Domain =Get_Domain(1); Thread *t; cell_t c; thread_loop_c(t,domain) { begin_c_loop_all(c,t) { C_UDMI(c,t,0)=0.0; }end_c_loop_all(c,thread) } } |
|
June 12, 2006, 07:52 |
Re: help UDF
|
#2 |
Guest
Posts: n/a
|
try changing the line C_UDMI(c,t,0) = C_UDMI(c,t,0)+ P_MASS(p);
to this C_UDMI(c,t,0) += P_MASS(p); |
|
June 12, 2006, 20:20 |
Re: help UDF
|
#3 |
Guest
Posts: n/a
|
Hi thanks to your Re. i try changing that line,but it is no any change to UDMI. could you give me some other advise?
|
|
June 13, 2006, 02:07 |
Re: help UDF
|
#4 |
Guest
Posts: n/a
|
Have you checked wether your conditional statement: if(fabs(vel_ortho)< MIN_IMPACT_VELO) ever becomes true? Markus
|
|
June 13, 2006, 06:46 |
Re: help UDF
|
#5 |
Guest
Posts: n/a
|
hi: thanks to your Re. I am a new FLUENT, i don't known how to checked the conditional statement:if(fabs(vel_ortho)< MIN_IMPACT_VELO). could you give me more help?
|
|
June 14, 2006, 05:08 |
Re: help UDF
|
#6 |
Guest
Posts: n/a
|
You can check it with a UDM. Before the conditional statement put: C_UDMI(c,t,1) = 0;
After the conditional "if" statement put: C_UDMI(c,t,1) = 1; Then run the problem and if UDM 1 is equal to 1 in any cells then the conditional statment is true. |
|
June 15, 2006, 02:55 |
Re: help UDF
|
#7 |
Guest
Posts: n/a
|
hi: thanks to your Re. By checking UDM,i know that the conditional "if" statemen is not use to judge. But why is it no use? how to revised the UDF i ought to ? i think that maybe other line is wrong in the UDF.
|
|
|
|
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 |