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

help UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 10, 2006, 21:49
Default help UDF
  #1
zhangzhongbin
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) } }

  Reply With Quote

Old   June 12, 2006, 07:52
Default Re: help UDF
  #2
Aidan
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);
  Reply With Quote

Old   June 12, 2006, 20:20
Default Re: help UDF
  #3
zhangzhongbin
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?

  Reply With Quote

Old   June 13, 2006, 02:07
Default Re: help UDF
  #4
Markus
Guest
 
Posts: n/a
Have you checked wether your conditional statement: if(fabs(vel_ortho)< MIN_IMPACT_VELO) ever becomes true? Markus
  Reply With Quote

Old   June 13, 2006, 06:46
Default Re: help UDF
  #5
zhangzhongbin
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?
  Reply With Quote

Old   June 14, 2006, 05:08
Default Re: help UDF
  #6
Aidan
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.
  Reply With Quote

Old   June 15, 2006, 02:55
Default Re: help UDF
  #7
zhangzhongbin
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.

  Reply With Quote

Reply


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
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


All times are GMT -4. The time now is 19:52.