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

about the macro P_USER_REAL(p,i)

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

Reply
 
LinkBack Thread Tools Display Modes
Old   October 10, 2009, 21:05
Default about the macro P_USER_REAL(p,i)
  #1
New Member
 
haigang wang
Join Date: Apr 2009
Posts: 2
Rep Power: 0
haigangwang is on a distinguished road
I have written one udf programe about DPM,but when I hook them,it is giving me a error:P_USER_REAL(p,0): undeclared variable.Please help me!

my programe:

#include "udf.h"
#include "models.h"
#include "dpm.h"
#include "surf.h"
#include "threads.h"
#include "math.h"
#include "mem.h"
DEFINE_DPM_SCALAR_UPDATE(particle_depostion,c,t,in itialize,p)
{
int i = 0;
face_t f;
Thread *th;
real A[ND_ND];
real area=0,vol=0;

int wall_ID=4;
if (initialize)
P_USER_REAL(p, 0) = 0;
c_face_loop(c,t,i)
{
if(THREAD_ID(C_FACE_THREAD(c,t,i)) == wall_ID)
{

f=C_FACE(c,t,i);
th=C_FACE_THREAD(c,t,i);
F_AREA(A,f, th);
area = NV_MAG(A);
vol=C_VOLUME(c,t);

if(P_DIAM(p)<0.01)
{

C_UDMI(c, t, 0) +=P_DIAM(p);
P_USER_REAL(p,0) = 1.; /* "Evaporate" */


}

}
}

}

DEFINE_DPM_LAW(stop_dpm_law,p,if_cpld)
{
if (0. < P_USER_REAL(p,0))
P_MASS(p) = 0.; /* "Evaporate" */
}
DEFINE_INIT(my_init_func,d)
{
cell_t c;
Thread *t;

thread_loop_c(t,d)
{

begin_c_loop_all(c,t)
{
C_UDMI(c,t,0)=0;

}
end_c_loop_all(c,t)
}
}


haigangwang is offline   Reply With Quote

Old   October 12, 2009, 04:00
Default
  #2
New Member
 
Join Date: Apr 2009
Location: KA, Germany
Posts: 20
Rep Power: 8
Häwimeddel is on a distinguished road
Try to access the user memory of the particle in this way:

Code:
p->user[0] = ...
Do´t forget to enable as many user variables as you need (in your case it would be only one so far) in the UDF panel of the discrete phase model menu!
Häwimeddel is offline   Reply With Quote

Old   October 22, 2009, 21:50
Default thank you
  #3
New Member
 
haigang wang
Join Date: Apr 2009
Posts: 2
Rep Power: 0
haigangwang is on a distinguished road
I have understood your mean.Tnanks.
Quote:
Originally Posted by Häwimeddel View Post
Try to access the user memory of the particle in this way:

Code:
p->user[0] = ...
Do´t forget to enable as many user variables as you need (in your case it would be only one so far) in the UDF panel of the discrete phase model menu!
haigangwang 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
Macro Trouble -Winows Explorer Crashes with Macro Martin Castillo FLUENT 1 July 25, 2007 04:18
Macro problem cfddummy CD-adapco 1 April 9, 2007 12:37
macro not function! guang ai CD-adapco 0 July 25, 2004 18:53
Call a macro from a macro Flav CD-adapco 2 July 1, 2004 05:42
Bug in the DEFINE_ADJUST macro? Senthil FLUENT 5 September 3, 2002 22:26


All times are GMT -4. The time now is 22:57.